Chombo + EB  3.0
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 "EBPWLFillPatch.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  */
56  void define(const DisjointBoxLayout& a_thisDBL,
57  const DisjointBoxLayout& a_coarDBL,
58  const EBISLayout& a_thisEBISL,
59  const EBISLayout& a_coarEBISL,
60  const ProblemDomain& a_DProblem,
61  const int& a_nRefine,
62  const RealVect& a_dx,
63  const bool& a_useMassRedist,
64  const bool& a_doSmushing,
65  const bool& a_doRZCoords,
66  const bool& a_hasSourceTerm,
67  const EBPatchGodunovFactory* const a_patchGodunov,
68  const bool& a_hasCoarser,
69  const bool& a_hasFiner);
70 
71  ///
72  void floorConserved(LevelData<EBCellFAB>& a_consState,
73  Real a_time, Real a_dt);
74 
75  /// Take one timestep for this grid level.
76  /**
77  For the coarsest level, UcoarseOld and UCoarseNew are empty
78  LevelData<EBCellFAB> objects. Also, either UCoarseOld or
79  UCoarseNew might be empty to indicate that t(nf) = t(nc) the
80  one grid is at the current time and interpolation is not required
81  for boundary condition generation. U must be defined on the same
82  DisjointBoxLayouts as were used in define(...)
83  Coarse flux register is flux register with the coarse level.
84  Fine flux register is the flux register with the fine level.
85  To the finer level FR, this level is the coarse level.
86  To the coarser level FR, this level is the fine level.
87  */
88  Real step(LevelData<EBCellFAB>& a_consState,
89  LevelData<BaseIVFAB<Real> >& a_massDiff,
90  EBFluxRegister& a_fineFluxRegister,
91  EBFluxRegister& a_coarFluxRegister,
92  const LevelData<EBCellFAB>& a_consStateCoarseOld,
93  const LevelData<EBCellFAB>& a_consStateCoarseNew,
94  const Real& a_time,
95  const Real& a_TCold,
96  const Real& a_TCNew,
97  const Real& a_dt);
98 
99  void
101  const LevelData<EBCellFAB>& a_rhoNew,
102  const LevelData<EBCellFAB>& a_rhoOld,
103  const Real& a_dt);
104 
105  /// Get maximum wave speed
106  Real getMaxWaveSpeed(const LevelData<EBCellFAB>& a_state);
107 
108  bool isDefined() const;
109 
110 
111 protected:
112  void fillConsState(LevelData<EBCellFAB>& a_consState,
113  const LevelData<EBCellFAB>& a_consStateCoarseOld,
114  const LevelData<EBCellFAB>& a_consStateCoarseNew,
115  const Real& a_time,
116  const Real& a_coarTimeOld,
117  const Real& a_coarTimeNew);
118 
119  void computeFlattening(Real a_time, Real a_dt,
120  LevelData<EBCellFAB>& a_consState);
121 
122  void doRegularUpdate(EBFluxRegister& a_fineFluxRegister,
123  EBFluxRegister& a_coarFluxRegister,
124  Real a_time, Real a_dt,
125  LevelData<EBCellFAB>& a_consState);
126 
127  Real doIrregularUpdate(EBFluxRegister& a_fineFluxRegister,
128  EBFluxRegister& a_coarFluxRegister,
129  LevelData<BaseIVFAB<Real> >& a_massDiff,
130  Real a_time, Real a_dt,
131  LevelData<EBCellFAB>& a_consState);
132 
133 
134  //these are not grown by one.
136 
137  //these are grown by one in the directions != idir
139 
155  int m_nCons;
156  int m_nFlux;
157  int m_nGhost;
161  static int s_timestep;
166 private:
167  //disallowed for all the usual reasons
168  void operator=(const EBLevelGodunov& a_input)
169  {
170  MayDay::Error("invalid operator");
171  }
173  {
174  MayDay::Error("invalid operator");
175  }
176 };
177 
178 #include "NamespaceFooter.H"
179 #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:164
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:130
EBLevelGodunov()
Default constructor.
EBLevelRedist m_ebLevelRedist
Definition: EBLevelGodunov.H:160
static int s_timestep
Definition: EBLevelGodunov.H:161
LevelData< BaseIVFAB< Real > > m_nonConsDivergence
Definition: EBLevelGodunov.H:141
bool m_useMassRedist
Definition: EBLevelGodunov.H:159
bool m_isDefined
Definition: EBLevelGodunov.H:150
Definition: EBPWLFillPatch.H:35
EBLevelGodunov(const EBLevelGodunov &a_input)
Definition: EBLevelGodunov.H:172
int m_nFlux
Definition: EBLevelGodunov.H:156
bool m_doSmushing
Definition: EBLevelGodunov.H:162
DisjointBoxLayout m_coarGrids
Definition: EBLevelGodunov.H:147
void operator=(const EBLevelGodunov &a_input)
Definition: EBLevelGodunov.H:168
EBISLayout m_thisEBISL
Definition: EBLevelGodunov.H:148
~EBLevelGodunov()
Destructor.
const int SpaceDim
Definition: SPACE.H:39
Real getMaxWaveSpeed(const LevelData< EBCellFAB > &a_state)
Get maximum wave speed.
Definition: EBPatchGodunov.H:31
LayoutData< IntVectSet > m_irregSetsSmall
Definition: EBLevelGodunov.H:135
EBPatchGodunov * m_ebPatchGodunov
Definition: EBLevelGodunov.H:151
LayoutData< IntVectSet > m_irregSetsGrown[SpaceDim]
Definition: EBLevelGodunov.H:138
LayoutData< IntVectSet > m_cfIVS
Definition: EBLevelGodunov.H:143
int m_refRatCrse
Definition: EBLevelGodunov.H:154
LevelData< BaseIFFAB< Real > > m_fluxInterpolants[SpaceDim]
Definition: EBLevelGodunov.H:140
LevelData< BaseIVFAB< Real > > m_ebIrregFaceFlux
Definition: EBLevelGodunov.H:142
double Real
Definition: REAL.H:33
bool isDefined() const
bool m_hasFiner
Definition: EBLevelGodunov.H:145
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
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:146
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:165
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Level Godunov.
Definition: EBLevelGodunov.H:30
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)
Actual constructor.
EBPWLFillPatch m_patcher
Definition: EBLevelGodunov.H:158
void computeFlattening(Real a_time, Real a_dt, LevelData< EBCellFAB > &a_consState)
void doRegularUpdate(EBFluxRegister &a_fineFluxRegister, EBFluxRegister &a_coarFluxRegister, Real a_time, Real a_dt, LevelData< EBCellFAB > &a_consState)
bool m_hasCoarser
Definition: EBLevelGodunov.H:144
EBISLayout m_coarEBISL
Definition: EBLevelGodunov.H:149
Definition: EBISLayout.H:39
ProblemDomain m_domain
Definition: EBLevelGodunov.H:153
int m_nCons
Definition: EBLevelGodunov.H:155
int m_nGhost
Definition: EBLevelGodunov.H:157
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:31
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:152
bool m_doRZCoords
Definition: EBLevelGodunov.H:163