#include #include #include #include void CoordBase_SetupMask (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; CCTK_INT nboundaryzones[6]; CCTK_INT is_internal[6]; CCTK_INT is_staggered[6]; CCTK_INT shiftout[6]; int imin[3], imax[3]; /* domain extent */ int bmin[3], bmax[3]; /* boundary extent */ int i, j, k; int d, f; int dd; int ierr; ierr = GetBoundarySpecification (6, nboundaryzones, is_internal, is_staggered, shiftout); if (ierr != 0) { CCTK_WARN (0, "Could not get boundary specification"); } /* Loop over all dimensions and faces */ for (d=0; d<3; ++d) { for (f=0; f<2; ++f) { /* If this processor has the outer boundary */ if (cctk_bbox[2*d+f]) { int npoints; if (is_internal[2*d+f]) { /* The boundary extends inwards */ npoints = - nboundaryzones[2*d+f] + shiftout[2*d+f]; } else { /* The boundary extends outwards */ npoints = nboundaryzones[2*d+f] + shiftout[2*d+f] - 1; } /* If there are boundary that should be ignored */ if (npoints >= 0) { if (npoints < 0 || npoints > cctk_lsh[d]) { CCTK_WARN (0, "Illegal number of boundary points"); } /* Calculate the extent of the domain */ for (dd=0; dd<3; ++dd) { imin[dd] = 0; imax[dd] = cctk_lsh[dd]; } /* Calculate the extent of the boundary */ for (dd=0; dd<3; ++dd) { bmin[dd] = imin[dd]; bmax[dd] = imax[dd]; } if (f==0) { /* lower face */ bmax[d] = imin[d] + npoints; } else { /* upper face */ bmin[d] = imax[d] - npoints; } /* Loop over the boundary */ if (verbose) { CCTK_VInfo (CCTK_THORNSTRING, "Setting boundary points in direction %d face %d to weight 0", d, f); } #pragma omp parallel for for (k=bmin[2]; k