Chombo + EB  3.2
EBPWLFineInterp.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 thurs, aug 23, 2001
12 
13 #ifndef _EBPWLFINEINTERP_H_
14 #define _EBPWLFINEINTERP_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"
24 #include "BaseIVFAB.H"
25 #include "EBIndexSpace.H"
26 #include "NamespaceHeader.H"
27 
28 ///
29 /**
30  */
32 {
33 public:
34  ///
35  /**
36  Default constructor. User must subsequently call define().
37  */
39 
40  ///
42 
43  ///
44  /**
45  Defining constructor. Constructs a valid object.
46  Equivalent to default construction followed by define().
47 
48  {\bf Arguments:}\\
49  dblFine, dblCoar: The fine and coarse layouts
50  of the data.\\
51  ebislFine, ebislCoar: The fine and coarse layouts
52  of the geometric description.\\
53  nref: The refinement ratio between the two levels. \\
54  nvar: The number of variables contained in the data
55  at each VoF.
56  */
57  EBPWLFineInterp(const DisjointBoxLayout& a_dblFine,
58  const DisjointBoxLayout& a_dblCoar,
59  const EBISLayout& a_ebislFine,
60  const EBISLayout& a_ebislCoar,
61  const ProblemDomain& a_domainCoar,
62  const int& a_nref,
63  const int& a_nvar,
64  const EBIndexSpace* const a_ebisPtr = Chombo_EBIS::instance());
65 
66  ///
67  /**
68  Defines this object. Existing information is overriden.
69 
70  {\bf Arguments:}\\
71  dblFine, dblCoar: The fine and coarse layouts
72  of the data.\\
73  ebislFine, ebislCoar: The fine and coarse layouts
74  of the geometric description.\\
75  nref: The refinement ratio between the two levels. \\
76  nvar: The number of variables contained in the data
77  at each VoF.
78  */
79  void define(const DisjointBoxLayout& a_dblFine,
80  const DisjointBoxLayout& a_dblCoar,
81  const EBISLayout& a_ebislFine,
82  const EBISLayout& a_ebislCoar,
83  const ProblemDomain& a_domainCoar,
84  const int& a_nref,
85  const int& a_nvar,
86  const EBIndexSpace* const a_ebisPtr = Chombo_EBIS::instance());
87 
88  ///
89  /**
90  Returns true if this object was created with the defining
91  constructor or if define() has been called.
92  */
93  bool isDefined() const;
94 
95  ///
96  /**
97  Interpolate the fine data from the coarse data
98  over the intersection
99  of the fine layout with the refined coarse layout. \\
100  NOTE: This function sends these arrays
101  to Fortran so you must set the covered
102  cell values to something. Unitialized memory
103  might cause IEEE problems with some compilers.
104  {\bf Arguments:}\\
105  coarData: The data over the coarse layout.\\
106  fineData: The data over the fine layout. \\
107  Fine and coarse data must
108  have the same number of variables.\\
109  variables: The variables to interpolate. Those not
110  in this range will be left alone. This range of variables
111  must be in both the coarse and fine data.
112  */
113  void
114  interpolate(LevelData<EBCellFAB>& a_fineData,
115  const LevelData<EBCellFAB>& a_coarseData,
116  const Interval& a_variables);
117 
118 protected:
119  void
120  interpolateFAB(EBCellFAB& a_fine,
121  const EBCellFAB& a_coar,
122  const DataIndex& a_datInd,
123  const Interval& a_variables) const;
124 
125  void makeDerivStencils();
126 
127  void setDefaultValues();
128 
130 
134 
135  int m_refRat;
136  int m_nComp;
138 
139  //irregular cells
141 
142  //diffs high and low---need to make the choice
143  //about which to use based on the data.
146 
147 private:
148  //disallowed for all the usual reasons
150  {
151  MayDay::Error("ebpwl 2 invalid operator");
152  }
153  void operator=(const EBPWLFineInterp& fabin)
154  {
155  MayDay::Error("ebpwl 3 invalid operator");
156  }
157 };
158 
159 #include "NamespaceFooter.H"
160 #endif
bool m_isDefined
Definition: EBPWLFineInterp.H:129
EBPWLFineInterp(const EBPWLFineInterp &ebcin)
Definition: EBPWLFineInterp.H:149
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int m_refRat
Definition: EBPWLFineInterp.H:135
Definition: EBIndexSpace.H:50
void interpolate(LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_coarseData, const Interval &a_variables)
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 EBIndexSpace *const a_ebisPtr=Chombo_EBIS::instance())
void interpolateFAB(EBCellFAB &a_fine, const EBCellFAB &a_coar, const DataIndex &a_datInd, const Interval &a_variables) const
bool isDefined() const
int m_nComp
Definition: EBPWLFineInterp.H:136
const int SpaceDim
Definition: SPACE.H:38
void operator=(const EBPWLFineInterp &fabin)
Definition: EBPWLFineInterp.H:153
static EBIndexSpace * instance()
void makeDerivStencils()
Structure for passing component ranges in code.
Definition: Interval.H:23
Definition: EBCellFAB.H:29
EBISLayout m_coarsenedFineEBISL
Definition: EBPWLFineInterp.H:133
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LayoutData< BaseIVFAB< VoFStencil > > m_loStencils[SpaceDim]
Definition: EBPWLFineInterp.H:145
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.
Definition: EBPWLFineInterp.H:31
LayoutData< BaseIVFAB< VoFStencil > > m_hiStencils[SpaceDim]
Definition: EBPWLFineInterp.H:144
Definition: DataIndex.H:112
void setDefaultValues()
ProblemDomain m_coarDomain
Definition: EBPWLFineInterp.H:132
DisjointBoxLayout m_coarsenedFineGrids
Definition: EBPWLFineInterp.H:131
Definition: EBISLayout.H:39
LevelData< EBCellFAB > m_coarsenedFineData
Definition: EBPWLFineInterp.H:137
LayoutData< IntVectSet > m_irregRegions
Definition: EBPWLFineInterp.H:140