diff --git a/Source/driver/Castro_util.H b/Source/driver/Castro_util.H index 9dd3c4606b..c6162b0190 100644 --- a/Source/driver/Castro_util.H +++ b/Source/driver/Castro_util.H @@ -174,7 +174,7 @@ Real distance(GeometryData const& geomdata, GpuArray& loc) return std::sqrt(loc[0]*loc[0] + loc[1]*loc[1]); } - return loc[0]; + return std::abs(loc[0]); } diff --git a/Source/driver/Derive.cpp b/Source/driver/Derive.cpp index a59cdaccda..78a1dfcc35 100644 --- a/Source/driver/Derive.cpp +++ b/Source/driver/Derive.cpp @@ -661,7 +661,7 @@ extern "C" der(i,j,k,0) = (-dat(i,j,k,1)*loc[1] + dat(i,j,k,2)*loc[0]) / (dat(i,j,k,0)*r); #endif } else { - Real r = distance(geomdata, loc); + Real r = distance(geomdata, loc); // we really mean just the velocity component that is // perpendicular to radial, and in general 3-d (e.g. a