aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid/src
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2004-10-08 21:44:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2004-10-08 21:44:00 +0000
commit2e02171b249acbe27eb6e55b8001ea3fc0c0a00e (patch)
tree2c50c95982d4a1d6ef01d73deec5ed25b66644e6 /Carpet/CarpetRegrid/src
parentfaa8daafc46832a22b642bc63cbc68ee31355432 (diff)
CarpetRegrid: output a legible error message for errors in the refinement specification parameters
darcs-hash:20041008214424-891bb-b18a419225280e6386f3408b345716b68a7a2303.gz
Diffstat (limited to 'Carpet/CarpetRegrid/src')
-rw-r--r--Carpet/CarpetRegrid/src/manualcoordinatelist.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
index 1a2a4b871..b29d1a604 100644
--- a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
+++ b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
@@ -161,6 +161,14 @@ namespace CarpetRegrid {
// TODO: why can basemglevel not be used here?
// rvect const spacing = base_spacing * pow(CCTK_REAL(mgfact), basemglevel) / ipow(reffact, rl);
rvect const spacing = base_spacing / ipow(reffact, rl);
+ if (! all(abs(ext.stride() - spacing) < spacing * 1.0e-10)) {
+ assert (dim==3);
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "The grid spacing on refinement level %d is incorrect. I expected [%g,%g,%g], but I found [%g,%g,%g].",
+ int(rl),
+ double(spacing[0]), double(spacing[1]), double(spacing[2]),
+ double(ext.stride()[0]), double(ext.stride()[1]), double(ext.stride()[2]));
+ }
assert (all(abs(ext.stride() - spacing) < spacing * 1.0e-10));
rvect offset = rvect(0);