aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-01-27 10:40:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-01-27 10:40:00 +0000
commit2d14b56f07f70752181e24039b57c673b5a2b0d8 (patch)
treef3681e3f2f103cdcea9672a6e74cf538bc078399
parent174928d579951712e21a361706c3c3188634e5af (diff)
Carpet: Forbid adaptive time step sizes when there is mesh refinement
darcs-hash:20050127104026-891bb-a27d7fdb9c56755e5b3d3be44606ee66e3973614.gz
-rw-r--r--Carpet/Carpet/src/CarpetParamCheck.cc10
-rw-r--r--Carpet/Carpet/src/Recompose.cc5
2 files changed, 10 insertions, 5 deletions
diff --git a/Carpet/Carpet/src/CarpetParamCheck.cc b/Carpet/Carpet/src/CarpetParamCheck.cc
index 5e8939166..085f91e1f 100644
--- a/Carpet/Carpet/src/CarpetParamCheck.cc
+++ b/Carpet/Carpet/src/CarpetParamCheck.cc
@@ -24,11 +24,15 @@ namespace Carpet {
DECLARE_CCTK_PARAMETERS;
if (CCTK_ParameterQueryTimesSet ("periodic", "Carpet")
- || CCTK_ParameterQueryTimesSet ("periodic_x", "Carpet")
- || CCTK_ParameterQueryTimesSet ("periodic_y", "Carpet")
- || CCTK_ParameterQueryTimesSet ("periodic_z", "Carpet")) {
+ or CCTK_ParameterQueryTimesSet ("periodic_x", "Carpet")
+ or CCTK_ParameterQueryTimesSet ("periodic_y", "Carpet")
+ or CCTK_ParameterQueryTimesSet ("periodic_z", "Carpet")) {
CCTK_PARAMWARN ("Some of the parameters \"Carpet::periodic*\" have been set. These parameters are there for compatibility reasons only and must not be used.");
}
+
+ if (adaptive_stepsize and max_refinement_levels > 1) {
+ CCTK_PARAMWARN ("Adaptive time step sizes do not work with mesh refinement yet. Please use only a single level, and set max_refinement_levels=1.");
+ }
}
} // namespace Carpet
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc
index 0bafda449..a124ab73c 100644
--- a/Carpet/Carpet/src/Recompose.cc
+++ b/Carpet/Carpet/src/Recompose.cc
@@ -471,7 +471,8 @@ namespace Carpet {
// choose a number of slices for this direction
int const nslices
= min(nprocs,
- (int)floor(mysize * pow(nprocs/allsizes, 1.0/alldims) + 0.5));
+ (int)floor(mysize * pow(nprocs/allsizes, (CCTK_REAL)1/alldims)
+ + 0.5));
assert (nslices <= nprocs);
if (DEBUG) cout << "SRAR " << mydim << " nprocs " << nprocs << endl;
if (DEBUG) cout << "SRAR " << mydim << " nslices " << nslices << endl;
@@ -654,7 +655,7 @@ namespace Carpet {
for (int d=0; d<dim; ++d) {
rshape[d] = (CCTK_REAL)(rub[d]-rlb[d]) / (rub[0]-rlb[0]);
}
- const CCTK_REAL rfact = pow(nprocs / prod(rshape), 1.0/dim);
+ const CCTK_REAL rfact = pow(nprocs / prod(rshape), (CCTK_REAL)1/dim);
rshape *= rfact;
assert (abs(prod(rshape) - nprocs) < 1e-6);
}