Chombo + EB + MF  3.2
PhysMappedIBC.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 // PhysMappedIBC.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 _PHYSMAPPEDIBC_H_
20 #define _PHYSMAPPEDIBC_H_
21 
22 #include "PhysIBC.H"
23 #include "MultiBlockCoordSys.H"
24 #include "CHArray_fwd.H"
25 
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 PhysMappedIBC : public PhysIBC
34 {
35 public:
36  /// Constructor
37  /**
38  */
39  PhysMappedIBC();
40 
41  /// Destructor
42  /**
43  */
44  virtual ~PhysMappedIBC();
45 
46  /// Define the object
47  /**
48  Set the problem domain index space and the grid spacing for this
49  initial and boundary condition object.
50  */
51  virtual void define(const ProblemDomain& a_domain,
52  const Real& a_dx);
53 
54  /// Factory method - this object is its own factory
55  /**
56  Return a point to a new PhysMappedIBC object with m_isDefined = false
57  (i.e., its define() must be called before it is used).
58  */
59  virtual PhysMappedIBC* new_physIBC() = 0;
60 
61  virtual void setTime(Real a_time);
62 
63  //! Set the coordinate system for this IBC. This object does not assume
64  //! of the coordinate system.
65  virtual void setCoordSys(MultiBlockCoordSys* a_coordSysPtr);
66 
67  //! Set the coordinate system for this IBC. This object does not assume
68  //! of the coordinate system. This method is the single-block version
69  //! of setCoordSys.
70  void setCoordSys(NewCoordSys* a_coordSysPtr);
71 
72  virtual void print() {}
73 
74  /// Set up initial conditions
75  /**
76  */
77  virtual void initialize(LevelData<FArrayBox>& a_U) = 0;
78 
80  {
81  MayDay::Error("Initialize with J not defined for this derivation from "
82  "PhysMappedIBC");
83  }
84 
85  /// Old set boundary fluxes for Cartesian methods -- will cause an error
86  /**
87  */
88  virtual void primBC(FArrayBox& a_WGdnv,
89  const FArrayBox& a_Wextrap,
90  const FArrayBox& a_W,
91  const int& a_dir,
92  const Side::LoHiSide& a_side,
93  const Real& a_time)
94  {
95  MayDay::Error("Cartesian interface to primBC not valid for mapped grids");
96  }
97 
98  /// Set boundary fluxes
99  /**
100  */
101  virtual void primBC(FArrayBox& a_WGdnv,
102  const FArrayBox& a_Wextrap,
103  const FArrayBox& a_W,
104  const FArrayBox *const a_unitNormalBasisPtr,
105  const Interval& a_velIntv,
106  const int& a_dir,
107  const Side::LoHiSide& a_side,
108  const Real& a_time) = 0;
109 
110  /// Set boundary slopes
111  /**
112  The boundary slopes in a_dW are already set to one sided difference
113  approximations. If this function doesn't change them they will be
114  used for the slopes at the boundaries.
115  */
116  virtual
117  void setBdrySlopes(FArrayBox& a_dW,
118  const FArrayBox& a_W,
119  const int& a_dir,
120  const Real& a_time) = 0;
121 
122  /// Old artificial viscosity for Cartesian methods -- will cause an error
123  /**
124  */
125  virtual
126  void artViscBC(FArrayBox& a_F,
127  const FArrayBox& a_U,
128  const FArrayBox& a_divVel,
129  const int& a_dir,
130  const Real& a_time)
131  {
132  MayDay::Error("Cartesian interface to artViscBC not valid for mapped "
133  "grids");
134  }
135 
136  /// Adjust boundary fluxes to account for artificial viscosity
137  /**
138  */
139  virtual
140  void artViscBC(FArrayBox& a_NtFdir,
142  const FArrayBox& a_U,
143  const FArrayBox& a_unitNormalBasis,
144  const FArrayBox& a_divVel,
145  const FArrayBox& a_csq,
146  const FArrayBox& a_dxFace,
147  const Interval& a_momIntv,
148  const Real a_alpha,
149  const Real a_beta,
150  const Box& a_loFaceBox,
151  const int a_hasLo,
152  const Box& a_hiFaceBox,
153  const int a_hasHi,
154  const int a_dir) = 0;
155 
156  /// Do we have the exact solution
157  bool haveExactSoln() const;
158 
159 protected:
160 
162 
164 
166 
168 
170 };
171 
172 #include "NamespaceFooter.H"
173 #endif
virtual void print()
Definition: PhysMappedIBC.H:72
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
virtual void setTime(Real a_time)
virtual void initializeWithJ(LevelData< FArrayBox > &a_U)
Definition: PhysMappedIBC.H:79
virtual void artViscBC(FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const int &a_dir, const Real &a_time)
Old artificial viscosity for Cartesian methods – will cause an error.
Definition: PhysMappedIBC.H:126
virtual PhysMappedIBC * new_physIBC()=0
Factory method - this object is its own factory.
Structure for passing component ranges in code.
Definition: Interval.H:23
Forward declarations for class CHArray.
double Real
Definition: REAL.H:33
Physical/domain initial and boundary conditions.
Definition: PhysMappedIBC.H:33
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)
Old set boundary fluxes for Cartesian methods – will cause an error.
Definition: PhysMappedIBC.H:88
MultiBlockCoordSys * m_coordSysPtr
Definition: PhysMappedIBC.H:161
LoHiSide
Definition: LoHiSide.H:27
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
virtual void setBdrySlopes(FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Real &a_time)=0
Set boundary slopes.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
bool haveExactSoln() const
Do we have the exact solution.
virtual void initialize(LevelData< FArrayBox > &a_U)=0
Set up initial conditions.
bool m_haveExactSoln
Definition: PhysMappedIBC.H:169
Definition: FArrayBox.H:45
PhysMappedIBC()
Constructor.
Physical/domain initial and boundary conditions.
Definition: PhysIBC.H:33
bool m_haveCoordSys
Definition: PhysMappedIBC.H:165
virtual void setCoordSys(MultiBlockCoordSys *a_coordSysPtr)
virtual ~PhysMappedIBC()
Destructor.
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewCoordSys.H:30
bool m_haveTime
Definition: PhysMappedIBC.H:167
virtual void define(const ProblemDomain &a_domain, const Real &a_dx)
Define the object.
Real m_time
Definition: PhysMappedIBC.H:163