diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-01-18 16:44:56 -0600 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 16:45:25 +0000 |
commit | 90c3774729e3a77c445442135943fc2e100065c1 (patch) | |
tree | 35ceb509c819f98f52706196c9eccea636bb81c8 /Carpet | |
parent | ca259f2e9694ed1d5f180da7ba21056d0c24728f (diff) |
CarpetRegrid2: Do not abort for the default refinement region radius values
Do not abort when the refinement region radius has its default value -1.
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetRegrid2/src/regrid.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc index 8112bd0d0..360b6e0c4 100644 --- a/Carpet/CarpetRegrid2/src/regrid.cc +++ b/Carpet/CarpetRegrid2/src/regrid.cc @@ -67,14 +67,14 @@ namespace CarpetRegrid2 { this->active = active[n]; this->position = rvect (position_x[n], position_y[n], position_z[n]); this->radius.resize (this->num_levels); - for (int rl = 0; rl < this->num_levels; ++ rl) { + this->radius.at(0) = rvect(-1.0, -1.0, -1.0); // unused + for (int rl = 1; rl < this->num_levels; ++ rl) { int const ind = index2 (lsh, rl, n); - CCTK_REAL const rx = radius_x[ind] < 0 ? radius[ind] : radius_x[ind]; - CCTK_REAL const ry = radius_y[ind] < 0 ? radius[ind] : radius_y[ind]; - CCTK_REAL const rz = radius_z[ind] < 0 ? radius[ind] : radius_z[ind]; + CCTK_REAL const rx = radius_x[ind] < 0.0 ? radius[ind] : radius_x[ind]; + CCTK_REAL const ry = radius_y[ind] < 0.0 ? radius[ind] : radius_y[ind]; + CCTK_REAL const rz = radius_z[ind] < 0.0 ? radius[ind] : radius_z[ind]; rvect const rad (rx, ry, rz); - this->radius.at(rl) = rad; - if (any (this->radius.at(rl) < 0.0)) { + if (any (rad < 0.0)) { CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, "The radius of refinement level %d of region %d is [%g,%g,%g], which is non-negative", rl, n, @@ -83,6 +83,7 @@ namespace CarpetRegrid2 { double(this->radius.at(rl)[2])); found_error = true; } + this->radius.at(rl) = rad; } if (this->num_levels > maxreflevels) { |