aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid
diff options
context:
space:
mode:
authorschnetter <>2004-06-27 19:18:00 +0000
committerschnetter <>2004-06-27 19:18:00 +0000
commit5ef733356358a112d72685aa6079028ec9464dc8 (patch)
treed1d8bf1df8cb7320030789d2e5f9933edb32b6dc /Carpet/CarpetRegrid
parent0ecd6f28fb015991361602c05e4dbe6489df1da7 (diff)
Ensure that the spacing as given by the user is consistent with the
Ensure that the spacing as given by the user is consistent with the refinement factor. darcs-hash:20040627191847-07bb3-03451c512721a46e120580d7ed1299e88c966f9c.gz
Diffstat (limited to 'Carpet/CarpetRegrid')
-rw-r--r--Carpet/CarpetRegrid/src/manualcoordinatelist.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
index 94c6d43d6..770b368a2 100644
--- a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
+++ b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
@@ -1,6 +1,6 @@
-#include <assert.h>
-#include <string.h>
-
+#include <cassert>
+#include <cmath>
+#include <cstring>
#include <vector>
#include "cctk.h"
@@ -12,7 +12,7 @@
#include "regrid.hh"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/manualcoordinatelist.cc,v 1.7 2004/06/14 06:59:52 schnetter Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/manualcoordinatelist.cc,v 1.8 2004/06/27 21:18:47 schnetter Exp $";
CCTK_FILEVERSION(Carpet_CarpetRegrid_manualcoordinatelist_cc);
}
@@ -155,6 +155,8 @@ namespace CarpetRegrid {
for (size_t c=0; c<newbbss.at(rl-1).size(); ++c) {
rbbox const & ext = newbbss.at(rl-1).at(c);
bbvect const & ob = newobss.at(rl-1).at(c);
+ rvect const spacing = base_spacing / ipow(reffact, rl);
+ assert (all(abs(ext.stride() - spacing) < spacing * 1.0e-10));
ManualCoordinates_OneLevel
(cctkGH, hh, rl, refinement_levels,
ext.lower(), ext.upper(), ob, bbs, obs);