Chombo + EB  3.2
EBConductivityOpFactory.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 _EBCONDUCTIVITYOPFACTORY_H_
12 #define _EBCONDUCTIVITYOPFACTORY_H_
13 
14 #include "REAL.H"
15 #include "Box.H"
16 #include "FArrayBox.H"
17 #include "Vector.H"
18 #include <map>
19 #include "RefCountedPtr.H"
20 
21 #include "AMRMultiGrid.H"
22 
23 #include "EBIndexSpace.H"
24 #include "EBCellFAB.H"
25 #include "EBCellFactory.H"
26 #include "EBConductivityOp.H"
27 #include "EBLevelDataOps.H"
28 #include "BaseEBBC.H"
29 #include "BaseDomainBC.H"
30 #include "CFIVS.H"
31 #include "EBFluxRegister.H"
32 #include "EBMGAverage.H"
33 #include "EBMGInterp.H"
34 #include "EBCoarsen.H"
35 #include "PolyGeom.H"
36 #include "EBAMRPoissonOp.H"
37 #include "EBLevelGrid.H"
38 #include "NamespaceHeader.H"
39 
40 
41 //! \class EBConductivityOpFactory
42 //! Factory class to generate EBConductivityOps. This follows the
43 //! AMRLevelOpFactory interface.
44 class EBConductivityOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
45 {
46 public:
47 
48  //! Constructs a factory that builds EBConductivityOps with time-independent
49  //! A and B coefficients.
51  const Vector<RefCountedPtr<EBQuadCFInterp> >& a_quadCFI,
52  const Real& a_alpha,
53  const Real & a_beta,
54  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
55  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
56  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
57  const Real& a_dxCoarse,
58  const Vector<int>& a_refRatio,
59  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
60  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
61  const IntVect& a_ghostCellsPhi,
62  const IntVect& a_ghostCellsRhs,
63  const int& a_relaxType,
64  int a_numLevels = -1);
65 
66 
67  //! Destructor.
68  virtual ~EBConductivityOpFactory();
69 
70  ///
71  virtual void setData( Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_data)
72  {
73  m_data = a_data;
74  m_dataBased = true;
75  }
76 
77  ///
78  virtual EBConductivityOp*
79  MGnewOp(const ProblemDomain& a_FineindexSpace,
80  int a_depth,
81  bool a_homoOnly = true);
82 
83  EBConductivityOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
84  const EBLevelGrid& a_eblgCoarMG,
85  const bool& a_hasMGObjects,
86  const RealVect& a_dxMGLevel,
87  const RealVect& a_dxCoar,
88  const int& a_whichLevel);
89  ///
90  virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
91 
92  ///
93  virtual EBConductivityOp*
94  AMRnewOp(const ProblemDomain& a_FineindexSpace);
95 
96  ///
97  virtual void AMRreclaim(EBConductivityOp* a_reclaim);
98 
99  ///
100  /** Refinement ratio between this level and coarser level.
101  Returns 1 when there are no coarser AMRLevelOp objects */
102  virtual int refToFiner(const ProblemDomain& a_domain) const;
103 
104  ///
105  /**
106  testRef is the size of the coarsest domain allowed in multigrid. If testRef=2,
107  then the coarsest domain in multigrid will be 2x2(x2)
108  **/
109  static void setTestRef(int a_testRef)
110  {
111  s_testRef = a_testRef;
112  }
113 
114  static void setMaxBoxSize(int a_maxBoxSize)
115  {
116  s_maxBoxSize = a_maxBoxSize;
117  }
118 
119  static int s_testRef;
120  static int s_maxBoxSize;
121 
122  //! Reset the coefficients for the conductivity operator (time-independent).
123  void resetCoefficients(const Real& a_alpha,
124  const Real & a_beta,
125  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
126  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
127  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
128  {
129  m_alpha = a_alpha ;
130  m_beta = a_beta ;
131  m_acoef = a_acoef ;
132  m_bcoef = a_bcoef ;
133  m_bcoefIrreg = a_bcoefIrreg ;
134  }
135 
136 
137 protected:
138 
142 
143  //! Time-independent A multigrid coefficients
145 
146  //! Beginning-of-step (time-dependent) A multigrid coefficients
148 
149  //! End-of-step (time-dependent) A multigrid coefficients
151 
154 
160 
161  //! Time-independent A coefficients.
163 
164 
174  std::vector< bool > m_hasMGObjects;
176 private:
177  ///weak construction bad
179  {
180  MayDay::Error("invalid operator");
181  }
182 
183  //copy constructor and operator= disallowed for all the usual reasons
185  {
186  MayDay::Error("invalid operator");
187  }
188 
189  //copy constructor and operator= disallowed for all the usual reasons
190  void operator=(const EBConductivityOpFactory& a_opin)
191  {
192  MayDay::Error("invalid operator");
193  }
194 };
195 
196 #include "NamespaceFooter.H"
197 #endif
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG
Time-independent A multigrid coefficients.
Definition: EBConductivityOpFactory.H:144
void resetCoefficients(const Real &a_alpha, const Real &a_beta, const Vector< RefCountedPtr< LevelData< EBCellFAB > > > &a_acoef, const Vector< RefCountedPtr< LevelData< EBFluxFAB > > > &a_bcoef, const Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_bcoefIrreg)
Reset the coefficients for the conductivity operator (time-independent).
Definition: EBConductivityOpFactory.H:123
Vector< Real > m_dx
Definition: EBConductivityOpFactory.H:175
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG0
Beginning-of-step (time-dependent) A multigrid coefficients.
Definition: EBConductivityOpFactory.H:147
static int s_maxBoxSize
Definition: EBConductivityOpFactory.H:120
Definition: EBLevelGrid.H:30
IntVect m_ghostCellsRhs
Definition: EBConductivityOpFactory.H:172
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_bcoefIrregMG
Definition: EBConductivityOpFactory.H:153
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
static void setTestRef(int a_testRef)
Definition: EBConductivityOpFactory.H:109
virtual EBConductivityOp * MGnewOp(const ProblemDomain &a_FineindexSpace, int a_depth, bool a_homoOnly=true)
Definition: EBConductivityOpFactory.H:44
Real m_dxCoarse
Definition: EBConductivityOpFactory.H:167
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_data
Definition: EBConductivityOpFactory.H:139
void operator=(const EBConductivityOpFactory &a_opin)
Definition: EBConductivityOpFactory.H:190
virtual int refToFiner(const ProblemDomain &a_domain) const
Vector< EBLevelGrid > m_eblgs
Definition: EBConductivityOpFactory.H:156
virtual EBConductivityOp * AMRnewOp(const ProblemDomain &a_FineindexSpace)
static int s_testRef
Definition: EBConductivityOpFactory.H:119
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_bcoef
Definition: EBConductivityOpFactory.H:165
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_bcoefMG
Definition: EBConductivityOpFactory.H:152
static void setMaxBoxSize(int a_maxBoxSize)
Definition: EBConductivityOpFactory.H:114
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
EBConductivityOpFactory(const EBConductivityOpFactory &a_opin)
Definition: EBConductivityOpFactory.H:184
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.
Real m_alpha
Definition: EBConductivityOpFactory.H:158
std::vector< bool > m_hasMGObjects
Definition: EBConductivityOpFactory.H:174
Definition: EBConductivityOp.H:62
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG1
End-of-step (time-dependent) A multigrid coefficients.
Definition: EBConductivityOpFactory.H:150
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void setData(Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_data)
Definition: EBConductivityOpFactory.H:71
IntVect m_ghostCellsPhi
Definition: EBConductivityOpFactory.H:171
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_bcoefIrreg
Definition: EBConductivityOpFactory.H:166
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: EBConductivityOpFactory.H:141
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Vector< int > m_refRatio
Definition: EBConductivityOpFactory.H:168
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: EBConductivityOpFactory.H:170
virtual void AMRreclaim(EBConductivityOp *a_reclaim)
EBConductivityOp * createOperator(const EBLevelGrid &a_eblgMGLevel, const EBLevelGrid &a_eblgCoarMG, const bool &a_hasMGObjects, const RealVect &a_dxMGLevel, const RealVect &a_dxCoar, const int &a_whichLevel)
int m_relaxType
Definition: EBConductivityOpFactory.H:155
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Time-independent A coefficients.
Definition: EBConductivityOpFactory.H:162
int m_numLevels
Definition: EBConductivityOpFactory.H:173
EBConductivityOpFactory()
weak construction bad
Definition: EBConductivityOpFactory.H:178
Definition: AMRMultiGrid.H:233
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: EBConductivityOpFactory.H:169
bool m_dataBased
Definition: EBConductivityOpFactory.H:140
Vector< RefCountedPtr< EBQuadCFInterp > > m_quadCFI
Definition: EBConductivityOpFactory.H:157
virtual ~EBConductivityOpFactory()
Destructor.
Real m_beta
Definition: EBConductivityOpFactory.H:159