Overture  Version 25
MappedGridOperatorsInclude.h
Go to the documentation of this file.
1 #ifndef MAPPED_GRID_OPERATORS_INCLUDE_H
2 #define MAPPED_GRID_OPERATORS_INCLUDE_H
3 
4 // define some stuff used internally by the MGOperators
5 
6 
7 // This next macro is used to optionally use a where mask or not, depending
8 // on whether any unused points or interiorBoundaryPoints on the grid. The user
9 // may also decide to optionally apply a boundary condition at only some points
10 // using the mask in the BoundaryConditionParameters.
11 // *** NOTE ***
12 // --> We assume that a PDE solver will interpolate and then apply BC's
13 // --> We DO apply boundary conditions at normal interpolation points, over-writing
14 // values assigned by the interpolator
15 // --> We DO NOT apply boundary conditions at interiorBoundaryPoints since we should
16 // not over-write values put there by the interpolator.
17 #define USE_MASK_IN_OPERATORS
18 #ifdef USE_MASK_IN_OPERATORS
19 
20 #define WHERE_MASK(EXPRESSION) \
21  if( (useWhereMaskOnBoundary[axis][side] && bcParameters.useMixedBoundaryMask) || bcParameters.getUseMask() ) \
22  { \
23  where( mask ) \
24  {\
25  EXPRESSION \
26  } \
27  } \
28  else \
29  {\
30  EXPRESSION \
31  }
32 
33 #define WHERE_MASK_ALL_COMPONENTS(EXPRESSION) \
34  if( (useWhereMaskOnBoundary[axis][side] && bcParameters.useMixedBoundaryMask) || bcParameters.getUseMask() ) \
35  { \
36  where( mask ) \
37  {\
38  for( n=uC.getBase(0); n<=uC.getBound(0); n++ ) \
39  { \
40  EXPRESSION \
41  } \
42  } \
43  } \
44  else \
45  {\
46  for( n=uC.getBase(0); n<=uC.getBound(0); n++ ) \
47  { \
48  EXPRESSION \
49  } \
50  }
51 
52 
53 // This is just like one above except that mask has a first dimension of length 1
54 #define WHERE_MASK0(EXPRESSION) \
55  if( (useWhereMaskOnBoundary[axis][side] && bcParameters.useMixedBoundaryMask) || bcParameters.getUseMask() ) \
56  { \
57  where( mask(0,I1m,I2m,I3m) ) \
58  {\
59  EXPRESSION \
60  } \
61  } \
62  else \
63  {\
64  EXPRESSION \
65  }
66 #else
67 #define WHERE_MASK
68 #define WHERE_MASK0
69 #endif
70 
71 #endif