Overture  Version 25
BoundaryConditionParameters.h
Go to the documentation of this file.
1 #ifndef BOUNDARY_CONDITION_PARAMETERS_H
2 #define BOUNDARY_CONDITION_PARAMETERS_H
3 
4 #include "OvertureTypes.h"
5 #include "A++.h"
6 
7 #ifndef OV_USE_DOUBLE
9 #define REAL_MAPPED_GRID_FUNCTION floatMappedGridFunction
11 #define REAL_GRID_COLLECTION_FUNCTION floatGridCollectionFunction
12 #else
14 #define REAL_MAPPED_GRID_FUNCTION doubleMappedGridFunction
16 #define REAL_GRID_COLLECTION_FUNCTION doubleGridCollectionFunction
17 #endif
18 
19 
20 // ===================================================================================
21 // This class is used to pass optional parameters to the boundary condition routines
22 // ===================================================================================
24 {
25 public:
26 
28  {
31  symmetryCorner, // should be replaced by the one of the odd,even below -- keep for compatibility
32  taylor2ndOrder, // should be replaced by the taylor2ndOrderOddCorner below -- keep for compatibility
37  vectorSymmetryAxis1Corner, // even symmetry on all variables except normal component of the "velocity"
40  };
41 
42  // Here are different ways we can assign the data for boundary conditions
44  {
51  };
52 
54  {
59 
60 
63 
64  int lineToAssign; // apply Dirichlet BC on this line
67  int ghostLineToAssign; // assign this ghost line (various bc's)
68  int useMixedBoundaryMask; // normally true
69  int extraInTangentialDirections; // extend the set of pts assigned by this many ps in the tangential directions
70  int numberOfCornerGhostLinesToAssign; // assign this many lines at edges and corners, by default do all
71  int cornerExtrapolationOption; // for extrapolating corners along given directions instead of the diagonal
72 
73 
74  IntegerArray components; // hold components for various BC's
77 
78  int interpolateRefinementBoundaries; // if true, interpolate all refinement boundaries
79  int interpolateHidden; // if true, interpolate hidden coarse grid points from higher level refinemnts
80 
81  int setUseMask(int trueOrFalse=TRUE);
82  int getUseMask() const{ return useMask;}
83 
84  // Boundary conditions on mixed boundaries are normally NOT assigned at interior boundary points,
85  // unless you call the next function with "true"
86  int assignAllPointsOnMixedBoundaries( bool trueOrFalse=true );
87 
88  intArray & mask();
89 
90  CornerBoundaryConditionEnum getCornerBoundaryCondition( int side1, int side2, int side3 = -1 ) const;
91 
93  int setCornerBoundaryCondition( CornerBoundaryConditionEnum bc, int side1, int side2, int side3 = -1 );
94 
95  // Indicate which components form the "vector" for the vector symmetry corner BC (e.g. where the velocity
96  // components start in the list of components
97  int setVectorSymmetryCornerComponent( int component );
99 
100  // supply an array for variable coefficients in a BC: (set to NULL to turn off) (*new* way 2011/09/03)
102  realSerialArray *getVariableCoefficientsArray() const; // *new* 2011/09/03
103 
104  // olde way:
105  void setVariableCoefficients( REAL_MAPPED_GRID_FUNCTION & var ); // supply a grid function for variable coefficients
108  REAL_MAPPED_GRID_FUNCTION *getVariableCoefficients(const int & grid) const;
109 
110  void setRefinementLevelToSolveFor( int level );
112 
115 
116 
117  // This version is used by MappedGridOperators and expects 0 <= sideN <=2
118  int getCornerBC(int side1, int side2, int side3) const{return (int)cornerBC[side1][side2][side3];} //
119 
120  protected:
121 
122  CornerBoundaryConditionEnum cornerBC[3][3][3]; // 0=extrapolate, 1=symmetry
124 
126 
129  int useMask;
130  intArray *maskPointer; // for applying BC's selectively to points where mask != 0
131  int refinementLevelToSolveFor; // for refinement level solves.
133 
134 };
135 
136 #undef REAL_MAPPED_GRID_FUNCTION
137 #undef REAL_GRID_COLLECTION_FUNCTION
138 
139 #endif