aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetReduce/src/mask_init.c
blob: f111c4c67421da127b8afa012eb7fefb4c067e5c (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
#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);
  }
  
  unsigned const bits = BMSK(cctk_dim);
  unsigned const allbits = BMSK(bits) - 1;
#pragma omp parallel
  CCTK_LOOP3_ALL(MaskBase_InitMask, cctkGH, i,j,k) {
    int const ind = CCTK_GFINDEX3D (cctkGH, i,j,k);
    iweight[ind] = allbits;
  } CCTK_ENDLOOP3_ALL(MaskBase_InitMask);
}