Chombo + EB  3.2
EBStenVarCoef.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 _EBSTENVARCOEF_H_
12 #define _EBSTENVARCOEF_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 "EBCellFAB.H"
22 #include "NamespaceHeader.H"
23 
24 ///
25 /**
26  EBStencil variant specifically for the needs of single-level variable
27  coefficent elliptic operators. There is only one way to make it.
28  Everyone has to have the same number of ghost cells. There is
29  only one way to use it. If you want something more flexible, use
30  EBStencil.
31  */
33 {
34 public:
35  ///
36  /**
37  Destructor
38  */
40  {;}
41 
42  ///
43  /**
44  srcVofs = list of vofs for which the stencil will be applied
45  vofstencil = stencil for the divergence(F)
46  validBox = valid cells (box from the DBL)
47  ghostVect = number of ghost cells (for both phi, L(phi), rho,
48  lambda, everything)
49  ebisbox = geometric information
50  varDest = variable of lphi
51  */
52  EBStenVarCoef(const Vector<VolIndex>& a_srcVofs,
53  const BaseIVFAB<VoFStencil>& a_vofstencil,
54  const Box& a_validBox,
55  const EBISBox& a_ebisbox,
56  const IntVect& a_ghostVect,
57  int a_varDest);
58 
59 
60 
61  ///
62  /**
63  lphi = alpha*alphaWeight*phi + beta*betaWeight*(div(F))
64  The offsets of this object compute divF.
65  lofphi = result
66  phi = phi
67  alphaWeight = variable coefficient factor of the identity term
68  alpha = constant coefficient factor of the identity term
69  betaWeight = variable coefficient factor of the div(F) term
70  beta = constant coefficient factor of the div(F) term
71  */
72  void apply(EBCellFAB& a_lofphi,
73  const EBCellFAB& a_phi,
74  const EBCellFAB& a_alphaWeight,
75  const Real& a_alpha,
76  const EBCellFAB& a_betaWeight,
77  const Real& a_beta);
78 
79 
80  ///
81  /**
82  phi := phi + lambda*(lphi-rhs)
83  where
84  lphi = alpha*alphaWeight*phi + beta*betaWeight*(div(F))
85  The offsets of this object compute divF.
86  lofphi = result
87  phi = phi
88  alphaWeight = variable coefficient factor of the identity term
89  alpha = constant coefficient factor of the identity term
90  betaWeight = variable coefficient factor of the div(F) term
91  beta = constant coefficient factor of the div(F) term
92  lambda = relaxation coefficient
93  */
94  void relax(EBCellFAB& a_phi,
95  const EBCellFAB& a_rhs,
96  const EBCellFAB& a_alphaWeight,
97  const EBCellFAB& a_betaWeight,
98  const EBCellFAB& a_lambda,
99  Real a_alpha, Real a_beta) const;
100 
101  ///
102  /**
103  Cache the irregular values of the input
104  */
105  void cache(const EBCellFAB& a_phi, int ivar);
106 
107  ///
108  /**
109  take values of internal cache and put them into phi
110  */
111  void uncache(EBCellFAB& a_phi, int ivar) const;
112 
113  struct
114  {
115  int offset;
117  } typedef destTerm_t;
118 
119  struct
120  {
121  int offset;
123  //only used when debugging
124  //VolIndex vof;
125  } typedef stencilTerm;
126 
127  struct
128  {
131  } typedef varcsten_t;
132 
133 protected:
134  void computeOffsets(const Vector<VolIndex>& a_srcVoFs, const BaseIVFAB<VoFStencil>& a_vofstencil);
135 
146  //debugging hook
148 private:
149  /// weak construction is bad
151  {
152  MayDay::Error("invalid operator");
153  }
154 
155  /// object contains pointered data. assignment is a bad idea
156  void operator=(const EBStenVarCoef& stenin)
157  {
158  MayDay::Error("invalid operator");
159  }
160 
161  /// object contains pointered data. copy construction is a bad idea
163  {
164  MayDay::Error("invalid operator");
165  }
166 
167 };
168 
169 
170 #include "NamespaceFooter.H"
171 #endif
Box m_box
Definition: EBStenVarCoef.H:136
bool multiValued
Definition: EBStenVarCoef.H:116
EBStenVarCoef()
weak construction is bad
Definition: EBStenVarCoef.H:150
void operator=(const EBStenVarCoef &stenin)
object contains pointered data. assignment is a bad idea
Definition: EBStenVarCoef.H:156
Definition: EBISBox.H:46
Vector< destTerm_t > m_sourTerms
Definition: EBStenVarCoef.H:143
Vector< Real > m_cachePhi
Definition: EBStenVarCoef.H:145
Real weight
Definition: EBStenVarCoef.H:122
Vector< stencilTerm > single
Definition: EBStenVarCoef.H:129
Definition: EBStenVarCoef.H:127
Vector< Real > m_cache
Definition: EBStenVarCoef.H:144
~EBStenVarCoef()
Definition: EBStenVarCoef.H:39
Vector< VolIndex > m_srcVoFs
Definition: EBStenVarCoef.H:147
Definition: EBCellFAB.H:29
double Real
Definition: REAL.H:33
void cache(const EBCellFAB &a_phi, int ivar)
Definition: EBStenVarCoef.H:119
EBISBox m_ebisBox
Definition: EBStenVarCoef.H:137
IntVect m_ghostVect
Definition: EBStenVarCoef.H:139
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 computeOffsets(const Vector< VolIndex > &a_srcVoFs, const BaseIVFAB< VoFStencil > &a_vofstencil)
Box m_grownBox
Definition: EBStenVarCoef.H:138
int offset
Definition: EBStenVarCoef.H:115
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Vector< varcsten_t > m_stencil
Definition: EBStenVarCoef.H:141
void apply(EBCellFAB &a_lofphi, const EBCellFAB &a_phi, const EBCellFAB &a_alphaWeight, const Real &a_alpha, const EBCellFAB &a_betaWeight, const Real &a_beta)
void relax(EBCellFAB &a_phi, const EBCellFAB &a_rhs, const EBCellFAB &a_alphaWeight, const EBCellFAB &a_betaWeight, const EBCellFAB &a_lambda, Real a_alpha, Real a_beta) const
void uncache(EBCellFAB &a_phi, int ivar) const
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: EBStenVarCoef.H:32
EBStenVarCoef(const EBStenVarCoef &stenin)
object contains pointered data. copy construction is a bad idea
Definition: EBStenVarCoef.H:162
Vector< stencilTerm > multi
Definition: EBStenVarCoef.H:130
Definition: EBStenVarCoef.H:113
int offset
Definition: EBStenVarCoef.H:121
Definition: BaseIVFAB.H:32
Vector< destTerm_t > m_destTerms
Definition: EBStenVarCoef.H:142
int m_destVar
Definition: EBStenVarCoef.H:140