| File: | /home/sbrandt/cactus/Cactus/arrangements/Carpet/Carpet/src/UnusedMask.cc |
| 1 | :#include <cctk.h>
|
| 2 | :#include <cctk_Arguments.h>
|
| 3 | :#include <cctk_Parameters.h>
|
| 4 | :
|
| 5 | :#include <carpet.hh>
|
| 6 | :
|
| 7 | :#include <loopcontrol.h>
|
| 8 | :
|
| 9 | :namespace Carpet {
|
| 10 | :
|
| 11 | : using namespace std;
|
| 12 | :
|
| 13 | : void
|
| 14 | : CarpetUnusedMask (CCTK_ARGUMENTS)
|
| 15 | : {
|
| 16 | : DECLARE_CCTK_ARGUMENTS;
|
| 17 | : DECLARE_CCTK_PARAMETERS;
|
| 18 | :
|
| 19 | : dh const & dd = *vdd.AT(map);
|
| 20 | : ibbox const & ext = dd.light_boxes.AT(mglevel).AT(reflevel).AT(component).exterior;
|
| 21 | : ibset const & unused_region = dd.local_boxes.AT(mglevel).AT(reflevel).AT(local_component).unused_region;
|
| 22 | :
|
| 23 | : assert(dim == 3);
|
| 24 | : // Zero out
|
| 25 | : LOOP_OVER_BSET (cctkGH, ext, box, imin, imax) {
|
| 26 | :#pragma omp parallel
|
| 27 | : CCTK_LOOP3(unused_mask_zero, i, j, k,
|
| 28 | : imin[0],imin[1],imin[2], imax[0],imax[1],imax[2],
|
| 29 | : cctk_ash[0],cctk_ash[1],cctk_ash[2])
|
| 30 | : {
|
| 31 | : CCTK_INT i3D = CCTK_GFINDEX3D(cctkGH, i, j, k);
|
| 32 | : carpet_unusedpoints_mask[i3D] = 0;
|
| 33 | : } CCTK_ENDLOOP3(unused_mask_zero);
|
| 34 | : } END_LOOP_OVER_BSET;
|
| 35 | :
|
| 36 | : // Set it where unused
|
| 37 | : LOOP_OVER_BSET (cctkGH, unused_region, box, imin, imax) {
|
| 38 | :#pragma omp parallel
|
| 39 | : CCTK_LOOP3(unused_mask_set, i, j, k,
|
| 40 | : imin[0],imin[1],imin[2], imax[0],imax[1],imax[2],
|
| 41 | : cctk_ash[0],cctk_ash[1],cctk_ash[2])
|
| 42 | : {
|
| 43 | : CCTK_INT i3D = CCTK_GFINDEX3D(cctkGH, i, j, k);
|
| 44 | : carpet_unusedpoints_mask[i3D] = 1;
|
| 45 | : } CCTK_ENDLOOP3(unused_mask_set);
|
| 46 | : } END_LOOP_OVER_BSET;
|
| 47 | :
|
| 48 | : } // CarpetUnusedMask
|
| 49 | :
|
| 50 | :}
|