Chombo + EB  3.2
RedistStencil.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 weds oct 3 2001
12 
13 #ifndef _REDISTSTENCIL_H_
14 #define _REDISTSTENCIL_H_
15 
16 #include "REAL.H"
17 #include "FArrayBox.H"
18 #include "LevelData.H"
19 #include "DisjointBoxLayout.H"
20 #include "EBISLayout.H"
21 #include "EBCellFAB.H"
22 #include "Interval.H"
23 #include "Stencils.H"
24 #include "BaseIVFAB.H"
25 
26 #include "NamespaceHeader.H"
27 
28 // This is temporary to test some things about redistribution.
29 extern bool g_alwaysRedist;
30 
31 /// stencil for mass redistribution
32 /**
33  The RedistStencil class holds the stencil for mass redistribution
34  at every irregular VoF in a layout. The default weights
35  that the stencil holds are volume weights. The class
36  does allow the flexibility to redefine these weights.
37  */
39 {
40 public:
41  ///
42  /**
43  Default constructor. User must subsequently call define().
44  */
45  RedistStencil();
46 
47  ///
49 
50  ///
51  /**
52  Defining constructor. Constructs a valid object.
53  Equivalent to default construction followed by define().
54  ebisl needs ghost cells out to 3*redistradius
55  */
56  RedistStencil(const DisjointBoxLayout& a_dbl,
57  const EBISLayout& a_ebisl,
58  const ProblemDomain& a_domain,
59  const int& a_redistRadius);
60 
61  ///
62  /**
63  Defines this object. Existing information is overriden.
64  ebisl needs ghost cells out to 3*redistradius
65  */
66  void define(const DisjointBoxLayout& a_dbl,
67  const EBISLayout& a_ebisl,
68  const ProblemDomain& a_domain,
69  const int& a_redistRadius,
70  bool a_do2DStencil = false);
71 
72  ///
73  /**
74  Returns true if this object was created with the defining
75  constructor or if define() has been called.
76  */
77  bool isDefined() const;
78 
79  ///
80  /**
81  Modify the weights in the stencil by multiplying by
82  the inputs in a normalized way.
83  If you want mass
84  weighting, send in the density.
85  */
86  void resetWeights(const LevelData<EBCellFAB>& a_modifier,
87  const int& a_ivar);
88 
89  ///
90  /**
91  Returns the redistribution stencil at every irregular
92  point in input Box associated with this DataIndex.
93  */
95  operator[](const DataIndex& datInd) const;
96 
97  ///
98  /**
99  This copy operation detaches copier from copyee.
100  */
101  void deepCopy(const RedistStencil& a_stenin);
102 
103  ///
104  /**
105  */
106  int getRedistRadius() const;
107 
108 protected:
109 
112 
114 
116 
118 
122 
124 
125 private:
126  //internal use
127  void computePointStencil(VoFStencil& a_stencil,
128  const VolIndex& a_srcVoF,
129  const DataIndex& a_datInd,
130  const bool& a_do2DStencil);
131 
132  //disallowed for all the usual reasons
134  {
135  MayDay::Error("rdsi 2 invalid operator");
136  }
137  void operator=(const RedistStencil& fabin)
138  {
139  MayDay::Error("rdsi 3 invalid operator");
140  }
141 };
142 
143 #include "NamespaceFooter.H"
144 
145 #endif
bool m_alwaysRedist
Definition: RedistStencil.H:121
const BaseIVFAB< VoFStencil > & operator[](const DataIndex &datInd) const
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
bool isDefined() const
LayoutData< BaseIVFAB< VoFStencil > > m_volsten
Definition: RedistStencil.H:111
bool m_hasDefaultWeights
Definition: RedistStencil.H:120
bool g_alwaysRedist
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
VoF-centered stencil.
Definition: Stencils.H:60
RedistStencil(const RedistStencil &ebcin)
Definition: RedistStencil.H:133
int getRedistRadius() const
void define(const DisjointBoxLayout &a_dbl, const EBISLayout &a_ebisl, const ProblemDomain &a_domain, const int &a_redistRadius, bool a_do2DStencil=false)
void operator=(const RedistStencil &fabin)
Definition: RedistStencil.H:137
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
int m_redistRadius
Definition: RedistStencil.H:123
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.
bool m_isDefined
Definition: RedistStencil.H:119
void deepCopy(const RedistStencil &a_stenin)
LayoutData< BaseIVFAB< VoFStencil > > m_stencil
Definition: RedistStencil.H:110
Definition: DataIndex.H:112
stencil for mass redistribution
Definition: RedistStencil.H:38
void resetWeights(const LevelData< EBCellFAB > &a_modifier, const int &a_ivar)
void computePointStencil(VoFStencil &a_stencil, const VolIndex &a_srcVoF, const DataIndex &a_datInd, const bool &a_do2DStencil)
Volume of Fluid Index.
Definition: VolIndex.H:31
Definition: EBISLayout.H:39
EBISLayout m_ebisl
Definition: RedistStencil.H:117
ProblemDomain m_domain
Definition: RedistStencil.H:115
Definition: BaseIVFAB.H:32
DisjointBoxLayout m_grids
Definition: RedistStencil.H:113