aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/CarpetInterp2/src/fasterp.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc
index fcc874264..19d0eed51 100644
--- a/Carpet/CarpetInterp2/src/fasterp.cc
+++ b/Carpet/CarpetInterp2/src/fasterp.cc
@@ -425,7 +425,8 @@ namespace CarpetInterp2 {
case 11: interpolate<11> (lsh, varptrs, vals); break;
default:
// Add higher orders here as desired
- CCTK_WARN (CCTK_WARN_ABORT, "Interpolation orders larger than 11 are not yet implemented");
+ CCTK_WARN (CCTK_WARN_ABORT,
+ "Interpolation orders larger than 11 are not yet implemented");
assert (0);
}
}
@@ -547,6 +548,20 @@ namespace CarpetInterp2 {
"Setting up interpolation for %d grid points",
int(locations.size()));
+ if (order < 0) {
+ CCTK_WARN (CCTK_WARN_ABORT,
+ "Interpolation order must be non-negative");
+ }
+ if (order > max_order) {
+ CCTK_VWarn (CCTK_WARN_ABORT,
+ __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Interpolation order cannot be larger than max_order=%d; "
+ "order=%d was requested. "
+ "(You can increase the compile time constant max_order "
+ "in thorn CarpetInterp2.)",
+ max_order, order);
+ }
+
// Some global properties
int const npoints = locations.size();
int const nprocs = CCTK_nProcs (cctkGH);