aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetReduce/src/mask_init.c
blob: 806a4b3d01ae9cab2e24771fd28bb95622730dce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <cctk.h>
#include <cctk_Arguments.h>
#include <cctk_Parameters.h>

#include <loopcontrol.h>

#include "bits.h"



void
MaskBase_InitMask (CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Initialise the weight to 1 everywhere */
  if (verbose) {
    int const reflevel = GetRefinementLevel(cctkGH);
    CCTK_VInfo (CCTK_THORNSTRING,
                "Initialising weight to 1 on level %d", reflevel);
  }
  
  int const allbits = BMSK(BMSK(cctk_dim)) - 1;
#pragma omp parallel
  LC_LOOP3(MaskBase_InitMask_interior,
           i,j,k,
           0,0,0, cctk_lsh[0],cctk_lsh[1],cctk_lsh[2],
           cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])
  {
    int const ind = CCTK_GFINDEX3D (cctkGH, i, j, k);
    iweight[ind] = allbits;
  } LC_ENDLOOP3(MaskBase_InitMask_interior);
}