Chombo + EB + MF  3.2
EBPWLFillPatch.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 // dtgraves fri, sept 7, 2001
12 
13 #ifndef _EBPWLFILLPATCH_H_
14 #define _EBPWLFILLPATCH_H_
15 
16 #include "REAL.H"
17 #include "FArrayBox.H"
18 #include "LevelData.H"
19 #include "DisjointBoxLayout.H"
20 #include "EBISLayout.H"
21 #include "EBCellFAB.H"
22 #include "Interval.H"
23 #include "Stencils.H"
25 #include "BaseIVFAB.H"
26 #include "EBIndexSpace.H"
27 #include "NamespaceHeader.H"
28 
29 ///
30 /**
31  Fills one layer of fine level ghost cells
32  by piecewise linear interpolation
33  from the coarse level.
34  */
36 {
37 public:
38  ///
39  /**
40  Default constructor. User must subsequently call define().
41  */
43 
44  ///
45 virtual ~EBPWLFillPatch();
46 
47  ///
48  /**
49  Defining constructor. Constructs a valid object.
50  Equivalent to default construction followed by define().
51 
52  {\bf Arguments:}\\
53  dblFine, dblCoar: The fine and coarse layouts
54  of the data.\\
55  ebislFine, ebislCoar: The fine and coarse layouts
56  of the geometric description.\\
57  nref: The refinement ratio between the two levels. \\
58  nvar: The number of variables contained in the data
59  at each VoF.\\
60  radius: the total number of
61  ghost cells filled.
62  forceNoEBCF = true promises that the embedded boundary
63  will not cross the coarse-fine interface. This will save you
64  a lot of compute time if you are certain you are tagging all irregulkar cells.
65  */
66  EBPWLFillPatch(const DisjointBoxLayout& a_dblFine,
67  const DisjointBoxLayout& a_dblCoar,
68  const EBISLayout& a_ebislFine,
69  const EBISLayout& a_ebislCoar,
70  const ProblemDomain& a_domainCoar,
71  const int& a_nref,
72  const int& a_nvar,
73  const int& a_radius,
74  const bool& a_forceNoEBCF = false,
75  const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
76 
77  ///
78  /**
79  Defines this object. Existing information is overriden.
80 
81  {\bf Arguments:}\\
82  dblFine, dblCoar: The fine and coarse layouts
83  of the data.\\
84  ebislFine, ebislCoar: The fine and coarse layouts
85  of the geometric description.\\
86  nref: The refinement ratio between the two levels. \\
87  nvar: The number of variables contained in the data
88  at each VoF.
89  radius: the total number of
90  ghost cells filled.
91  forceNoEBCF = true promises that the embedded boundary
92  will not cross the coarse-fine interface. This will save you
93  a lot of compute time if you are certain you are tagging all irregulkar cells.
94  */
95  virtual void define(const DisjointBoxLayout& a_dblFine,
96  const DisjointBoxLayout& a_dblCoar,
97  const EBISLayout& a_ebislFine,
98  const EBISLayout& a_ebislCoar,
99  const ProblemDomain& a_domainCoar,
100  const int& a_nref,
101  const int& a_nvar,
102  const int& a_radius,
103  const bool& a_forceNoEBCF = false,
104  const EBIndexSpace* const a_eb = Chombo_EBIS::instance());
105 
106  ///
107  /**
108  Returns true if this object was created with the defining
109  constructor or if define() has been called.
110  */
111  bool isDefined() const;
112 
113  ///
114  /**
115  Interpolate the fine data from the coarse data
116  over the intersection
117  of the fine layout with the refined coarse layout. \\
118  {\bf Arguments:}\\
119  coarDataOld: The data over the coarse layout at coarse time old.\\
120  coarDatanew: The data over the coarse layout at coarse time new.\\
121  fineData: The data over the fine layout. \\
122  Error occurs unless coarTimeOld <= fineTime <= coarTimeNew \\
123  Fine and coarse data must
124  have the same number of variables.\\
125  variables: The variables to interpolate. Those not
126  in this range will be left alone. This range of variables
127  must be in both the coarse and fine data.
128  */
129  virtual void
130  interpolate(LevelData<EBCellFAB>& a_fineData,
131  const LevelData<EBCellFAB>& a_coarDataOld,
132  const LevelData<EBCellFAB>& a_coarDataNew,
133  const Real& a_coarTimeOld,
134  const Real& a_coarTimeNew,
135  const Real& a_fineTime,
136  const Interval& a_variables);
137 
138 
139  virtual void
140  pwConstInterp(Real & a_fineValOld,
141  Real & a_fineValNew,
142  const VolIndex & a_fineVof,
143  const int & a_ivar,
144  const Real & a_coarDataOld,
145  const Real & a_coarDataNew,
146  const VolIndex & a_coarseVof)const;
147 
148  virtual void
149  incrementLinearInterp(Real & a_fineValOld,
150  Real & a_fineValNew,
151  const VolIndex & a_fineVof,
152  const int & a_ivar,
153  const Real & a_deltaOldOld,
154  const Real & a_deltaNew,
155  const Real & a_differenceFineLocCoarseLoc,
156  const VolIndex & a_coarseVof)const;
157 
158  virtual void
160  const DisjointBoxLayout& a_dblCoar);
161 
162  protected:
163 
164  //internal use only functions
165  void
166  interpolateFAB(EBCellFAB& a_fine,
167  const EBCellFAB& a_coarOld,
168  const EBCellFAB& a_coarNew,
169  const Real& a_coarTimeOld,
170  const Real& a_coarTimeNew,
171  const Real& a_fineTime,
172  const DataIndex& a_datInd,
173  const Interval& a_variables) const;
174 
175  void
176  makeStencils();
177 
178  void
179  getIVS();
180 
181  void
182  getLoHiCenIVS();
183 
184  void
185  getSten();
186 
187  void setDefaultValues();
188 
190 
191  bool extractFromSten(Real& a_value,
192  const VoFStencil& a_vofsten,
193  const EBCellFAB& a_coarData,
194  const int& ivar) const;
195 
196  virtual Real computeDMinMod(const BaseIVFAB<VoFStencil >& a_lostenBF,
197  const BaseIVFAB<VoFStencil >& a_histenBF,
198  const VolIndex& a_coarVoF,
199  const EBCellFAB& a_coarData,
200  const int& ivar,
201  const IntVectSet& loInterpSet,
202  const IntVectSet& hiInterpSet,
203  const IntVectSet& ceInterpSet) const;
205 
206  //non-EB fill patch
208 
209  //bloated class data
216 
219 
220  int m_refRat;
221  int m_nComp;
222  int m_radius;
224 
225  //places to do interpolation
226  //at fine refinement level
228 
229  //diffs high and low---need to make the choice
230  //about which to use based on the data. one
231  //for each direction of the derivative.
234 
235  // per-grid coarse locations that you interpolate from, by type of
236  // interpolation in the specified coordinate direction.
237  //this specifies constraints due to domain and union of rectangles
238  //at coarse level
242 
243 private:
244  //disallowed for all the usual reasons
246  {
247  MayDay::Error("ebpwl 2 invalid operator");
248  }
249  void operator=(const EBPWLFillPatch& fabin)
250  {
251  MayDay::Error("ebpwl 3 invalid operator");
252  }
253 };
254 
255 #include "NamespaceFooter.H"
256 #endif
LevelData< EBCellFAB > m_coarOnFDataOld
Definition: EBPWLFillPatch.H:217
virtual void define(const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislFine, const EBISLayout &a_ebislCoar, const ProblemDomain &a_domainCoar, const int &a_nref, const int &a_nvar, const int &a_radius, const bool &a_forceNoEBCF=false, const EBIndexSpace *const a_eb=Chombo_EBIS::instance())
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
virtual Real computeDMinMod(const BaseIVFAB< VoFStencil > &a_lostenBF, const BaseIVFAB< VoFStencil > &a_histenBF, const VolIndex &a_coarVoF, const EBCellFAB &a_coarData, const int &ivar, const IntVectSet &loInterpSet, const IntVectSet &hiInterpSet, const IntVectSet &ceInterpSet) const
void operator=(const EBPWLFillPatch &fabin)
Definition: EBPWLFillPatch.H:249
Definition: EBIndexSpace.H:50
EBPWLFillPatch(const EBPWLFillPatch &ebcin)
Definition: EBPWLFillPatch.H:245
Fills ghost cells by linear interpolation in space and time.
Definition: PiecewiseLinearFillPatch.H:128
int m_refRat
Definition: EBPWLFillPatch.H:220
DisjointBoxLayout m_coarsenedFineGrids
Definition: EBPWLFillPatch.H:211
Definition: EBPWLFillPatch.H:35
bool m_forceNoEBCF
Definition: EBPWLFillPatch.H:204
int m_radius
Definition: EBPWLFillPatch.H:222
bool extractFromSten(Real &a_value, const VoFStencil &a_vofsten, const EBCellFAB &a_coarData, const int &ivar) const
DisjointBoxLayout m_coarGrids
Definition: EBPWLFillPatch.H:213
EBISLayout m_fineEBISL
Definition: EBPWLFillPatch.H:215
virtual void pwConstInterp(Real &a_fineValOld, Real &a_fineValNew, const VolIndex &a_fineVof, const int &a_ivar, const Real &a_coarDataOld, const Real &a_coarDataNew, const VolIndex &a_coarseVof) const
virtual void interpolate(LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_coarDataOld, const LevelData< EBCellFAB > &a_coarDataNew, const Real &a_coarTimeOld, const Real &a_coarTimeNew, const Real &a_fineTime, const Interval &a_variables)
DisjointBoxLayout m_fineGrids
Definition: EBPWLFillPatch.H:212
const int SpaceDim
Definition: SPACE.H:38
VoF-centered stencil.
Definition: Stencils.H:60
static EBIndexSpace * instance()
Structure for passing component ranges in code.
Definition: Interval.H:23
bool isDefined() const
Definition: EBCellFAB.H:29
LayoutData< BaseIVFAB< VoFStencil > > m_loStencils[SpaceDim]
Definition: EBPWLFillPatch.H:233
LayoutData< IntVectSet > m_coarCeInterp[SpaceDim]
Definition: EBPWLFillPatch.H:239
virtual void definePieceWiseLinearFillPatch(const DisjointBoxLayout &a_dblfine, const DisjointBoxLayout &a_dblCoar)
PiecewiseLinearFillPatch * m_patcher
Definition: EBPWLFillPatch.H:207
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void makeStencils()
void setDefaultValues()
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.
EBISLayout m_coarsenedFineEBISL
Definition: EBPWLFillPatch.H:214
LayoutData< IntVectSet > m_irregRegionsFine
Definition: EBPWLFillPatch.H:227
int m_nComp
Definition: EBPWLFillPatch.H:221
LayoutData< IntVectSet > m_coarLoInterp[SpaceDim]
Definition: EBPWLFillPatch.H:240
virtual void incrementLinearInterp(Real &a_fineValOld, Real &a_fineValNew, const VolIndex &a_fineVof, const int &a_ivar, const Real &a_deltaOldOld, const Real &a_deltaNew, const Real &a_differenceFineLocCoarseLoc, const VolIndex &a_coarseVof) const
Definition: DataIndex.H:114
Volume of Fluid Index.
Definition: VolIndex.H:31
void getLoHiCenIVS()
virtual ~EBPWLFillPatch()
Definition: EBISLayout.H:39
ProblemDomain m_coarDomain
Definition: EBPWLFillPatch.H:210
bool m_isDefined
Definition: EBPWLFillPatch.H:189
int m_coarGhostRad
Definition: EBPWLFillPatch.H:223
LayoutData< BaseIVFAB< VoFStencil > > m_hiStencils[SpaceDim]
Definition: EBPWLFillPatch.H:232
Definition: BaseIVFAB.H:32
void interpolateFAB(EBCellFAB &a_fine, const EBCellFAB &a_coarOld, const EBCellFAB &a_coarNew, const Real &a_coarTimeOld, const Real &a_coarTimeNew, const Real &a_fineTime, const DataIndex &a_datInd, const Interval &a_variables) const
LayoutData< IntVectSet > m_coarHiInterp[SpaceDim]
Definition: EBPWLFillPatch.H:241
LevelData< EBCellFAB > m_coarOnFDataNew
Definition: EBPWLFillPatch.H:218