Chombo + EB  3.2
EBAdvectLevelIntegrator.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 12-03-2015
12 
13 #ifndef _EBADVECTLEVELINTEGRATOR_H_
14 #define _EBADVECTLEVELINTEGRATOR_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 "EBLevelGrid.H"
25 #include "NamespaceHeader.H"
26 
27 ///
28 /**
29  Advection and diffusion on a level using
30 */
32 {
33 public:
34  /// Destructor
35  /**
36  destroys all objects created by define(..). Passed in
37  data references of define(..) are left alone.
38  */
40  {;}
41 
42  ///
43  /**
44  forceNoEBCF = true promises that the embedded boundary
45  will not cross the coarse-fine interface. This will save you
46  a lot of compute time if you are certain you are tagging all irregulkar cells.
47  */
48  EBAdvectLevelIntegrator(const EBLevelGrid & a_thisEBLG,
49  const EBLevelGrid & a_coarEBLG,
50  const int& a_nRefine,
51  const RealVect& a_dx,
52  const bool& a_hasCoarser,
53  const bool& a_hasFiner,
54  const bool& a_useSlopeLimiting,
55  const bool& a_forceNoEBCF = false,
56  const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
57 
58 
59  ///
60  /**
61  1. Average advection velocity to cell centers to get unorm.
62  2. Do linear C/F interpolation on a_cellState and compute
63  the diffusion source term if necessary. Quadratic is unnecessary
64  because the laplacian does its own CF interpolation in the
65  viscous case.
66  3. Do linear C/F interpolation in space and time
67  4. Extrapolate cellState to to faces using patchgodunov->extrapolatePrim
68 
69  Notes: The advection velocity that is sent in is not used. It will be
70  taken out in later designs
71  */
72  void
74  LayoutData< Vector< BaseIVFAB<Real>* > >& a_coveredPrimLo,
75  LayoutData< Vector< BaseIVFAB<Real>* > >& a_coveredPrimHi,
76  const LayoutData< Vector< Vector<VolIndex> > >& a_coveredFaceLo,
77  const LayoutData< Vector< Vector<VolIndex> > >& a_coveredFaceHi,
78  const LayoutData< Vector< IntVectSet> >& a_coveredSetsLo,
79  const LayoutData< Vector< IntVectSet> >& a_coveredSetsHi,
80  const LevelData< EBCellFAB >& a_consState,
81  const LevelData< EBCellFAB >& a_normalVel,
82  const LevelData< EBFluxFAB >& a_advectionVel,
83  const LevelData< EBCellFAB >* a_consStateCoarseOld,
84  const LevelData< EBCellFAB >* a_consStateCoarseNew,
85  const LevelData< EBCellFAB >* a_normalVelCoarseOld,
86  const LevelData< EBCellFAB >* a_normalVelCoarseNew,
87  const Real& a_timeCoarseOld,
88  const Real& a_timeCoarseNew,
89  const Real& a_timeFine,
90  const Real& a_dt,
91  const LevelData<EBCellFAB>* const a_source = NULL,
92  const LevelData<EBCellFAB>* const a_sourceCoarOld = NULL,
93  const LevelData<EBCellFAB>* const a_sourceCoarNew = NULL);
94 
95 
96 
97  void
98  advectToFaces(EBFluxFAB& a_extrapState,
99  Vector< BaseIVFAB<Real>* >& a_coveredPrimLo,
100  Vector< BaseIVFAB<Real>* >& a_coveredPrimHi,
101  const Vector< Vector<VolIndex> >& a_coveredFaceLo,
102  const Vector< Vector<VolIndex> >& a_coveredFaceHi,
103  const Vector< IntVectSet >& a_coveredSetsLo,
104  const Vector< IntVectSet >& a_coveredSetsHi,
105  const EBCellFAB & a_consState,
106  const EBCellFAB & a_normalVel,
107  const EBFluxFAB & a_advectionVel,
108  const Box& a_cellBox,
109  const EBISBox& a_ebisBox,
110  const Real& a_dt,
111  const Real& a_time,
112  const EBCellFAB & a_source,
113  const DataIndex& a_dit);
114 
115 
116 
117  void
119  const LevelData< EBCellFAB >& a_consState,
120  const LevelData< EBCellFAB >& a_normalVel,
121  const LevelData< EBFluxFAB >& a_advectionVel,
122  const LevelData< EBCellFAB >* a_consStateCoarseOld,
123  const LevelData< EBCellFAB >* a_consStateCoarseNew,
124  const LevelData< EBCellFAB >* a_normalVelCoarseOld,
125  const LevelData< EBCellFAB >* a_normalVelCoarseNew,
126  const Real& a_timeCoarseOld,
127  const Real& a_timeCoarseNew,
128  const Real& a_timeFine,
129  const Real& a_dt,
130  const LevelData<EBCellFAB>* const a_source = NULL,
131  const LevelData<EBCellFAB>* const a_sourceCoarOld = NULL,
132  const LevelData<EBCellFAB>* const a_sourceCoarNew = NULL);
133 
134 
135 
136  void
137  advectToFacesBCG(EBFluxFAB& a_extrapState,
138  const EBCellFAB & a_consState,
139  const EBCellFAB & a_normalVel,
140  const EBFluxFAB & a_advectionVel,
141  const Box& a_cellBox,
142  const EBISBox& a_ebisBox,
143  const Real& a_dt,
144  const Real& a_time,
145  const EBCellFAB & a_source,
146  const DataIndex& a_dit);
147 
148 
149 
150  void
152  const LevelData<EBFluxFAB>& a_advectionVel,
153  const LayoutData<Vector<BaseIVFAB<Real> * > >& a_coveredVeloLo,
154  const LayoutData<Vector<BaseIVFAB<Real> * > >& a_coveredVeloHi,
155  const LayoutData<Vector<Vector<VolIndex> > >& a_coveredFaceLo,
156  const LayoutData<Vector<Vector<VolIndex> > >& a_coveredFaceHi) const;
157 
158 
159  void resetBCs(const RefCountedPtr<EBPhysIBCFactory>& a_advectBC);
160 
162  {
163  return *(m_ebPatchAdvect[a_dit]);
164  }
165 
166 protected:
167 
174  int m_nVar;
175  int m_nGhost;
176 
183 
184 private:
185 
186  //disallowed for all the usual reasons
187  void operator=(const EBAdvectLevelIntegrator& a_input)
188  {
189  MayDay::Error("invalid operator");
190  }
192  {
193  MayDay::Error("invalid operator");
194  }
195  /// weak construction is bad
197  {
198  }
199 
200 };
201 
202 #include "NamespaceFooter.H"
203 #endif
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Definition: EBIndexSpace.H:50
ProblemDomain m_domain
Definition: EBAdvectLevelIntegrator.H:181
void advectToFacesBCG(LevelData< EBFluxFAB > &a_extrapState, const LevelData< EBCellFAB > &a_consState, const LevelData< EBCellFAB > &a_normalVel, const LevelData< EBFluxFAB > &a_advectionVel, const LevelData< EBCellFAB > *a_consStateCoarseOld, const LevelData< EBCellFAB > *a_consStateCoarseNew, const LevelData< EBCellFAB > *a_normalVelCoarseOld, const LevelData< EBCellFAB > *a_normalVelCoarseNew, const Real &a_timeCoarseOld, const Real &a_timeCoarseNew, const Real &a_timeFine, const Real &a_dt, const LevelData< EBCellFAB > *const a_source=NULL, const LevelData< EBCellFAB > *const a_sourceCoarOld=NULL, const LevelData< EBCellFAB > *const a_sourceCoarNew=NULL)
one dimensional dynamic array
Definition: Vector.H:53
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
bool m_hasFiner
Definition: EBAdvectLevelIntegrator.H:169
bool m_forceNoEBCF
Definition: EBAdvectLevelIntegrator.H:171
void resetBCs(const RefCountedPtr< EBPhysIBCFactory > &a_advectBC)
Definition: EBISBox.H:46
RealVect m_dx
Definition: EBAdvectLevelIntegrator.H:172
Definition: EBLevelGrid.H:30
LayoutData< RefCountedPtr< EBAdvectPatchIntegrator > > m_ebPatchAdvect
Definition: EBAdvectLevelIntegrator.H:182
RefCountedPtr< AggEBPWLFillPatch > m_fillPatch
Definition: EBAdvectLevelIntegrator.H:179
RefCountedPtr< AggEBPWLFillPatch > m_fillPatchVel
Definition: EBAdvectLevelIntegrator.H:180
~EBAdvectLevelIntegrator()
Destructor.
Definition: EBAdvectLevelIntegrator.H:39
Definition: EBAdvectPatchIntegrator.H:38
void operator=(const EBAdvectLevelIntegrator &a_input)
Definition: EBAdvectLevelIntegrator.H:187
void computeNormalVel(LevelData< EBCellFAB > &a_normalVel, const LevelData< EBFluxFAB > &a_advectionVel, const LayoutData< Vector< BaseIVFAB< Real > * > > &a_coveredVeloLo, const LayoutData< Vector< BaseIVFAB< Real > * > > &a_coveredVeloHi, const LayoutData< Vector< Vector< VolIndex > > > &a_coveredFaceLo, const LayoutData< Vector< Vector< VolIndex > > > &a_coveredFaceHi) const
EBAdvectPatchIntegrator & getPatchAdvect(const DataIndex &a_dit)
Definition: EBAdvectLevelIntegrator.H:161
void advectToFacesCol(LevelData< EBFluxFAB > &a_extrapState, LayoutData< Vector< BaseIVFAB< Real > * > > &a_coveredPrimLo, LayoutData< Vector< BaseIVFAB< Real > * > > &a_coveredPrimHi, const LayoutData< Vector< Vector< VolIndex > > > &a_coveredFaceLo, const LayoutData< Vector< Vector< VolIndex > > > &a_coveredFaceHi, const LayoutData< Vector< IntVectSet > > &a_coveredSetsLo, const LayoutData< Vector< IntVectSet > > &a_coveredSetsHi, const LevelData< EBCellFAB > &a_consState, const LevelData< EBCellFAB > &a_normalVel, const LevelData< EBFluxFAB > &a_advectionVel, const LevelData< EBCellFAB > *a_consStateCoarseOld, const LevelData< EBCellFAB > *a_consStateCoarseNew, const LevelData< EBCellFAB > *a_normalVelCoarseOld, const LevelData< EBCellFAB > *a_normalVelCoarseNew, const Real &a_timeCoarseOld, const Real &a_timeCoarseNew, const Real &a_timeFine, const Real &a_dt, const LevelData< EBCellFAB > *const a_source=NULL, const LevelData< EBCellFAB > *const a_sourceCoarOld=NULL, const LevelData< EBCellFAB > *const a_sourceCoarNew=NULL)
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
static EBIndexSpace * instance()
int m_nVar
Definition: EBAdvectLevelIntegrator.H:174
Definition: EBCellFAB.H:29
int m_refRatCrse
Definition: EBAdvectLevelIntegrator.H:173
EBAdvectLevelIntegrator()
weak construction is bad
Definition: EBAdvectLevelIntegrator.H:196
double Real
Definition: REAL.H:33
bool m_useSlopeLimiting
Definition: EBAdvectLevelIntegrator.H:170
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.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Definition: DataIndex.H:112
bool m_hasCoarser
Definition: EBAdvectLevelIntegrator.H:168
EBAdvectLevelIntegrator(const EBAdvectLevelIntegrator &a_input)
Definition: EBAdvectLevelIntegrator.H:191
int m_nGhost
Definition: EBAdvectLevelIntegrator.H:175
void advectToFaces(EBFluxFAB &a_extrapState, Vector< BaseIVFAB< Real > * > &a_coveredPrimLo, Vector< BaseIVFAB< Real > * > &a_coveredPrimHi, const Vector< Vector< VolIndex > > &a_coveredFaceLo, const Vector< Vector< VolIndex > > &a_coveredFaceHi, const Vector< IntVectSet > &a_coveredSetsLo, const Vector< IntVectSet > &a_coveredSetsHi, const EBCellFAB &a_consState, const EBCellFAB &a_normalVel, const EBFluxFAB &a_advectionVel, const Box &a_cellBox, const EBISBox &a_ebisBox, const Real &a_dt, const Real &a_time, const EBCellFAB &a_source, const DataIndex &a_dit)
Definition: EBAdvectLevelIntegrator.H:31
EBLevelGrid m_thisEBLG
Definition: EBAdvectLevelIntegrator.H:177
EBLevelGrid m_coarEBLG
Definition: EBAdvectLevelIntegrator.H:178