#include #include #include #include #include #include #include #include #include #include "bits.h" #if 0 #define LOOP_OVER_NEIGHBOURS(dir) \ { \ ivect dir_(-1); \ do { \ ivect const& dir = dir_; \ { #define END_LOOP_OVER_NEIGHBOURS \ } \ for (int d_=0; d_ 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; ibbox const& ext = dd.light_boxes.AT(mglevel).AT(reflevel).AT(component).exterior; ibbox const& owned = dd.light_boxes.AT(mglevel).AT(reflevel).AT(component).owned; ibbox const world = owned; ibset const& active = dd.local_boxes.AT(mglevel).AT(reflevel).AT(local_component).active; // There are no prolongation boundaries on the coarsest level; // the outer boundary is treated elsewhere ibset const not_active = reflevel==0 ? ibset() : world - active; ibset const& fine_active = dd.local_boxes.AT(mglevel).AT(reflevel).AT(local_component).fine_active; if (verbose) { ostringstream buf; buf << "Setting prolongation region " << not_active << " on level " << reflevel; CCTK_INFO (buf.str().c_str()); buf << "Setting restriction region " << fine_active << " on level " << reflevel; CCTK_INFO (buf.str().c_str()); } // 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. // // For the prolongation region, the "boundary" is the first // layer outside of the region. For the restricted region, the // "boundary" is the outermost layer of grid points if this // layer is aligned with the next coarser (i.e. the current) // grid; otherwise, the boundary is empty. ibset test_boxes; ibset test_cfboxes; for (int neighbour=0; neighbour