Chombo + EB  3.0
EBCoarToCoarRedist.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 mon nov 19 2001
12 
13 #ifndef _EBCOARTOCOARREDIST_H_
14 #define _EBCOARTOCOARREDIST_H_
15 
16 #include "REAL.H"
17 #include "Vector.H"
18 #include "EBCellFAB.H"
19 #include "EBFaceFAB.H"
20 #include "EBISLayout.H"
21 #include "EBISBox.H"
22 #include "IntVectSet.H"
23 #include "CFStencil.H"
24 #include "LoHiSide.H"
25 #include "LevelData.H"
26 #include "LayoutData.H"
27 #include "EBLevelGrid.H"
28 #include "RedistStencil.H"
29 #include "NamespaceHeader.H"
30 
31 ///
32 /**
33  A EBCoarToCoarRedist handles all the data choreography
34  for coarse to coarse redistribution ("re-redistribution").
35  */
37 {
38 public:
39 
40  friend class EBFluxRegister;
41 
42  ///
43  /**
44  Default constructor. Leaves object undefined.
45  */
47 
48  ///
50 
51  ///
52  /**
53  Full define function. \\
54  dblFine, dblCoar: The fine and coarse layouts
55  of the data. \\
56  ebislFine, ebislCoar: The fine and coarse layouts
57  of the geometric description.\\
58  nref: The refinement ratio between the two levels.\\
59  nvar: The number of variables contained in the data
60  at each VoF. \\
61  coarStencil: The redistribution stencil for this level.
62  */
63  void define(const DisjointBoxLayout& a_dblFine,
64  const DisjointBoxLayout& a_dblCoar,
65  const EBISLayout& a_ebislFine,
66  const EBISLayout& a_ebislCoar,
67  const Box& a_domainCoar,
68  const int& a_nref,
69  const int& a_nvar,
70  int a_redistRad = 1);
71 
72  ///
73  /**
74  potentially faster define function, especially with large numbers of
75  boxes.
76  */
77  void define(const EBLevelGrid& a_eblgFine,
78  const EBLevelGrid& a_eblgCoar,
79  const int& a_nref,
80  const int& a_nvar,
81  const int& a_redistRad);
82 
83  ///
84  /**
85  Initialize values of registers to zero.
86  */
87  void setToZero();
88 
89  ///
90  /**
91  Increments the register with data from coarseMass.
92  This is the full redistribution mass. Internally
93  the class figures out what actually gets re-redistributed.
94  */
95  void increment(const BaseIVFAB<Real>& a_coarMass,
96  const DataIndex& a_fineDataIndex,
97  const Interval& a_variables);
98 
99  ///
100  /**
101  */
102  void
103  resetWeights(const LevelData<EBCellFAB>& a_modifier,
104  const int& a_ivar);
105 
106  ///
107  /**
108  Reredistribute the data contained in the internal buffers.
109  */
110  void redistribute(LevelData<EBCellFAB>& a_coarSolution,
111  const Interval& a_variables);
112 
113  ///
114  bool isDefined() const;
115 
116 protected:
117 
118  //internal use only
119  void setDefaultValues();
120  void defineDataHolders();
121 
124  int m_nComp;
125  int m_refRat;
127 
128  //input fine grid
130  //input coarse grid
132 
133  //buffers on refineed coarse layout
135 
136  //location of mass sources on refined coarse layout
138 
139  //ebisl of input fine grid
141  //ebisl of input coar grid
143 
145  //need both of these to facilitate mass-weighted
146  //redistribution
150 
151 private:
152  //For all the usual reasons,
153  //there is no copy constructor for this class.
154  //Neither is there an operator= for this class.
156  {
157  MayDay::Error("invalid operator");
158  }
160  {
161  MayDay::Error("invalid operator");
162  }
163 };
164 
165 #include "NamespaceFooter.H"
166 #endif
LayoutData< BaseIVFAB< VoFStencil > > m_standardStenc
Definition: EBCoarToCoarRedist.H:148
int m_refRat
Definition: EBCoarToCoarRedist.H:125
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)
LayoutData< BaseIVFAB< VoFStencil > > m_volumeStenc
Definition: EBCoarToCoarRedist.H:147
EBISLayout m_ebislCoar
Definition: EBCoarToCoarRedist.H:142
DisjointBoxLayout m_gridsFine
Definition: EBCoarToCoarRedist.H:129
bool m_isDefined
Definition: EBCoarToCoarRedist.H:122
Definition: EBLevelGrid.H:30
LayoutData< IntVectSet > m_setsCoar
Definition: EBCoarToCoarRedist.H:137
LayoutData< BaseIVFAB< VoFStencil > > m_stenCoar
Definition: EBCoarToCoarRedist.H:144
int m_redistRad
Definition: EBCoarToCoarRedist.H:123
bool isDefined() const
void operator=(const EBCoarToCoarRedist &)
Definition: EBCoarToCoarRedist.H:155
Structure for passing component ranges in code.
Definition: Interval.H:23
Definition: EBCoarToCoarRedist.H:36
LevelData< EBCellFAB > m_densityCoar
Definition: EBCoarToCoarRedist.H:149
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
void increment(const BaseIVFAB< Real > &a_coarMass, const DataIndex &a_fineDataIndex, const Interval &a_variables)
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.
void resetWeights(const LevelData< EBCellFAB > &a_modifier, const int &a_ivar)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
EBISLayout m_ebislFine
Definition: EBCoarToCoarRedist.H:140
DisjointBoxLayout m_gridsCoar
Definition: EBCoarToCoarRedist.H:131
Definition: DataIndex.H:112
Box m_domainCoar
Definition: EBCoarToCoarRedist.H:126
Definition: EBISLayout.H:39
int m_nComp
Definition: EBCoarToCoarRedist.H:124
LevelData< BaseIVFAB< Real > > m_regsCoar
Definition: EBCoarToCoarRedist.H:134
EBCoarToCoarRedist(const EBCoarToCoarRedist &)
Definition: EBCoarToCoarRedist.H:159
EBFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: EBFluxRegister.H:37
void redistribute(LevelData< EBCellFAB > &a_coarSolution, const Interval &a_variables)