Chombo + EB  3.2
slowEBCOFactory.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 _SLOWEBCOFACTORY_H_
12 #define _SLOWEBCOFACTORY_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 "slowEBCO.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 ///
42 /**
43  Factory class to generate slowEBCOs. This follows the AMRLevelOpFactory interface.
44 */
45 class slowEBCOFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
46 {
47 public:
48 
49  ///
50  virtual ~slowEBCOFactory();
51 
52  ///
53  /**
54  */
55  slowEBCOFactory(const Vector<EBLevelGrid>& a_eblgs,
56  const Vector<RefCountedPtr<EBQuadCFInterp> >& a_quadCFI,
57  const Real& a_alpha,
58  const Real & a_beta,
59  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
60  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
61  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
62  const Real& a_dxCoarse,
63  const Vector<int>& a_refRatio,
64  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
65  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
66  const IntVect& a_ghostCellsPhi,
67  const IntVect& a_ghostCellsRhs,
68  const int& a_relaxType,
69  int a_numLevels = -1);
70 
71  ///
72  virtual slowEBCO*
73  MGnewOp(const ProblemDomain& a_FineindexSpace,
74  int a_depth,
75  bool a_homoOnly = true);
76 
77  slowEBCO* createOperator(const EBLevelGrid& a_eblgMGLevel,
78  const EBLevelGrid& a_eblgCoarMG,
79  const bool& a_hasMGObjects,
80  const RealVect& a_dxMGLevel,
81  const RealVect& a_dxCoar,
82  const int& a_whichLevel);
83  ///
84  virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
85 
86  ///
87  virtual slowEBCO*
88  AMRnewOp(const ProblemDomain& a_FineindexSpace);
89 
90  ///
91  virtual void AMRreclaim(slowEBCO* a_reclaim);
92 
93  ///
94  /** Refinement ratio between this level and coarser level.
95  Returns 1 when there are no coarser AMRLevelOp objects */
96  virtual int refToFiner(const ProblemDomain& a_domain) const;
97 
98 
99  void resetCoefficients(const Real& a_alpha,
100  const Real & a_beta,
101  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
102  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
103  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
104  {
105  m_alpha = a_alpha ;
106  m_beta = a_beta ;
107  m_acoef = a_acoef ;
108  m_bcoef = a_bcoef ;
109  m_bcoefIrreg = a_bcoefIrreg ;
110  }
111 
112 protected:
113 
118 
134  std::vector< bool > m_hasMGObjects;
136 private:
137  ///weak construction bad
139  {
140  MayDay::Error("invalid operator");
141  }
142 
143  //copy constructor and operator= disallowed for all the usual reasons
145  {
146  MayDay::Error("invalid operator");
147  }
148 
149  //copy constructor and operator= disallowed for all the usual reasons
150  void operator=(const slowEBCOFactory& a_opin)
151  {
152  MayDay::Error("invalid operator");
153  }
154 };
155 
156 #include "NamespaceFooter.H"
157 #endif
slowEBCO * 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: slowEBCOFactory.H:119
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_bcoefIrreg
Definition: slowEBCOFactory.H:126
void operator=(const slowEBCOFactory &a_opin)
Definition: slowEBCOFactory.H:150
Definition: slowEBCO.H:49
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
virtual slowEBCO * AMRnewOp(const ProblemDomain &a_FineindexSpace)
IntVect m_ghostCellsPhi
Definition: slowEBCOFactory.H:131
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_bcoefMG
Definition: slowEBCOFactory.H:116
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Definition: slowEBCOFactory.H:124
virtual void AMRreclaim(slowEBCO *a_reclaim)
Real m_beta
Definition: slowEBCOFactory.H:123
Definition: slowEBCOFactory.H:45
Definition: EBLevelGrid.H:30
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)
Definition: slowEBCOFactory.H:99
int m_numLevels
Definition: slowEBCOFactory.H:133
Vector< Real > m_dx
Definition: slowEBCOFactory.H:135
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_bcoefIrregMG
Definition: slowEBCOFactory.H:117
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: slowEBCOFactory.H:114
virtual ~slowEBCOFactory()
Vector< int > m_refRatio
Definition: slowEBCOFactory.H:128
virtual int refToFiner(const ProblemDomain &a_domain) const
slowEBCOFactory(const slowEBCOFactory &a_opin)
Definition: slowEBCOFactory.H:144
Real m_alpha
Definition: slowEBCOFactory.H:122
slowEBCOFactory()
weak construction bad
Definition: slowEBCOFactory.H:138
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.
virtual slowEBCO * MGnewOp(const ProblemDomain &a_FineindexSpace, int a_depth, bool a_homoOnly=true)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
std::vector< bool > m_hasMGObjects
Definition: slowEBCOFactory.H:134
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG
Definition: slowEBCOFactory.H:115
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
IntVect m_ghostCellsRhs
Definition: slowEBCOFactory.H:132
Vector< RefCountedPtr< EBQuadCFInterp > > m_quadCFI
Definition: slowEBCOFactory.H:121
Vector< EBLevelGrid > m_eblgs
Definition: slowEBCOFactory.H:120
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: slowEBCOFactory.H:129
Definition: AMRMultiGrid.H:233
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_bcoef
Definition: slowEBCOFactory.H:125
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: slowEBCOFactory.H:130
Real m_dxCoarse
Definition: slowEBCOFactory.H:127