Chombo + EB + MF  3.2
PhysIBC.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 //
12 // PhysIBC.H
13 // ============
14 //
15 // Virtual base class through which a user specifies the initial and boundary
16 // conditions for a hyperbolic system of PDEs.
17 //
18 
19 #ifndef _PHYSIBC_H_
20 #define _PHYSIBC_H_
21 
22 #include "FArrayBox.H"
23 #include "REAL.H"
24 #include "LevelData.H"
25 #include "ProblemDomain.H"
26 #include "NamespaceHeader.H"
27 
28 /// Physical/domain initial and boundary conditions
29 /**
30  Virtual base class through which a user specifies the initial and
31  boundary conditions for a hyperbolic system of PDEs.
32  */
33 class PhysIBC
34 {
35 public:
36  /// Constructor
37  /**
38  */
39  PhysIBC();
40 
41  /// Destructor
42  /**
43  */
44  virtual ~PhysIBC();
45 
46  /// Define the object
47  /**
48  */
49  virtual void define(/// problem domain index space
50  const ProblemDomain& a_domain,
51  /// grid spacing
52  const Real& a_dx);
53 
54  /// Factory method - this object is its own factory
55  /**
56  Return a pointer to a new PhysIBC object with m_isDefined = false (i.e.,
57  its define() must be called before it is used).
58  */
59  virtual PhysIBC* new_physIBC() = 0;
60 
61  /// Set up initial conditions
62  /**
63  */
64  virtual void initialize(/// conserved variables
65  LevelData<FArrayBox>& a_U) = 0;
66 
67  /// Set boundary primitive values
68  /**
69  */
70  virtual void primBC(/// primitive variables at face centers; this routine replaces values along boundary faces of domain
71  FArrayBox& a_WGdnv,
72  /// extrapolated primitive variables to a_side of cells in direction a_dir (cell-centered data)
73  const FArrayBox& a_Wextrap,
74  /// primitive variables at start of time step (cell-centered data)
75  const FArrayBox& a_W,
76  /// normal direction of the domain where boundary condition fluxes needed
77  const int& a_dir,
78  /// side of the domain where boundary condition fluxes needed
79  const Side::LoHiSide& a_side,
80  /// physical time of the problem, for time-varying boundary conditions
81  const Real& a_time) = 0;
82 
83  /// Set boundary slopes
84  /**
85  The boundary slopes in a_dW are already set to one-sided difference
86  approximations. If this function doesn't change them, they will be
87  used for the slopes at the boundaries.
88  */
89  virtual
90  void setBdrySlopes(/// face-centered differences of primitive variables
91  FArrayBox& a_dW,
92  /// primitive variables at start of time step (cell-centered data)
93  const FArrayBox& a_W,
94  /// normal direction of faces
95  const int& a_dir,
96  /// physical time of the problem, for time-varying boundary conditions
97  const Real& a_time) = 0;
98 
99  /// Adjust boundary fluxes to account for artificial viscosity
100  /**
101  */
102  virtual
103  void artViscBC(/// face-centered flux, to be adjusted on boundary
104  FArrayBox& a_F,
105  /// cell-centered conserved variables
106  const FArrayBox& a_U,
107  /// face-centered divergence of cell-centered velocity
108  const FArrayBox& a_divVel,
109  /// normal direction of faces
110  const int& a_dir,
111  /// physical time of the problem, for time-varying boundary conditions
112  const Real& a_time) = 0;
113 
114  /// This function is called by primBC() to get boundary faces of a Box.
115  virtual
116  void getBoundaryFaces(/// face-centered box of boundary faces to fill in; subbox of a_dataFaceBox
117  Box& a_boundaryBox,
118  /// entire face-centered box
119  const Box& a_dataFaceBox,
120  /// normal direction of faces
121  const int& a_dir,
122  /// side of the domain where boundary faces needed
123  const Side::LoHiSide& a_side);
124 
125 protected:
126 
127  // Has this object been defined
129 
130  // The current level's problem domain
132 
133  // The current level's grid spacing
135 
136 private:
137 
138  // Disallowed for all the usual reasons
139  void operator=(const PhysIBC&);
140  PhysIBC(const PhysIBC&);
141 };
142 
143 #include "NamespaceFooter.H"
144 #endif
Real m_dx
Definition: PhysIBC.H:134
bool m_isDefined
Definition: PhysIBC.H:128
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
virtual void setBdrySlopes(FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Real &a_time)=0
Set boundary slopes.
ProblemDomain m_domain
Definition: PhysIBC.H:131
virtual void artViscBC(FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const int &a_dir, const Real &a_time)=0
Adjust boundary fluxes to account for artificial viscosity.
double Real
Definition: REAL.H:33
virtual ~PhysIBC()
Destructor.
PhysIBC()
Constructor.
LoHiSide
Definition: LoHiSide.H:27
virtual void initialize(LevelData< FArrayBox > &a_U)=0
Set up initial conditions.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Definition: FArrayBox.H:45
Physical/domain initial and boundary conditions.
Definition: PhysIBC.H:33
void operator=(const PhysIBC &)
virtual void define(const ProblemDomain &a_domain, const Real &a_dx)
Define the object.
virtual void getBoundaryFaces(Box &a_boundaryBox, const Box &a_dataFaceBox, const int &a_dir, const Side::LoHiSide &a_side)
This function is called by primBC() to get boundary faces of a Box.
virtual PhysIBC * new_physIBC()=0
Factory method - this object is its own factory.
virtual void primBC(FArrayBox &a_WGdnv, const FArrayBox &a_Wextrap, const FArrayBox &a_W, const int &a_dir, const Side::LoHiSide &a_side, const Real &a_time)=0
Set boundary primitive values.