00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _EBPWLFILLPATCH_H_
00014 #define _EBPWLFILLPATCH_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 "BaseIVFAB.H"
00026 #include "EBIndexSpace.H"
00027 #include "NamespaceHeader.H"
00028
00030
00035 class EBPWLFillPatch
00036 {
00037 public:
00039
00042 EBPWLFillPatch();
00043
00045 virtual ~EBPWLFillPatch();
00046
00048
00063 EBPWLFillPatch(const DisjointBoxLayout& a_dblFine,
00064 const DisjointBoxLayout& a_dblCoar,
00065 const EBISLayout& a_ebislFine,
00066 const EBISLayout& a_ebislCoar,
00067 const ProblemDomain& a_domainCoar,
00068 const int& a_nref,
00069 const int& a_nvar,
00070 const int& a_radius);
00071
00073
00087 void define(const DisjointBoxLayout& a_dblFine,
00088 const DisjointBoxLayout& a_dblCoar,
00089 const EBISLayout& a_ebislFine,
00090 const EBISLayout& a_ebislCoar,
00091 const ProblemDomain& a_domainCoar,
00092 const int& a_nref,
00093 const int& a_nvar,
00094 const int& a_radius,
00095 const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
00096
00098
00102 bool isDefined() const;
00103
00105
00120 virtual void
00121 interpolate(LevelData<EBCellFAB>& a_fineData,
00122 const LevelData<EBCellFAB>& a_coarDataOld,
00123 const LevelData<EBCellFAB>& a_coarDataNew,
00124 const Real& a_coarTimeOld,
00125 const Real& a_coarTimeNew,
00126 const Real& a_fineTime,
00127 const Interval& a_variables);
00128
00129
00130 virtual void
00131 pwConstInterp(Real & a_fineValOld,
00132 Real & a_fineValNew,
00133 const VolIndex & a_fineVof,
00134 const int & a_ivar,
00135 const Real & a_coarDataOld,
00136 const Real & a_coarDataNew,
00137 const VolIndex & a_coarseVof)const;
00138
00139 virtual void
00140 incrementLinearInterp(Real & a_fineValOld,
00141 Real & a_fineValNew,
00142 const VolIndex & a_fineVof,
00143 const int & a_ivar,
00144 const Real & a_deltaOldOld,
00145 const Real & a_deltaNew,
00146 const Real & a_differenceFineLocCoarseLoc,
00147 const VolIndex & a_coarseVof)const;
00148
00149 virtual void
00150 definePieceWiseLinearFillPatch(const DisjointBoxLayout& a_dblfine,
00151 const DisjointBoxLayout& a_dblCoar);
00152
00153 protected:
00154
00155
00156 void
00157 interpolateFAB(EBCellFAB& a_fine,
00158 const EBCellFAB& a_coarOld,
00159 const EBCellFAB& a_coarNew,
00160 const Real& a_coarTimeOld,
00161 const Real& a_coarTimeNew,
00162 const Real& a_fineTime,
00163 const DataIndex& a_datInd,
00164 const Interval& a_variables) const;
00165
00166 void
00167 makeStencils();
00168
00169 void
00170 getIVS();
00171
00172 void
00173 getLoHiCenIVS();
00174
00175 void
00176 getSten();
00177
00178 void setDefaultValues();
00179
00180 bool m_isDefined;
00181
00182 bool extractFromSten(Real& a_value,
00183 const VoFStencil& a_vofsten,
00184 const EBCellFAB& a_coarData,
00185 const int& ivar) const;
00186
00187 virtual Real computeDMinMod(const BaseIVFAB<VoFStencil >& a_lostenBF,
00188 const BaseIVFAB<VoFStencil >& a_histenBF,
00189 const VolIndex& a_coarVoF,
00190 const EBCellFAB& a_coarData,
00191 const int& ivar,
00192 const IntVectSet& loInterpSet,
00193 const IntVectSet& hiInterpSet,
00194 const IntVectSet& ceInterpSet) const;
00195
00196
00197 PiecewiseLinearFillPatch* m_patcher;
00198
00199
00200 ProblemDomain m_coarDomain;
00201 DisjointBoxLayout m_coarsenedFineGrids;
00202 DisjointBoxLayout m_fineGrids;
00203 DisjointBoxLayout m_coarGrids;
00204 EBISLayout m_coarsenedFineEBISL;
00205 EBISLayout m_fineEBISL;
00206
00207 LevelData<EBCellFAB> m_coarOnFDataOld;
00208 LevelData<EBCellFAB> m_coarOnFDataNew;
00209
00210 int m_refRat;
00211 int m_nComp;
00212 int m_radius;
00213 int m_coarGhostRad;
00214
00215
00216
00217 LayoutData<IntVectSet> m_irregRegionsFine;
00218
00219
00220
00221
00222 LayoutData<BaseIVFAB<VoFStencil> > m_hiStencils[SpaceDim];
00223 LayoutData<BaseIVFAB<VoFStencil> > m_loStencils[SpaceDim];
00224
00225
00226
00227
00228
00229 LayoutData<IntVectSet> m_coarCeInterp[SpaceDim];
00230 LayoutData<IntVectSet> m_coarLoInterp[SpaceDim];
00231 LayoutData<IntVectSet> m_coarHiInterp[SpaceDim];
00232
00233 private:
00234
00235 EBPWLFillPatch(const EBPWLFillPatch& ebcin)
00236 {
00237 MayDay::Error("ebpwl 2 invalid operator");
00238 }
00239 void operator=(const EBPWLFillPatch& fabin)
00240 {
00241 MayDay::Error("ebpwl 3 invalid operator");
00242 }
00243 };
00244
00245 #include "NamespaceFooter.H"
00246 #endif