Chombo + EB + MF  3.2
MFStencil.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 #ifndef _MFSTENCIL_H_
12 #define _MFSTENCIL_H_
13 
14 #include "Stencils.H"
15 #include "Vector.H"
16 #include "VolIndex.H"
17 #include "REAL.H"
18 #include "Box.H"
19 #include "FArrayBox.H"
20 #include "EBIndexSpace.H"
21 #include "VolIndex.H"
22 #include "MFCellFAB.H"
23 #include "NamespaceHeader.H"
24 
25 ///
26 /**
27  Simple stencil aggregation for multifluid problems.
28  */
29 class MFStencil
30 {
31 public:
32  /// structure to hold multifluid stencils
33  struct
34  {
35  ///fluid where the answer will go
36  int destFluid;
37  ////vof where answer will go
39  ///one stencil for each fluid
40  VoFStencil stenFluid[2];
41  } typedef agg_t;
42 
43  ///
44  /**
45  Destructor
46  */
48  {;}
49 
50 
51 
52  ///
53  /**
54  pointSten is the stencil at each irregular cell
55  gridBox is the box from the disjointboxlayout
56  vectEBISBox[0] is the ebisbox from fluid 0
57  vectEBISBox[1] is the ebisbox from fluid 1
58  ghostVectLph is the ghost cells of the destination fab
59  ghostVectPhi is the ghost cells of the input (phi) fab
60  vardest is the variable location where data will be put
61  lphi[ifluid](vof, vardest) = blah blah
62  */
63  MFStencil(const Vector<agg_t>& a_pointSten,
64  const Box& a_gridBox,
65  const Vector<EBISBox>& a_vectEBISBox,
66  const IntVect& a_ghostVectLph,
67  const IntVect& a_ghostVectPhi,
68  int a_varDest);
69 
70 
71  ///
72  /**
73  Applies stencil to each component of phi using the stencil weights and offsets to compute L.
74  If incrementOnly = true, a_lofphi is incremented without any set to zero.
75  If false, a_lofphi is set to zero and set equal to L(phi).
76  */
77  void apply(MFCellFAB& a_lofphi, const MFCellFAB& a_phi, bool incrementOnly = false) const;
78 
79 
80 
81  ///
82  /**
83  Cache lphi from inputs into internal storage.
84  */
85  void cache(const MFCellFAB& a_lphi) const;
86 
87  ///
88  /**
89  uncache lphi from internal storage into the input data holder.
90  */
91  void uncache(MFCellFAB& a_lphi) const;
92 
93 
94  protected:
95 
96  void computeOffsets(const Vector<agg_t>& a_stencil);
97 
98  struct
99  {
100  int fluidid;
101  int offset;
103  } typedef destTerm_t;
104 
105  struct
106  {
107  int fluidid;
108  int offset;
110  //only used when debugging
111  //VolIndex vof;
112  } typedef stencilTerm;
113 
114  struct
115  {
118  } typedef ebstencil_t;
119 
120 
128 
132 
133  //only used when debugging
134  //Vector<agg_t> m_srcVoFs;
135 private:
136  ///
137  /*
138  Default constructor.
139  */
141  {
142  MayDay::Error("invalid operator");
143  }
144 
145  ///
146  /*
147  Operator =.
148  */
149  void
150  operator=(const MFStencil& stenin)
151  {
152  MayDay::Error("invalid operator");
153  }
154 
155  ///
156  /*
157  Copy constructor.
158  */
159  MFStencil(const MFStencil& stenin)
160  {
161  MayDay::Error("invalid operator");
162  }
163 
164 };
165 
166 
167 #include "NamespaceFooter.H"
168 #endif
Definition: MFCellFAB.H:22
EBISBox m_ebisBox[2]
Definition: MFStencil.H:122
MFStencil()
Definition: MFStencil.H:140
Real weight
Definition: MFStencil.H:109
Vector< stencilTerm > single
Definition: MFStencil.H:116
Box m_lphBox
Definition: MFStencil.H:123
one dimensional dynamic array
Definition: Vector.H:53
int offset
Definition: MFStencil.H:101
VolIndex destVoF
Definition: MFStencil.H:38
void operator=(const MFStencil &stenin)
Definition: MFStencil.H:150
int m_destVar
Definition: MFStencil.H:127
Definition: EBISBox.H:46
int destFluid
fluid where the answer will go
Definition: MFStencil.H:36
IntVect m_ghostVectPhi
Definition: MFStencil.H:125
VoF-centered stencil.
Definition: Stencils.H:60
structure to hold multifluid stencils
Definition: MFStencil.H:33
bool multiValued
Definition: MFStencil.H:102
Vector< Real > m_cache
Definition: MFStencil.H:131
Definition: MFStencil.H:29
Vector< ebstencil_t > m_ebstencil
Definition: MFStencil.H:129
int fluidid
Definition: MFStencil.H:107
double Real
Definition: REAL.H:33
int offset
Definition: MFStencil.H:108
Box m_phiBox
Definition: MFStencil.H:124
Box m_grid
Definition: MFStencil.H:121
Vector< destTerm_t > m_destTerms
Definition: MFStencil.H:130
void computeOffsets(const Vector< agg_t > &a_stencil)
void uncache(MFCellFAB &a_lphi) const
Definition: MFStencil.H:105
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 fluidid
Definition: MFStencil.H:100
~MFStencil()
Definition: MFStencil.H:47
void apply(MFCellFAB &a_lofphi, const MFCellFAB &a_phi, bool incrementOnly=false) const
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Definition: MFStencil.H:98
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
IntVect m_ghostVectLph
Definition: MFStencil.H:126
void cache(const MFCellFAB &a_lphi) const
Volume of Fluid Index.
Definition: VolIndex.H:31
MFStencil(const MFStencil &stenin)
Definition: MFStencil.H:159
Definition: MFStencil.H:114
Vector< stencilTerm > multi
Definition: MFStencil.H:117