Chombo + EB  3.0
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  //! Constructs a factory that builds EBConductivityOps with a time-dependent
67  //! A coefficient and a time-independent B coefficient. The A coefficient
68  //! is interpolated between its beginning-of-step and end-of-step values.
70  const Vector<RefCountedPtr<EBQuadCFInterp> >& a_quadCFI,
71  const Real& a_alpha,
72  const Real & a_beta,
73  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef0,
74  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef1,
75  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
76  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
77  const Real& a_dxCoarse,
78  const Vector<int>& a_refRatio,
79  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
80  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
81  const IntVect& a_ghostCellsPhi,
82  const IntVect& a_ghostCellsRhs,
83  const int& a_relaxType,
84  int a_numLevels = -1);
85 
86  //! Destructor.
87  virtual ~EBConductivityOpFactory();
88 
89  ///
90  virtual void setData( Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_data)
91  {
92  m_data = a_data;
93  m_dataBased = true;
94  }
95 
96  ///
97  virtual EBConductivityOp*
98  MGnewOp(const ProblemDomain& a_FineindexSpace,
99  int a_depth,
100  bool a_homoOnly = true);
101 
102  EBConductivityOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
103  const EBLevelGrid& a_eblgCoarMG,
104  const bool& a_hasMGObjects,
105  const RealVect& a_dxMGLevel,
106  const RealVect& a_dxCoar,
107  const int& a_whichLevel);
108  ///
109  virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
110 
111  ///
112  virtual EBConductivityOp*
113  AMRnewOp(const ProblemDomain& a_FineindexSpace);
114 
115  ///
116  virtual void AMRreclaim(EBConductivityOp* a_reclaim);
117 
118  ///
119  /** Refinement ratio between this level and coarser level.
120  Returns 1 when there are no coarser AMRLevelOp objects */
121  virtual int refToFiner(const ProblemDomain& a_domain) const;
122 
123 
124  //! Reset the coefficients for the conductivity operator (time-independent).
125  void resetCoefficients(const Real& a_alpha,
126  const Real & a_beta,
127  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
128  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
129  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
130  {
131  m_alpha = a_alpha ;
132  m_beta = a_beta ;
133  m_acoef = a_acoef ;
134  m_bcoef = a_bcoef ;
135  m_bcoefIrreg = a_bcoefIrreg ;
136  }
137 
138  //! Reset the coefficients for the conductivity operator (time-dependent A).
139  void resetCoefficients(const Real& a_alpha,
140  const Real & a_beta,
141  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef0,
142  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef1,
143  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
144  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
145  {
146  m_alpha = a_alpha ;
147  m_beta = a_beta ;
148  m_acoef0 = a_acoef0 ;
149  m_acoef1 = a_acoef1 ;
150  m_bcoef = a_bcoef ;
151  m_bcoefIrreg = a_bcoefIrreg ;
152  }
153 
154 protected:
155 
159 
160  //! Time-independent A multigrid coefficients
162 
163  //! Beginning-of-step (time-dependent) A multigrid coefficients
165 
166  //! End-of-step (time-dependent) A multigrid coefficients
168 
171 
177 
178  //! Time-independent A coefficients.
180 
181  //! Beginning-of-step (time-dependent) A coefficients.
183 
184  //! End-of-step (time-dependent) A coefficient.
186 
196  std::vector< bool > m_hasMGObjects;
198 private:
199  ///weak construction bad
201  {
202  MayDay::Error("invalid operator");
203  }
204 
205  //copy constructor and operator= disallowed for all the usual reasons
207  {
208  MayDay::Error("invalid operator");
209  }
210 
211  //copy constructor and operator= disallowed for all the usual reasons
212  void operator=(const EBConductivityOpFactory& a_opin)
213  {
214  MayDay::Error("invalid operator");
215  }
216 };
217 
218 #include "NamespaceFooter.H"
219 #endif
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG
Time-independent A multigrid coefficients.
Definition: EBConductivityOpFactory.H:161
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:125
Vector< Real > m_dx
Definition: EBConductivityOpFactory.H:197
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
void resetCoefficients(const Real &a_alpha, const Real &a_beta, const Vector< RefCountedPtr< LevelData< EBCellFAB > > > &a_acoef0, const Vector< RefCountedPtr< LevelData< EBCellFAB > > > &a_acoef1, const Vector< RefCountedPtr< LevelData< EBFluxFAB > > > &a_bcoef, const Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_bcoefIrreg)
Reset the coefficients for the conductivity operator (time-dependent A).
Definition: EBConductivityOpFactory.H:139
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG0
Beginning-of-step (time-dependent) A multigrid coefficients.
Definition: EBConductivityOpFactory.H:164
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef1
End-of-step (time-dependent) A coefficient.
Definition: EBConductivityOpFactory.H:185
Definition: EBLevelGrid.H:30
IntVect m_ghostCellsRhs
Definition: EBConductivityOpFactory.H:194
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_bcoefIrregMG
Definition: EBConductivityOpFactory.H:170
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef0
Beginning-of-step (time-dependent) A coefficients.
Definition: EBConductivityOpFactory.H:182
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
virtual EBConductivityOp * MGnewOp(const ProblemDomain &a_FineindexSpace, int a_depth, bool a_homoOnly=true)
Definition: EBConductivityOpFactory.H:44
Real m_dxCoarse
Definition: EBConductivityOpFactory.H:189
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_data
Definition: EBConductivityOpFactory.H:156
void operator=(const EBConductivityOpFactory &a_opin)
Definition: EBConductivityOpFactory.H:212
virtual int refToFiner(const ProblemDomain &a_domain) const
Vector< EBLevelGrid > m_eblgs
Definition: EBConductivityOpFactory.H:173
virtual EBConductivityOp * AMRnewOp(const ProblemDomain &a_FineindexSpace)
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_bcoef
Definition: EBConductivityOpFactory.H:187
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_bcoefMG
Definition: EBConductivityOpFactory.H:169
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
EBConductivityOpFactory(const EBConductivityOpFactory &a_opin)
Definition: EBConductivityOpFactory.H:206
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:175
std::vector< bool > m_hasMGObjects
Definition: EBConductivityOpFactory.H:196
Definition: EBConductivityOp.H:60
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG1
End-of-step (time-dependent) A multigrid coefficients.
Definition: EBConductivityOpFactory.H:167
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void setData(Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_data)
Definition: EBConductivityOpFactory.H:90
IntVect m_ghostCellsPhi
Definition: EBConductivityOpFactory.H:193
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_bcoefIrreg
Definition: EBConductivityOpFactory.H:188
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: EBConductivityOpFactory.H:158
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Vector< int > m_refRatio
Definition: EBConductivityOpFactory.H:190
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: EBConductivityOpFactory.H:192
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:172
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Time-independent A coefficients.
Definition: EBConductivityOpFactory.H:179
int m_numLevels
Definition: EBConductivityOpFactory.H:195
EBConductivityOpFactory()
weak construction bad
Definition: EBConductivityOpFactory.H:200
Definition: AMRMultiGrid.H:231
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: EBConductivityOpFactory.H:191
bool m_dataBased
Definition: EBConductivityOpFactory.H:157
Vector< RefCountedPtr< EBQuadCFInterp > > m_quadCFI
Definition: EBConductivityOpFactory.H:174
virtual ~EBConductivityOpFactory()
Destructor.
Real m_beta
Definition: EBConductivityOpFactory.H:176