Chombo + EB  3.0
EBFineToCoarRedist.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 11-07-2001
12 
13 #ifndef _EBFINETOCOARREDIST_H_
14 #define _EBFINETOCOARREDIST_H_
15 #include "REAL.H"
16 #include "Vector.H"
17 #include "EBCellFAB.H"
18 #include "EBFaceFAB.H"
19 #include "EBISLayout.H"
20 #include "EBISBox.H"
21 #include "IntVectSet.H"
22 #include "CFStencil.H"
23 #include "LoHiSide.H"
24 #include "LevelData.H"
25 #include "LayoutData.H"
26 #include "EBLevelGrid.H"
27 #include "RedistStencil.H"
28 #include "NamespaceHeader.H"
29 
30 ///
31 /**
32  A EBFineToCoarRedist handles all the data choreography
33  for fine to coarse redistribution.
34  */
36 {
37 public:
38 
39  friend class EBFluxRegister;
40 
41  ///
42  /**
43  Modify the weights in the stencil by multiplying by
44  the inputs in a normalized way.
45  If you want mass
46  weighting, send in the density on the coarse layout.
47  */
48  void
49  resetWeights(const LevelData<EBCellFAB>& a_modifierCoar,
50  const int& a_ivar);
51 
52  ///
53  /**
54  Default constructor. Leaves object undefined.
55  */
57 
58  ///
60 
61  /// uglier but general define fcn
62  /**
63  Full define function.
64  Define the stencils with volume weights.
65  If you want mass weights or whatever,
66  use reset weights.
67  */
68  void define(const DisjointBoxLayout& a_dblFine,
69  const DisjointBoxLayout& a_dblCoar,
70  const EBISLayout& a_ebislFine,
71  const EBISLayout& a_ebislCoar,
72  const Box& a_domainCoar,
73  const int& a_nref,
74  const int& a_nvar,
75  int a_redistRad = 1,
76  const EBIndexSpace* const a_ebisPtr = Chombo_EBIS::instance());
77 
78  ///
79  /**
80  potentially faster define function, especially with large numbers of
81  boxes.
82  */
83  void define(const EBLevelGrid& a_eblgFine,
84  const EBLevelGrid& a_eblgCoar,
85  const int& a_nref,
86  const int& a_nvar,
87  const int& a_redistRad);
88 
89 
90  ///
91  /**
92  Initialize values of registers to zero.
93  */
94  void setToZero();
95 
96  ///
97  /**
98  Increments the register with data from coarseMass.
99  This is the full redistribution mass. Internally
100  the class figures out what actually goes to the
101  coarse level.
102  */
103  void increment(const BaseIVFAB<Real>& a_fineMass,
104  const DataIndex& a_fineDataIndex,
105  const Interval& a_variables);
106 
107  ///
108  /**
109  Redistribute the data contained in the internal buffers.
110  */
111  void redistribute(LevelData<EBCellFAB>& a_coarSolution,
112  const Interval& a_variables);
113 
114  ///
115  bool isDefined() const;
116 
117 protected:
118 
119  //internal use only
120  void setDefaultValues();
121  void defineDataHolders();
122 
125  int m_nComp;
126  int m_refRat;
128 
129  //input fine grid
131  //input coarse grid
133  //input coarse grid
134  //RefCoar is short for refinedCoarse
136 
137  //buffers on fine layout
139  //buffers on refineed coarse layout
141 
142  //need both of these to facilitate mass-weighted
143  //redistribution
147 
149  //location of mass sources on fine layout
151  //location of mass sources on refined coarse layout
153 
154  //ebisl of input fine grid
156  //ebisl of input coar grid
158  //ebisl of refined coarse layout
160 
161 private:
162  //For all the usual reasons,
163  //there is no copy constructor for this class.
164  //Neither is there an operator= for this class.
166  {
167  MayDay::Error("invalid operator");
168  }
170  {
171  MayDay::Error("invalid operator");
172  }
173 };
174 #include "NamespaceFooter.H"
175 #endif
DisjointBoxLayout m_gridsFine
Definition: EBFineToCoarRedist.H:130
LayoutData< BaseIVFAB< VoFStencil > > m_volumeStenc
Definition: EBFineToCoarRedist.H:145
DisjointBoxLayout m_gridsRefCoar
Definition: EBFineToCoarRedist.H:135
int m_nComp
Definition: EBFineToCoarRedist.H:125
LevelData< EBCellFAB > m_densityCoar
Definition: EBFineToCoarRedist.H:148
Definition: EBIndexSpace.H:260
void redistribute(LevelData< EBCellFAB > &a_coarSolution, const Interval &a_variables)
LevelData< BaseIVFAB< Real > > m_regsFine
Definition: EBFineToCoarRedist.H:138
bool isDefined() const
LayoutData< IntVectSet > m_setsRefCoar
Definition: EBFineToCoarRedist.H:152
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: LayoutData.H:46
bool m_isDefined
Definition: EBFineToCoarRedist.H:123
Definition: EBLevelGrid.H:30
EBISLayout m_ebislRefCoar
Definition: EBFineToCoarRedist.H:159
void operator=(const EBFineToCoarRedist &)
Definition: EBFineToCoarRedist.H:165
int m_refRat
Definition: EBFineToCoarRedist.H:126
static EBIndexSpace * instance()
LayoutData< BaseIVFAB< VoFStencil > > m_standardStenc
Definition: EBFineToCoarRedist.H:146
Structure for passing component ranges in code.
Definition: Interval.H:23
int m_redistRad
Definition: EBFineToCoarRedist.H:124
LevelData< BaseIVFAB< Real > > m_regsRefCoar
Definition: EBFineToCoarRedist.H:140
EBISLayout m_ebislFine
Definition: EBFineToCoarRedist.H:155
Definition: EBFineToCoarRedist.H:35
void resetWeights(const LevelData< EBCellFAB > &a_modifierCoar, const int &a_ivar)
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
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.
EBFineToCoarRedist(const EBFineToCoarRedist &)
Definition: EBFineToCoarRedist.H:169
Box m_domainCoar
Definition: EBFineToCoarRedist.H:127
void define(const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislFine, const EBISLayout &a_ebislCoar, const Box &a_domainCoar, const int &a_nref, const int &a_nvar, int a_redistRad=1, const EBIndexSpace *const a_ebisPtr=Chombo_EBIS::instance())
uglier but general define fcn
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Definition: DataIndex.H:112
Definition: EBISLayout.H:39
EBISLayout m_ebislCoar
Definition: EBFineToCoarRedist.H:157
DisjointBoxLayout m_gridsCoar
Definition: EBFineToCoarRedist.H:132
LayoutData< BaseIVFAB< VoFStencil > > m_stenRefCoar
Definition: EBFineToCoarRedist.H:144
LayoutData< IntVectSet > m_setsFine
Definition: EBFineToCoarRedist.H:150
EBFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: EBFluxRegister.H:37
void increment(const BaseIVFAB< Real > &a_fineMass, const DataIndex &a_fineDataIndex, const Interval &a_variables)