Chombo + EB + MF  3.2
EBLevelGodunov.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 // dtg 1-23-2002
12 
13 #ifndef _EBLEVELGODUNOV_H_
14 #define _EBLEVELGODUNOV_H_
15 
16 #include "EBCellFAB.H"
17 #include "DisjointBoxLayout.H"
18 #include "LevelData.H"
20 #include "AggEBPWLFillPatch.H"
21 #include "EBFluxRegister.H"
22 #include "ProblemDomain.H"
23 #include "EBPatchGodunovFactory.H"
24 #include "EBLevelRedist.H"
25 #include "NamespaceHeader.H"
26 
27 /// Level Godunov
28 /**
29  */
31 {
32 public:
33  /// Default constructor
34  /**
35  Object requires define(..) to be called before all other functions.
36  */
38 
39  /// Destructor
40  /**
41  destroys all objects created by define(..). Passed in
42  data references of define(..) are left alone.
43  */
45 
46  /// Actual constructor.
47  /**
48  For the coarsest level, an empty DisjointBoxLayout
49  is passed in for coaserDisjointBoxLayout.
50  Inside the routine, we cast away const-ness on the data members
51  for the assignment. The arguments passed in are maintained const.
52  (coding standards). a_nRefine is the refinement ratio between
53  this level and the next coarser level. a_numGhosts is the number
54  of ghost cells in each direction.
55  forceNoEBCF = true promises that the embedded boundary
56  will not cross the coarse-fine interface. This will save you
57  a lot of compute time if you are certain you are tagging all irregulkar cells.
58  ivghost is the number of ghost cells being sent in on the data
59  */
60  void define(const DisjointBoxLayout& a_thisDBL,
61  const DisjointBoxLayout& a_coarDBL,
62  const EBISLayout& a_thisEBISL,
63  const EBISLayout& a_coarEBISL,
64  const ProblemDomain& a_DProblem,
65  const int& a_nRefine,
66  const RealVect& a_dx,
67  const bool& a_useMassRedist,
68  const bool& a_doSmushing,
69  const bool& a_doRZCoords,
70  const bool& a_hasSourceTerm,
71  const EBPatchGodunovFactory* const a_patchGodunov,
72  const bool& a_hasCoarser,
73  const bool& a_hasFiner,
74  const IntVect & a_ivGhost,
75  const bool& a_forceNoEBCF = false
76  );
77 
78  ///
79  void floorConserved(LevelData<EBCellFAB>& a_consState,
80  Real a_time, Real a_dt);
81 
82  /// Take one timestep for this grid level.
83  /**
84  For the coarsest level, UcoarseOld and UCoarseNew are empty
85  LevelData<EBCellFAB> objects. Also, either UCoarseOld or
86  UCoarseNew might be empty to indicate that t(nf) = t(nc) the
87  one grid is at the current time and interpolation is not required
88  for boundary condition generation. U must be defined on the same
89  DisjointBoxLayouts as were used in define(...)
90  Coarse flux register is flux register with the coarse level.
91  Fine flux register is the flux register with the fine level.
92  To the finer level FR, this level is the coarse level.
93  To the coarser level FR, this level is the fine level.
94  */
95  Real step(LevelData<EBCellFAB>& a_consState,
96  LevelData<BaseIVFAB<Real> >& a_massDiff,
97  EBFluxRegister& a_fineFluxRegister,
98  EBFluxRegister& a_coarFluxRegister,
99  const LevelData<EBCellFAB>& a_consStateCoarseOld,
100  const LevelData<EBCellFAB>& a_consStateCoarseNew,
101  const Real& a_time,
102  const Real& a_TCold,
103  const Real& a_TCNew,
104  const Real& a_dt);
105 
106  void
108  const LevelData<EBCellFAB>& a_rhoNew,
109  const LevelData<EBCellFAB>& a_rhoOld,
110  const Real& a_dt);
111 
112  /// Get maximum wave speed
113  Real getMaxWaveSpeed(const LevelData<EBCellFAB>& a_state);
114 
115  bool isDefined() const;
116 
117 
118 protected:
119  void fillConsState(LevelData<EBCellFAB>& a_consState,
120  const LevelData<EBCellFAB>& a_consStateCoarseOld,
121  const LevelData<EBCellFAB>& a_consStateCoarseNew,
122  const Real& a_time,
123  const Real& a_coarTimeOld,
124  const Real& a_coarTimeNew);
125 
126  void computeFlattening(Real a_time, Real a_dt,
127  LevelData<EBCellFAB>& a_consState);
128 
129  void doRegularUpdate(EBFluxRegister& a_fineFluxRegister,
130  EBFluxRegister& a_coarFluxRegister,
131  Real a_time, Real a_dt,
132  LevelData<EBCellFAB>& a_consState);
133 
134  Real doIrregularUpdate(EBFluxRegister& a_fineFluxRegister,
135  EBFluxRegister& a_coarFluxRegister,
136  LevelData<BaseIVFAB<Real> >& a_massDiff,
137  Real a_time, Real a_dt,
138  LevelData<EBCellFAB>& a_consState);
139 
140 
141  //these are not grown by one.
143 
144  //these are grown by one in the directions != idir
146 
159  //just for num fluxes and such
164  int m_nCons;
165  int m_nFlux;
166  int m_nGhost;
170  static int s_timestep;
177 private:
178  //disallowed for all the usual reasons
179  void operator=(const EBLevelGodunov& a_input)
180  {
181  MayDay::Error("invalid operator");
182  }
184  {
185  MayDay::Error("invalid operator");
186  }
187 };
188 
189 #include "NamespaceFooter.H"
190 #endif
Real doIrregularUpdate(EBFluxRegister &a_fineFluxRegister, EBFluxRegister &a_coarFluxRegister, LevelData< BaseIVFAB< Real > > &a_massDiff, Real a_time, Real a_dt, LevelData< EBCellFAB > &a_consState)
bool m_hasSourceTerm
Definition: EBLevelGodunov.H:173
Definition: EBPatchGodunovFactory.H:20
Real step(LevelData< EBCellFAB > &a_consState, LevelData< BaseIVFAB< Real > > &a_massDiff, EBFluxRegister &a_fineFluxRegister, EBFluxRegister &a_coarFluxRegister, const LevelData< EBCellFAB > &a_consStateCoarseOld, const LevelData< EBCellFAB > &a_consStateCoarseNew, const Real &a_time, const Real &a_TCold, const Real &a_TCNew, const Real &a_dt)
Take one timestep for this grid level.
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
EBLevelGodunov()
Default constructor.
EBLevelRedist m_ebLevelRedist
Definition: EBLevelGodunov.H:169
static int s_timestep
Definition: EBLevelGodunov.H:170
LevelData< BaseIVFAB< Real > > m_nonConsDivergence
Definition: EBLevelGodunov.H:148
bool m_useMassRedist
Definition: EBLevelGodunov.H:168
bool m_isDefined
Definition: EBLevelGodunov.H:157
Definition: AggEBPWLFillPatch.H:36
LayoutData< EBPatchGodunov * > m_ebPatchGodunov
Definition: EBLevelGodunov.H:158
EBLevelGodunov(const EBLevelGodunov &a_input)
Definition: EBLevelGodunov.H:183
int m_nFlux
Definition: EBLevelGodunov.H:165
void define(const DisjointBoxLayout &a_thisDBL, const DisjointBoxLayout &a_coarDBL, const EBISLayout &a_thisEBISL, const EBISLayout &a_coarEBISL, const ProblemDomain &a_DProblem, const int &a_nRefine, const RealVect &a_dx, const bool &a_useMassRedist, const bool &a_doSmushing, const bool &a_doRZCoords, const bool &a_hasSourceTerm, const EBPatchGodunovFactory *const a_patchGodunov, const bool &a_hasCoarser, const bool &a_hasFiner, const IntVect &a_ivGhost, const bool &a_forceNoEBCF=false)
Actual constructor.
bool m_doSmushing
Definition: EBLevelGodunov.H:171
DisjointBoxLayout m_coarGrids
Definition: EBLevelGodunov.H:154
EBPatchGodunov * m_ebPatchGodunovSP
Definition: EBLevelGodunov.H:160
void operator=(const EBLevelGodunov &a_input)
Definition: EBLevelGodunov.H:179
EBISLayout m_thisEBISL
Definition: EBLevelGodunov.H:155
~EBLevelGodunov()
Destructor.
const int SpaceDim
Definition: SPACE.H:38
Real getMaxWaveSpeed(const LevelData< EBCellFAB > &a_state)
Get maximum wave speed.
Definition: EBPatchGodunov.H:31
LayoutData< IntVectSet > m_irregSetsSmall
Definition: EBLevelGodunov.H:142
LayoutData< IntVectSet > m_irregSetsGrown[SpaceDim]
Definition: EBLevelGodunov.H:145
IntVect m_ivGhost
Definition: EBLevelGodunov.H:176
LayoutData< IntVectSet > m_cfIVS
Definition: EBLevelGodunov.H:150
int m_refRatCrse
Definition: EBLevelGodunov.H:163
LevelData< BaseIFFAB< Real > > m_fluxInterpolants[SpaceDim]
Definition: EBLevelGodunov.H:147
LevelData< BaseIVFAB< Real > > m_ebIrregFaceFlux
Definition: EBLevelGodunov.H:149
double Real
Definition: REAL.H:33
bool m_forceNoEBCF
Definition: EBLevelGodunov.H:175
bool isDefined() const
bool m_hasFiner
Definition: EBLevelGodunov.H:152
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void getDrhoDtOverRho(LevelData< EBCellFAB > &a_drhoDt, const LevelData< EBCellFAB > &a_rhoNew, const LevelData< EBCellFAB > &a_rhoOld, const Real &a_dt)
DisjointBoxLayout m_thisGrids
Definition: EBLevelGodunov.H:153
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.
LevelData< EBCellFAB > m_flattening
Definition: EBLevelGodunov.H:174
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Level Godunov.
Definition: EBLevelGodunov.H:30
void computeFlattening(Real a_time, Real a_dt, LevelData< EBCellFAB > &a_consState)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void doRegularUpdate(EBFluxRegister &a_fineFluxRegister, EBFluxRegister &a_coarFluxRegister, Real a_time, Real a_dt, LevelData< EBCellFAB > &a_consState)
bool m_hasCoarser
Definition: EBLevelGodunov.H:151
AggEBPWLFillPatch m_patcher
Definition: EBLevelGodunov.H:167
EBISLayout m_coarEBISL
Definition: EBLevelGodunov.H:156
Definition: EBISLayout.H:39
ProblemDomain m_domain
Definition: EBLevelGodunov.H:162
int m_nCons
Definition: EBLevelGodunov.H:164
int m_nGhost
Definition: EBLevelGodunov.H:166
void fillConsState(LevelData< EBCellFAB > &a_consState, const LevelData< EBCellFAB > &a_consStateCoarseOld, const LevelData< EBCellFAB > &a_consStateCoarseNew, const Real &a_time, const Real &a_coarTimeOld, const Real &a_coarTimeNew)
Definition: EBLevelRedist.H:33
EBFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: EBFluxRegister.H:37
void floorConserved(LevelData< EBCellFAB > &a_consState, Real a_time, Real a_dt)
RealVect m_dx
Definition: EBLevelGodunov.H:161
bool m_doRZCoords
Definition: EBLevelGodunov.H:172