00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _EBLEVELADVECT_H_
00014 #define _EBLEVELADVECT_H_
00015
00016 #include "EBCellFAB.H"
00017 #include "DisjointBoxLayout.H"
00018 #include "LevelData.H"
00019 #include "PiecewiseLinearFillPatch.H"
00020 #include "AggEBPWLFillPatch.H"
00021 #include "EBFluxRegister.H"
00022 #include "ProblemDomain.H"
00023 #include "EBPatchGodunovFactory.H"
00024 #include "EBPatchAdvect.H"
00025 #include "NamespaceHeader.H"
00026
00027
00028
00029
00030
00031 class EBLevelAdvect
00032 {
00033 public:
00034
00035
00036
00037
00038 EBLevelAdvect();
00039
00040
00041
00042
00043
00044
00045 ~EBLevelAdvect();
00046
00047
00048
00049
00050
00051
00052
00053 EBLevelAdvect(const DisjointBoxLayout& a_thisDBL,
00054 const DisjointBoxLayout& a_coarDBL,
00055 const EBISLayout& a_thisEBISL,
00056 const EBISLayout& a_coarEBISL,
00057 const ProblemDomain& a_DProblem,
00058 const int& a_nRefine,
00059 const RealVect& a_dx,
00060 const bool& a_hasCoarser,
00061 const bool& a_hasFiner,
00062 const EBPatchGodunovFactory* const a_patchGodunov,
00063 const bool& a_forceNoEBCF = false,
00064 const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 void define(const DisjointBoxLayout& a_thisDBL,
00080 const DisjointBoxLayout& a_coarDBL,
00081 const EBISLayout& a_thisEBISL,
00082 const EBISLayout& a_coarEBISL,
00083 const ProblemDomain& a_DProblem,
00084 const int& a_nRefine,
00085 const RealVect& a_dx,
00086 const bool& a_hasCoarser,
00087 const bool& a_hasFiner,
00088 const EBPatchGodunovFactory* const a_patchGodunov,
00089 const bool& a_forceNoEBCF = false,
00090 const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 void
00106 advectToFacesCol(LevelData< EBFluxFAB >& a_extrapState,
00107 LayoutData< Vector< BaseIVFAB<Real>* > >& a_coveredPrimLo,
00108 LayoutData< Vector< BaseIVFAB<Real>* > >& a_coveredPrimHi,
00109 const LayoutData< Vector< Vector<VolIndex> > >& a_coveredFaceLo,
00110 const LayoutData< Vector< Vector<VolIndex> > >& a_coveredFaceHi,
00111 const LayoutData< Vector< IntVectSet> >& a_coveredSetsLo,
00112 const LayoutData< Vector< IntVectSet> >& a_coveredSetsHi,
00113 const LevelData< EBCellFAB >& a_consState,
00114 const LevelData< EBCellFAB >& a_normalVel,
00115 const LevelData< EBFluxFAB >& a_advectionVel,
00116 const LevelData< EBCellFAB >* a_consStateCoarseOld,
00117 const LevelData< EBCellFAB >* a_consStateCoarseNew,
00118 const LevelData< EBCellFAB >* a_normalVelCoarseOld,
00119 const LevelData< EBCellFAB >* a_normalVelCoarseNew,
00120 const Real& a_timeCoarseOld,
00121 const Real& a_timeCoarseNew,
00122 const Real& a_timeFine,
00123 const Real& a_dt,
00124 const LevelData<EBCellFAB>* const a_source = NULL,
00125 const LevelData<EBCellFAB>* const a_sourceCoarOld = NULL,
00126 const LevelData<EBCellFAB>* const a_sourceCoarNew = NULL);
00127
00128
00129
00130 void
00131 advectToFaces(EBFluxFAB& a_extrapState,
00132 BaseIVFAB<Real>& a_boundaryPrim,
00133 Vector< BaseIVFAB<Real>* >& a_coveredPrimLo,
00134 Vector< BaseIVFAB<Real>* >& a_coveredPrimHi,
00135 const Vector< Vector<VolIndex> >& a_coveredFaceLo,
00136 const Vector< Vector<VolIndex> >& a_coveredFaceHi,
00137 const Vector< IntVectSet >& a_coveredSetsLo,
00138 const Vector< IntVectSet >& a_coveredSetsHi,
00139 const EBCellFAB & a_consState,
00140 const EBCellFAB & a_normalVel,
00141 const EBFluxFAB & a_advectionVel,
00142 const Box& a_cellBox,
00143 const EBISBox& a_ebisBox,
00144 const Real& a_dt,
00145 const Real& a_time,
00146 const EBCellFAB & a_source,
00147 const DataIndex& a_dit,
00148 bool a_doBoundaryPrim);
00149
00150
00151
00152 void
00153 advectToFacesBCG(LevelData< EBFluxFAB >& a_extrapState,
00154 const LevelData< EBCellFAB >& a_consState,
00155 const LevelData< EBCellFAB >& a_normalVel,
00156 const LevelData< EBFluxFAB >& a_advectionVel,
00157 const LevelData< EBCellFAB >* a_consStateCoarseOld,
00158 const LevelData< EBCellFAB >* a_consStateCoarseNew,
00159 const LevelData< EBCellFAB >* a_normalVelCoarseOld,
00160 const LevelData< EBCellFAB >* a_normalVelCoarseNew,
00161 const Real& a_timeCoarseOld,
00162 const Real& a_timeCoarseNew,
00163 const Real& a_timeFine,
00164 const Real& a_dt,
00165 const LevelData<EBCellFAB>* const a_source = NULL,
00166 const LevelData<EBCellFAB>* const a_sourceCoarOld = NULL,
00167 const LevelData<EBCellFAB>* const a_sourceCoarNew = NULL);
00168
00169
00170
00171 void
00172 advectToFacesBCG(EBFluxFAB& a_extrapState,
00173 BaseIVFAB<Real>& a_boundaryPrim,
00174 const EBCellFAB & a_consState,
00175 const EBCellFAB & a_normalVel,
00176 const EBFluxFAB & a_advectionVel,
00177 const Box& a_cellBox,
00178 const EBISBox& a_ebisBox,
00179 const Real& a_dt,
00180 const Real& a_time,
00181 const EBCellFAB & a_source,
00182 const DataIndex& a_dit,
00183 bool a_doBoundaryPrim);
00184
00185
00186
00187 void
00188 computeNormalVel(LevelData<EBCellFAB>& a_normalVel,
00189 const LevelData<EBFluxFAB>& a_advectionVel,
00190 const LayoutData<Vector<BaseIVFAB<Real> * > >& a_coveredVeloLo,
00191 const LayoutData<Vector<BaseIVFAB<Real> * > >& a_coveredVeloHi,
00192 const LayoutData<Vector<Vector<VolIndex> > >& a_coveredFaceLo,
00193 const LayoutData<Vector<Vector<VolIndex> > >& a_coveredFaceHi) const;
00194
00195 bool isDefined() const;
00196
00197 EBPatchAdvect& getPatchAdvect(const DataIndex& a_dit)
00198 {
00199 return *m_ebPatchAdvect[a_dit];
00200 }
00201 void resetBCs(const RefCountedPtr<EBPhysIBCFactory>& a_advectBC);
00202 protected:
00203
00204 bool m_hasCoarser;
00205 bool m_hasFiner;
00206 bool m_forceNoEBCF;
00207 bool m_isDefined;
00208 RealVect m_dx;
00209 int m_refRatCrse;
00210 int m_nVar;
00211 int m_nGhost;
00212
00213 DisjointBoxLayout m_thisGrids;
00214 DisjointBoxLayout m_coarGrids;
00215 EBISLayout m_thisEBISL;
00216 EBISLayout m_coarEBISL;
00217 AggEBPWLFillPatch m_fillPatch;
00218 AggEBPWLFillPatch m_fillPatchVel;
00219 ProblemDomain m_domain;
00220 LayoutData<EBPatchAdvect*> m_ebPatchAdvect;
00221
00222 private:
00223
00224 void operator=(const EBLevelAdvect& a_input)
00225 {
00226 MayDay::Error("invalid operator");
00227 }
00228 EBLevelAdvect(const EBLevelAdvect& a_input)
00229 {
00230 MayDay::Error("invalid operator");
00231 }
00232 };
00233
00234 #include "NamespaceFooter.H"
00235 #endif