00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _AGGEBPWLFILLPATCH_H_
00014 #define _AGGEBPWLFILLPATCH_H_
00015
00016 #include "REAL.H"
00017 #include "FArrayBox.H"
00018 #include "LevelData.H"
00019 #include "DisjointBoxLayout.H"
00020 #include "EBISLayout.H"
00021 #include "EBCellFAB.H"
00022 #include "Interval.H"
00023 #include "Stencils.H"
00024 #include "PiecewiseLinearFillPatch.H"
00025 #include "AggStencil.H"
00026 #include "EBIndexSpace.H"
00027 #include "EBLevelGrid.H"
00028 #include "NamespaceHeader.H"
00029
00030
00031
00032
00033
00034
00035
00036 class AggEBPWLFillPatch
00037 {
00038 public:
00039
00040
00041
00042
00043 AggEBPWLFillPatch();
00044
00045
00046 virtual ~AggEBPWLFillPatch();
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 AggEBPWLFillPatch(const DisjointBoxLayout& a_dblFine,
00068 const DisjointBoxLayout& a_dblCoar,
00069 const EBISLayout& a_ebislFine,
00070 const EBISLayout& a_ebislCoar,
00071 const ProblemDomain& a_domainCoar,
00072 const int& a_nref,
00073 const int& a_nvar,
00074 const int& a_radius,
00075 const IntVect& a_ghost,
00076 const bool& a_forceNoEBCF = false,
00077 const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
00078
00079
00080
00081 AggEBPWLFillPatch(const EBLevelGrid & a_eblgFine,
00082 const EBLevelGrid & a_eblgCoar,
00083 const int& a_nref,
00084 const int& a_nvar,
00085 const int& a_radius,
00086 const IntVect& a_ghost,
00087 const bool& a_forceNoEBCF = false,
00088 const EBIndexSpace* const a_eb = Chombo_EBIS::instance())
00089 {
00090 setDefaultValues();
00091 define(a_eblgFine.getDBL(),
00092 a_eblgCoar.getDBL(),
00093 a_eblgFine.getEBISL(),
00094 a_eblgCoar.getEBISL(),
00095 a_eblgCoar.getDomain(),
00096 a_nref, a_nvar, a_radius, a_ghost, a_forceNoEBCF, a_eb);
00097 }
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 void define(const DisjointBoxLayout& a_dblFine,
00119 const DisjointBoxLayout& a_dblCoar,
00120 const EBISLayout& a_ebislFine,
00121 const EBISLayout& a_ebislCoar,
00122 const ProblemDomain& a_domainCoar,
00123 const int& a_nref,
00124 const int& a_nvar,
00125 const int& a_radius,
00126 const IntVect& a_ghost,
00127 const bool& a_forceNoEBCF = false,
00128 const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
00129
00130
00131
00132
00133
00134
00135 bool isDefined() const
00136 {
00137 return m_isDefined;
00138 }
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 virtual void
00157 interpolate(LevelData<EBCellFAB>& a_fineData,
00158 const LevelData<EBCellFAB>& a_coarDataOld,
00159 const LevelData<EBCellFAB>& a_coarDataNew,
00160 const Real& a_coarTimeOld,
00161 const Real& a_coarTimeNew,
00162 const Real& a_fineTime,
00163 const Interval& a_variables) const;
00164
00165 protected:
00166
00167
00168
00169 virtual void
00170 definePieceWiseLinearFillPatch(const DisjointBoxLayout& a_dblfine,
00171 const DisjointBoxLayout& a_dblCoar);
00172
00173 void getOffsets(const LayoutData< Vector<VolIndex> >& a_srcVoFsCoar,
00174 const LayoutData<IntVectSet>& a_irregRegionsFine,
00175 const LayoutData<Vector<VoFStencil> > a_loStencils[SpaceDim],
00176 const LayoutData<Vector<VoFStencil> > a_hiStencils[SpaceDim],
00177 const LayoutData<IntVectSet> a_coarLoInterp[SpaceDim],
00178 const LayoutData<IntVectSet> a_coarHiInterp[SpaceDim],
00179 const LayoutData<IntVectSet> a_coarCeInterp[SpaceDim]);
00180
00181
00182 void
00183 interpolateFAB(EBCellFAB& a_fine,
00184 const EBCellFAB& a_coarOld,
00185 const EBCellFAB& a_coarNew,
00186 const Real& a_coarTimeOld,
00187 const Real& a_coarTimeNew,
00188 const Real& a_fineTime,
00189 const DataIndex& a_datInd,
00190 const Interval& a_variables) const;
00191
00192 void
00193 makeStencils();
00194
00195 void defineSlopeHolders(const LayoutData<IntVectSet>& a_irregRegionsCoFi);
00196
00197 void
00198 getIVS(LayoutData<IntVectSet>& a_irregRegionsFine,
00199 LayoutData<IntVectSet>& a_irregRegionsCoFi,
00200 LayoutData< Vector<VolIndex> >& a_srcVoFs);
00201
00202 void
00203 defineAggStencils(LayoutData<Vector<VoFStencil> > a_loStencils[SpaceDim],
00204 LayoutData<Vector<VoFStencil> > a_hiStencils[SpaceDim],
00205 const LayoutData< Vector<VolIndex> >& a_srcVoFs);
00206 void
00207 getLoHiCenIVS(LayoutData<IntVectSet> a_coarLoInterp[SpaceDim],
00208 LayoutData<IntVectSet> a_coarHiInterp[SpaceDim],
00209 LayoutData<IntVectSet> a_coarCeInterp[SpaceDim]);
00210
00211 void
00212 getSten(LayoutData<Vector<VoFStencil> > a_loStencils[SpaceDim],
00213 LayoutData<Vector<VoFStencil> > a_hiStencils[SpaceDim],
00214 LayoutData<IntVectSet> a_coarLoInterp[SpaceDim],
00215 LayoutData<IntVectSet> a_coarHiInterp[SpaceDim],
00216 LayoutData<IntVectSet> a_coarCeInterp[SpaceDim],
00217 const LayoutData< Vector<VolIndex> >& a_srcVoFs);
00218
00219 void getSlopes(const EBCellFAB& a_coarDataOld,
00220 const EBCellFAB& a_coarDataNew,
00221 const DataIndex& a_dit,
00222 const Interval& a_variables) const;
00223
00224 void deltaMinMod(Real& a_slope, Real& a_slopeLo, Real& a_slopeHi) const;
00225
00226 void setDefaultValues();
00227
00228 struct
00229 {
00230 size_t offset;
00231 int dataID;
00232 } typedef access_t;
00233
00234 struct
00235 {
00236 access_t dest_access;
00237 int slop_index;
00238 IntVect coariv;
00239 IntVect fineiv;
00240 } typedef fine_logic_t;
00241
00242 struct
00243 {
00244 access_t slop_access;
00245 access_t data_access;
00246 bool has_lo[SpaceDim];
00247 bool has_hi[SpaceDim];
00248 bool ivs_lo[SpaceDim];
00249 bool ivs_hi[SpaceDim];
00250 bool ivs_ce[SpaceDim];
00251 } typedef coar_logic_t;
00252
00253
00254 LayoutData< Vector<fine_logic_t> > m_fineOffsets;
00255
00256 LayoutData< Vector<coar_logic_t> > m_coarOffsets;
00257
00258 bool m_forceNoEBCF;
00259 bool m_isDefined;
00260
00261
00262 PiecewiseLinearFillPatch* m_patcher;
00263
00264
00265 IntVect m_ghost;
00266
00267 ProblemDomain m_coarDomain;
00268
00269 DisjointBoxLayout m_coarsenedFineGrids;
00270 DisjointBoxLayout m_fineGrids;
00271 DisjointBoxLayout m_coarGrids;
00272 EBISLayout m_coarsenedFineEBISL;
00273 EBISLayout m_fineEBISL;
00274
00275
00276 mutable LevelData<EBCellFAB> m_coarOnFDataOld;
00277 mutable LevelData<EBCellFAB> m_coarOnFDataNew;
00278
00279 int m_refRat;
00280 int m_nComp;
00281 int m_radius;
00282 int m_coarGhostRad;
00283
00284
00285 mutable LayoutData< BaseIVFAB<Real> > m_slopeLoOld[SpaceDim];
00286 mutable LayoutData< BaseIVFAB<Real> > m_slopeHiOld[SpaceDim];
00287 mutable LayoutData< BaseIVFAB<Real> > m_slopeCeOld[SpaceDim];
00288 mutable LayoutData< BaseIVFAB<Real> > m_slopeLoNew[SpaceDim];
00289 mutable LayoutData< BaseIVFAB<Real> > m_slopeHiNew[SpaceDim];
00290 mutable LayoutData< BaseIVFAB<Real> > m_slopeCeNew[SpaceDim];
00291
00292 LayoutData< RefCountedPtr<AggStencil <EBCellFAB, BaseIVFAB<Real> > > > m_stenLo[SpaceDim];
00293 LayoutData< RefCountedPtr<AggStencil <EBCellFAB, BaseIVFAB<Real> > > > m_stenHi[SpaceDim];
00294
00295 private:
00296
00297 AggEBPWLFillPatch(const AggEBPWLFillPatch& ebcin);
00298
00299 void operator=(const AggEBPWLFillPatch& fabin);
00300
00301 };
00302
00303 #include "NamespaceFooter.H"
00304 #endif