Chombo + EB  3.0
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_ebislFine,
87  const EBISLayout& a_ebislCoar,
88  const Box& a_domainCoar,
89  const int& a_nref,
90  const int& a_nvar,
91  int redistRad,
92  const EBIndexSpace* ebisPtr);
93 
94  ///
95  /**
96  Interface that uses EBLevelGrid potentially can be
97  much faster when the number of boxes gets large.
98  */
99  void define(const EBLevelGrid& a_eblgFine,
100  const EBLevelGrid& a_eblgCoar,
101  const int& a_nref,
102  const int& a_nvar,
103  const int& a_redistRad);
104 
105 
106  ///
107  /**
108  */
109  void
110  resetWeights(const LevelData<EBCellFAB>& a_modifierCoar,
111  const int& a_ivar);
112 protected:
113 
114  //internal use only
115  void setDefaultValues();
116  void defineDataHolders();
117 
120  int m_nComp;
121  int m_refRat;
123 
124  //input fine grid
126  //input coarse grid
128  //input coarse grid
129  //CedFine is short for coarsenedfine
131 
134 
136 
138  //need both of these to accomodate reweighting the stencil
141 
144 
145  //ebisl of input fine grid
147  //ebisl of input coar grid
149  //ebisl of coarsened fine layout
151 
152 private:
153  //For all the usual reasons,
154  //there is no copy constructor for this class.
155  //Neither is there an operator= for this class.
157  {
158  MayDay::Error("invalid operator");
159  }
161  {
162  MayDay::Error("invalid operator");
163  }
164 };
165 #include "NamespaceFooter.H"
166 #endif
bool m_isDefined
Definition: EBCoarToFineRedist.H:118
EBISLayout m_ebislFine
Definition: EBCoarToFineRedist.H:146
EBISLayout m_ebislCedFine
Definition: EBCoarToFineRedist.H:150
int m_refRat
Definition: EBCoarToFineRedist.H:121
LevelData< EBCellFAB > m_densityCedFine
Definition: EBCoarToFineRedist.H:135
Definition: EBIndexSpace.H:260
EBCoarToFineRedist(const EBCoarToFineRedist &)
Definition: EBCoarToFineRedist.H:160
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 redistRad, const EBIndexSpace *ebisPtr)
ugly but general define fcn
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: LayoutData.H:46
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:140
DisjointBoxLayout m_gridsCedFine
Definition: EBCoarToFineRedist.H:130
DisjointBoxLayout m_gridsCoar
Definition: EBCoarToFineRedist.H:127
LayoutData< BaseIVFAB< VoFStencil > > m_stenCedFine
Definition: EBCoarToFineRedist.H:137
Structure for passing component ranges in code.
Definition: Interval.H:23
Box m_domainCoar
Definition: EBCoarToFineRedist.H:122
LayoutData< BaseIVFAB< VoFStencil > > m_volumeStenc
Definition: EBCoarToFineRedist.H:139
void operator=(const EBCoarToFineRedist &)
Definition: EBCoarToFineRedist.H:156
void increment(const BaseIVFAB< Real > &a_coarseMass, const DataIndex &a_coarseDataIndex, const Interval &a_variables)
LevelData< BaseIVFAB< Real > > m_regsCedFine
Definition: EBCoarToFineRedist.H:133
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.
int m_redistRad
Definition: EBCoarToFineRedist.H:119
LayoutData< IntVectSet > m_setsCoar
Definition: EBCoarToFineRedist.H:143
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Definition: DataIndex.H:112
LevelData< BaseIVFAB< Real > > m_regsCoar
Definition: EBCoarToFineRedist.H:132
LayoutData< IntVectSet > m_setsCedFine
Definition: EBCoarToFineRedist.H:142
bool isDefined() const
DisjointBoxLayout m_gridsFine
Definition: EBCoarToFineRedist.H:125
EBISLayout m_ebislCoar
Definition: EBCoarToFineRedist.H:148
Definition: EBISLayout.H:39
void redistribute(LevelData< EBCellFAB > &a_fineSolution, const Interval &a_variables)
int m_nComp
Definition: EBCoarToFineRedist.H:120
EBFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: EBFluxRegister.H:37