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