Chombo + EB + MF  3.2
EBCoarToFineRedist.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-02-2001
12 
13 #ifndef _EBCOARTOFINEREDIST_H_
14 #define _EBCOARTOFINEREDIST_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 class EBIndexSpace;
30 
31 /// Coarse to fine redistribution class.
32 /**
33  Coarse to fine redistribution class.
34  */
36 {
37 public:
38 
39  friend class EBFluxRegister;
40 
41  ///
42  /**
43  Default constructor. Leaves object undefined.
44  */
46 
47  ///
49 
50  ///
51  /**
52  Initialize values of registers to zero.
53  */
54  void setToZero();
55 
56  ///
57  /**
58  Increments the register with data from coarseMass.
59  This is the full redistribution mass. Internally
60  the class figures out what actually goes to the
61  fine level.
62  */
63  void increment(const BaseIVFAB<Real>& a_coarseMass,
64  const DataIndex& a_coarseDataIndex,
65  const Interval& a_variables);
66 
67  ///
68  /**
69  Redistribute the data contained in the internal buffers.
70  */
71  void redistribute(LevelData<EBCellFAB>& a_fineSolution,
72  const Interval& a_variables);
73 
74  ///
75  bool isDefined() const;
76 
77  /// ugly but general define fcn
78  /**
79  Full define function.
80  Define the stencils with volume weights.
81  If you want mass weights or whatever,
82  use reset weights.
83  */
84  void define(const DisjointBoxLayout& a_dblFine,
85  const DisjointBoxLayout& a_dblCoar,
86  const EBISLayout& a_ebislCoar,
87  const Box& a_domainCoar,
88  const int& a_nref,
89  const int& a_nvar,
90  int redistRad,
91  const EBIndexSpace* ebisPtr);
92 
93  ///
94  /**
95  Interface that uses EBLevelGrid potentially can be
96  much faster when the number of boxes gets large.
97  */
98  void define(const EBLevelGrid& a_eblgFine,
99  const EBLevelGrid& a_eblgCoar,
100  const int& a_nref,
101  const int& a_nvar,
102  const int& a_redistRad);
103 
104 
105  ///
106  /**
107  */
108  void
109  resetWeights(const LevelData<EBCellFAB>& a_modifierCoar,
110  const int& a_ivar);
111 protected:
112 
113  //internal use only
114  void setDefaultValues();
115  void defineDataHolders();
116 
119  int m_nComp;
120  int m_refRat;
122 
123  //input fine grid
125  //input coarse grid
127  //input coarse grid
128  //CedFine is short for coarsenedfine
130 
133 
135 
137  //need both of these to accomodate reweighting the stencil
140 
143 
144  //ebisl of input fine grid
145  //EBISLayout m_ebislFine;
146  //ebisl of input coar grid
148  //ebisl of coarsened fine layout
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 #include "NamespaceFooter.H"
165 #endif
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 redistRad, const EBIndexSpace *ebisPtr)
ugly but general define fcn
bool m_isDefined
Definition: EBCoarToFineRedist.H:117
EBISLayout m_ebislCedFine
Definition: EBCoarToFineRedist.H:149
int m_refRat
Definition: EBCoarToFineRedist.H:120
LevelData< EBCellFAB > m_densityCedFine
Definition: EBCoarToFineRedist.H:134
Definition: EBIndexSpace.H:50
EBCoarToFineRedist(const EBCoarToFineRedist &)
Definition: EBCoarToFineRedist.H:159
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
Definition: EBLevelGrid.H:30
void resetWeights(const LevelData< EBCellFAB > &a_modifierCoar, const int &a_ivar)
Coarse to fine redistribution class.
Definition: EBCoarToFineRedist.H:35
LayoutData< BaseIVFAB< VoFStencil > > m_standardStenc
Definition: EBCoarToFineRedist.H:139
DisjointBoxLayout m_gridsCedFine
Definition: EBCoarToFineRedist.H:129
DisjointBoxLayout m_gridsCoar
Definition: EBCoarToFineRedist.H:126
LayoutData< BaseIVFAB< VoFStencil > > m_stenCedFine
Definition: EBCoarToFineRedist.H:136
Structure for passing component ranges in code.
Definition: Interval.H:23
Box m_domainCoar
Definition: EBCoarToFineRedist.H:121
LayoutData< BaseIVFAB< VoFStencil > > m_volumeStenc
Definition: EBCoarToFineRedist.H:138
void operator=(const EBCoarToFineRedist &)
Definition: EBCoarToFineRedist.H:155
void increment(const BaseIVFAB< Real > &a_coarseMass, const DataIndex &a_coarseDataIndex, const Interval &a_variables)
LevelData< BaseIVFAB< Real > > m_regsCedFine
Definition: EBCoarToFineRedist.H:132
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
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.
int m_redistRad
Definition: EBCoarToFineRedist.H:118
LayoutData< IntVectSet > m_setsCoar
Definition: EBCoarToFineRedist.H:142
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Definition: DataIndex.H:114
bool isDefined() const
LevelData< BaseIVFAB< Real > > m_regsCoar
Definition: EBCoarToFineRedist.H:131
LayoutData< IntVectSet > m_setsCedFine
Definition: EBCoarToFineRedist.H:141
DisjointBoxLayout m_gridsFine
Definition: EBCoarToFineRedist.H:124
EBISLayout m_ebislCoar
Definition: EBCoarToFineRedist.H:147
Definition: EBISLayout.H:39
void redistribute(LevelData< EBCellFAB > &a_fineSolution, const Interval &a_variables)
int m_nComp
Definition: EBCoarToFineRedist.H:119
EBFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: EBFluxRegister.H:37