Chombo + EB  3.2
VCAggStencil.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 _VCAGGSTENCIL_H_
12 #define _VCAGGSTENCIL_H_
13 
14 #include "Stencils.H"
15 #include "BaseIndex.H"
16 #include "Vector.H"
17 #include "REAL.H"
18 #include "CH_Timer.H"
19 #include "EBCellFAB.H"
20 #include "EBArith.H"
21 #include "RefCountedPtr.H"
22 #include "AggStencil.H"
23 #include "NamespaceHeader.H"
24 
25 ///
26 /**
27  specialization of aggstencil for
28  variable coefficient elliptic operators.
29  Real* dataPtr(int dataType, int ivar);
30 
31  sten_t classes need the following functions
32  srcIndex_t index(int isten)
33  Real weight(int isten)
34  */
35 
36 class VCAggStencil: public AggStencil<EBCellFAB, EBCellFAB>
37 {
38 public:
39  ///
40  /**
41  a_dstIndex is where the answers will go.
42  a_srcStencil is the stencil into the src data
43  a_phiData is to provide offsets for source data (can be a dummy but must be the right size)
44  a_rhsData is to provide offsets for destin data (can be a dummy but must be the right size)
45  ncomp is the number of components in the cache
46  rhsData and phiData can have the wrong number of comps
47  */
49  const Vector<RefCountedPtr<BaseStencil> >& a_stencil,
50  const EBCellFAB & a_phiData,
51  const EBCellFAB & a_rhsData,
52  const EBCellFAB & a_relCoef,
53  const BaseIVFAB<Real> & a_alphaDiagWeight,
54  const int & a_ncomp);
55 
56  ///
57  virtual ~VCAggStencil()
58  {
59  }
60 
61  ///
62  virtual void cachePhi(const EBCellFAB& a_phi) const;
63 
64  ///
65  virtual void uncachePhi( EBCellFAB& a_phi) const;
66 
67  ///
68  /**
69  for the given color
70  phi := phi + relcoef*(lphi - rhs)
71  where lphi = alpha*alphadiagweight*phi + beta*divF
72  where divF is given by the input stencil above
73  */
74  virtual void relax(EBCellFAB & a_phi,
75  const EBCellFAB & a_rhs,
76  const EBCellFAB & a_relCoef,
77  const BaseIVFAB<Real> & a_alphaDiagWeight,
78  const Real & a_alpha,
79  const Real & a_beta,
80  const int & a_varDest,
81  const IntVect & a_color);
82 
83  ///
84  /**
85  lphi = alpha*alphadiagweight*phi + beta*divF
86  where divF is given by the input stencil above
87  */
88  ///
89  virtual void apply(EBCellFAB & a_lphi,
90  const EBCellFAB & a_phi,
91  const BaseIVFAB<Real> & a_alphaDiagWeight,
92  const Real & a_alpha,
93  const Real & a_beta,
94  const int & a_varDest,
95  const bool & a_incrmentOnly);
96 
97 protected:
99  int m_destVar;
102 
104 
107 
108 private:
109  /// disallowed operators. Without code because Jeffster says that is better.
110 
111  ///weak construction is bad.
112  VCAggStencil();
113 
114  ///deep copy for this object would kill performance
115  VCAggStencil& operator=(const VCAggStencil& stenin);
116 
117  ///no reason to allow this one either.
118  VCAggStencil(const VCAggStencil& stenin);
119 
120 };
121 
122 #include "NamespaceFooter.H"
123 #endif
int m_destVar
Definition: VCAggStencil.H:99
Vector< IntVect > m_destIV
Definition: VCAggStencil.H:105
virtual void cachePhi(const EBCellFAB &a_phi) const
virtual void relax(EBCellFAB &a_phi, const EBCellFAB &a_rhs, const EBCellFAB &a_relCoef, const BaseIVFAB< Real > &a_alphaDiagWeight, const Real &a_alpha, const Real &a_beta, const int &a_varDest, const IntVect &a_color)
A reference-counting handle class.
Definition: RefCountedPtr.H:173
one dimensional dynamic array
Definition: Vector.H:53
Aggregated stencil.
Definition: AggStencil.H:39
Vector< access_t > m_phiAccess
Definition: VCAggStencil.H:100
Vector< IntVect > m_iv
Definition: VCAggStencil.H:98
Vector< access_t > m_alpAccess
Definition: VCAggStencil.H:103
Vector< Vector< Real > > m_cachePhi
Definition: VCAggStencil.H:106
Definition: EBCellFAB.H:29
VCAggStencil()
disallowed operators. Without code because Jeffster says that is better.
double Real
Definition: REAL.H:33
virtual void apply(EBCellFAB &a_lphi, const EBCellFAB &a_phi, const BaseIVFAB< Real > &a_alphaDiagWeight, const Real &a_alpha, const Real &a_beta, const int &a_varDest, const bool &a_incrmentOnly)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Vector< access_t > m_relAccess
Definition: VCAggStencil.H:101
virtual ~VCAggStencil()
Definition: VCAggStencil.H:57
Definition: VCAggStencil.H:36
VCAggStencil & operator=(const VCAggStencil &stenin)
deep copy for this object would kill performance
virtual void uncachePhi(EBCellFAB &a_phi) const