#include #include #include #include #include #include #include #include #include #include "bits.h" namespace CarpetMask { using namespace std; using namespace Carpet; /** * Reduce the weight on the current and the next coarser level to * make things consistent. Set the weight to 0 inside the active * region of the next coarser level, maybe to 1/2 near the boundary * of that region, and also to 1/2 near the prolongation boundary of * this level. */ extern "C" { void CarpetMaskSetup (CCTK_ARGUMENTS); } void CarpetMaskSetup (CCTK_ARGUMENTS) { DECLARE_CCTK_PARAMETERS; if (not is_singlemap_mode()) { CCTK_WARN (CCTK_WARN_ABORT, "This routine may only be called in singlemap mode"); } dh const& dd = *vdd.AT(Carpet::map); if (reflevel > 0) { ivect const reffact = spacereffacts.AT(reflevel) / spacereffacts.AT(reflevel-1); assert (all (reffact == 2)); } // Set prolongation boundaries and restricted region of this level BEGIN_LOCAL_COMPONENT_LOOP (cctkGH, CCTK_GF) { DECLARE_CCTK_ARGUMENTS; // Set the weight in the interior of the not_active and the // fine_active regions to zero, and set the weight on the // boundary of the not_active and fine_active regions to 1/2. dh::local_dboxes const& local_box = dd.local_boxes.AT(mglevel).AT(reflevel).AT(local_component); for (int neighbour=0; neighbour