From 2c626b4e52af42beedc5a0bc78576c6b42447600 Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Mon, 4 Jun 2012 19:24:36 -0700 Subject: Carpet: check ghost size against restrion operator order if use_higher_order_restriction = yes --- Carpet/Carpet/param.ccl | 6 ++++++ Carpet/Carpet/src/SetupGH.cc | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl index 0a3644a53..607355807 100644 --- a/Carpet/Carpet/param.ccl +++ b/Carpet/Carpet/param.ccl @@ -20,6 +20,12 @@ shares: IO USES STRING out_dir +shares: CarpetLib + +USES BOOLEAN use_higher_order_restriction +USES INT restriction_order_space + + private: BOOLEAN domain_from_coordbase "Use the domain description from CoordBase" diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index c43c73ae8..25448abf1 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -2683,11 +2683,19 @@ namespace Carpet { int const min_nghosts = ((prolongation_stencil_size + refinement_factor - 1) / (refinement_factor - 1)); + int const min_nghosts_restrict = + restriction_order_space / 2; if (any (any (ghosts.AT(rl) < i2vect (min_nghosts)))) { CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "There are not enough ghost zones for the desired spatial prolongation order on map %d, refinement level %d. With a spatial prolongation order of %d, you need at least %d ghost zones.", m, rl, my_prolongation_order_space, min_nghosts); } + if (use_higher_order_restriction and + any (any (ghosts.AT(rl) < i2vect (min_nghosts_restrict)))) { + CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, + "There are not enough ghost zones for the desired restriction order on map %d, refinement level %d. With a restriction order of %d, you need at least %d ghost zones.", + m, rl, restriction_order_space, min_nghosts_restrict); + } } } -- cgit v1.2.3