Chombo + EB + MF  3.2
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  dblCoar: coarse layouts
55  of the data. \\
56  ebislCoar: coarse EBISlayout \\
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_ebislCoar,
66  const Box& a_domainCoar,
67  const int& a_nref,
68  const int& a_nvar,
69  int a_redistRad = 1);
70 
71  ///
72  /**
73  potentially faster define function, especially with large numbers of
74  boxes.
75  */
76  void define(const EBLevelGrid& a_eblgFine,
77  const EBLevelGrid& a_eblgCoar,
78  const int& a_nref,
79  const int& a_nvar,
80  const int& a_redistRad);
81 
82  ///
83  /**
84  Initialize values of registers to zero.
85  */
86  void setToZero();
87 
88  ///
89  /**
90  Increments the register with data from coarseMass.
91  This is the full redistribution mass. Internally
92  the class figures out what actually gets re-redistributed.
93  */
94  void increment(const BaseIVFAB<Real>& a_coarMass,
95  const DataIndex& a_fineDataIndex,
96  const Interval& a_variables);
97 
98  ///
99  /**
100  */
101  void
102  resetWeights(const LevelData<EBCellFAB>& a_modifier,
103  const int& a_ivar);
104 
105  ///
106  /**
107  Reredistribute the data contained in the internal buffers.
108  */
109  void redistribute(LevelData<EBCellFAB>& a_coarSolution,
110  const Interval& a_variables);
111 
112  ///
113  bool isDefined() const;
114 
115 protected:
116 
117  //internal use only
118  void setDefaultValues();
119  void defineDataHolders();
120 
123  int m_nComp;
124  int m_refRat;
126 
127 
128  //input coarse grid
130 
131  //buffers on refineed coarse layout
133 
134  //location of mass sources on refined coarse layout
136 
137 
138  //ebisl of input coar grid
140 
142  //need both of these to facilitate mass-weighted
143  //redistribution
147 
148 private:
149  //For all the usual reasons,
150  //there is no copy constructor for this class.
151  //Neither is there an operator= for this class.
153  {
154  MayDay::Error("invalid operator");
155  }
157  {
158  MayDay::Error("invalid operator");
159  }
160 };
161 
162 #include "NamespaceFooter.H"
163 #endif
LayoutData< BaseIVFAB< VoFStencil > > m_standardStenc
Definition: EBCoarToCoarRedist.H:145
int m_refRat
Definition: EBCoarToCoarRedist.H:124
LayoutData< BaseIVFAB< VoFStencil > > m_volumeStenc
Definition: EBCoarToCoarRedist.H:144
EBISLayout m_ebislCoar
Definition: EBCoarToCoarRedist.H:139
bool m_isDefined
Definition: EBCoarToCoarRedist.H:121
Definition: EBLevelGrid.H:30
LayoutData< IntVectSet > m_setsCoar
Definition: EBCoarToCoarRedist.H:135
LayoutData< BaseIVFAB< VoFStencil > > m_stenCoar
Definition: EBCoarToCoarRedist.H:141
int m_redistRad
Definition: EBCoarToCoarRedist.H:122
void operator=(const EBCoarToCoarRedist &)
Definition: EBCoarToCoarRedist.H:152
Structure for passing component ranges in code.
Definition: Interval.H:23
void define(const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislCoar, const Box &a_domainCoar, const int &a_nref, const int &a_nvar, int a_redistRad=1)
Definition: EBCoarToCoarRedist.H:36
LevelData< EBCellFAB > m_densityCoar
Definition: EBCoarToCoarRedist.H:146
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
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:469
DisjointBoxLayout m_gridsCoar
Definition: EBCoarToCoarRedist.H:129
Definition: DataIndex.H:114
Box m_domainCoar
Definition: EBCoarToCoarRedist.H:125
Definition: EBISLayout.H:39
int m_nComp
Definition: EBCoarToCoarRedist.H:123
LevelData< BaseIVFAB< Real > > m_regsCoar
Definition: EBCoarToCoarRedist.H:132
bool isDefined() const
EBCoarToCoarRedist(const EBCoarToCoarRedist &)
Definition: EBCoarToCoarRedist.H:156
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)