Chombo + EB  3.0
EBViscousTensorOpFactory.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 _EBVISCOUSTENSOROPFACTORY_H_
12 #define _EBVISCOUSTENSOROPFACTORY_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 "EBViscousTensorOp.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  Factory class to generate EBViscousTensorOps. This follows the AMRLevelOpFactory interface.
43 */
44 class EBViscousTensorOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
45 {
46 public:
47 
48  ///
49  virtual ~EBViscousTensorOpFactory();
50 
51  //! Constructs a factory that builds EBViscousTensorOps with time-independent
52  //! A and B coefficients.
54  const Real& a_alpha,
55  const Real & a_beta,
56  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
57  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_eta,
58  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
59  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
60  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg,
61  const Real& a_dxCoarse,
62  const Vector<int>& a_refRatio,
63  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
64  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
65  const IntVect& a_ghostCellsPhi,
66  const IntVect& a_ghostCellsRhs,
67  int a_numLevels = -1,
68  bool a_noMG = false);
69 
70  //! Constructs a factory that builds EBConductivityOps with a time-dependent
71  //! A coefficient and a time-independent B coefficient. The A coefficient
72  //! is interpolated between its beginning-of-step and end-of-step values.
74  const Real& a_alpha,
75  const Real & a_beta,
76  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef0,
77  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef1,
78  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_eta,
79  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
80  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
81  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg,
82  const Real& a_dxCoarse,
83  const Vector<int>& a_refRatio,
84  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
85  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
86  const IntVect& a_ghostCellsPhi,
87  const IntVect& a_ghostCellsRhs,
88  int a_numLevels = -1,
89  bool a_noMG = false);
90 
91  ///
92  virtual EBViscousTensorOp*
93  MGnewOp(const ProblemDomain& a_FineindexSpace,
94  int a_depth,
95  bool a_homoOnly = true);
96 
97  EBViscousTensorOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
98  const EBLevelGrid& a_eblgCoarMG,
99  const bool& a_hasMGObjects,
100  const RealVect& a_dxMGLevel,
101  const RealVect& a_dxCoar,
102  const int& a_whichLevel);
103  ///
104  virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
105 
106  ///
107  virtual EBViscousTensorOp*
108  AMRnewOp(const ProblemDomain& a_FineindexSpace);
109 
110  ///
111  virtual void AMRreclaim(EBViscousTensorOp* a_reclaim);
112 
113  ///
114  /** Refinement ratio between this level and coarser level.
115  Returns 1 when there are no coarser AMRLevelOp objects */
116  virtual int refToFiner(const ProblemDomain& a_domain) const;
117 
118 
119  void resetCoefficients(const Real& a_alpha,
120  const Real & a_beta,
121  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
122  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_eta,
123  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
124  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
125  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg)
126  {
127  m_alpha = a_alpha ;
128  m_beta = a_beta ;
129  m_acoef = a_acoef ;
130  m_eta = a_eta ;
131  m_lambda = a_lambda ;
132  m_etaIrreg = a_etaIrreg ;
133  m_lambdaIrreg = a_lambdaIrreg;
134  }
135 
136 protected:
138 
139  //! Time-independent a multigrid coefficients
141 
147  std::vector< bool > m_hasMGObjects;
148 
152 
153  //! Time-independent a coefficients.
155 
156  //! Beginning-of-step (time-dependent) a coefficients.
158 
159  //! End-of-step (time-dependent) a coefficient.
161 
174  bool m_noMG;
175 private:
176  ///weak construction bad
178  {
179  MayDay::Error("invalid operator");
180  }
181 
182  //copy constructor and operator= disallowed for all the usual reasons
184  {
185  MayDay::Error("invalid operator");
186  }
187 
188  //copy constructor and operator= disallowed for all the usual reasons
190  {
191  MayDay::Error("invalid operator");
192  }
193 };
194 
195 #include "NamespaceFooter.H"
196 #endif
virtual int refToFiner(const ProblemDomain &a_domain) const
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: EBViscousTensorOpFactory.H:137
A reference-counting handle class.
Definition: RefCountedPtr.H:66
Real m_alpha
Definition: EBViscousTensorOpFactory.H:150
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
virtual ~EBViscousTensorOpFactory()
Real m_dxCoarse
Definition: EBViscousTensorOpFactory.H:166
virtual void AMRreclaim(EBViscousTensorOp *a_reclaim)
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_eta
Definition: EBViscousTensorOpFactory.H:162
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_lambdaIrreg
Definition: EBViscousTensorOpFactory.H:165
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef0
Beginning-of-step (time-dependent) a coefficients.
Definition: EBViscousTensorOpFactory.H:157
virtual EBViscousTensorOp * MGnewOp(const ProblemDomain &a_FineindexSpace, int a_depth, bool a_homoOnly=true)
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_etaIrregMG
Definition: EBViscousTensorOpFactory.H:144
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_etaIrreg
Definition: EBViscousTensorOpFactory.H:164
Definition: EBLevelGrid.H:30
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_etaMG
Definition: EBViscousTensorOpFactory.H:142
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: EBViscousTensorOpFactory.H:168
bool m_noMG
Definition: EBViscousTensorOpFactory.H:174
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_lambdaIrregMG
Definition: EBViscousTensorOpFactory.H:145
std::vector< bool > m_hasMGObjects
Definition: EBViscousTensorOpFactory.H:147
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef1
End-of-step (time-dependent) a coefficient.
Definition: EBViscousTensorOpFactory.H:160
Vector< Vector< EBViscousTensorOp * > > m_MGops
Definition: EBViscousTensorOpFactory.H:146
Vector< int > m_refRatio
Definition: EBViscousTensorOpFactory.H:167
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Time-independent a coefficients.
Definition: EBViscousTensorOpFactory.H:154
Vector< EBLevelGrid > m_eblgs
Definition: EBViscousTensorOpFactory.H:149
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
Real m_beta
Definition: EBViscousTensorOpFactory.H:151
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: EBViscousTensorOpFactory.H:169
EBViscousTensorOp * 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)
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.
IntVect m_ghostCellsRhs
Definition: EBViscousTensorOpFactory.H:171
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG
Time-independent a multigrid coefficients.
Definition: EBViscousTensorOpFactory.H:140
Definition: EBViscousTensorOp.H:54
void operator=(const EBViscousTensorOpFactory &a_opin)
Definition: EBViscousTensorOpFactory.H:189
EBViscousTensorOpFactory(const EBViscousTensorOpFactory &a_opin)
Definition: EBViscousTensorOpFactory.H:183
virtual EBViscousTensorOp * AMRnewOp(const ProblemDomain &a_FineindexSpace)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Vector< Real > m_dx
Definition: EBViscousTensorOpFactory.H:173
Definition: EBViscousTensorOpFactory.H:44
void resetCoefficients(const Real &a_alpha, const Real &a_beta, const Vector< RefCountedPtr< LevelData< EBCellFAB > > > &a_acoef, const Vector< RefCountedPtr< LevelData< EBFluxFAB > > > &a_eta, const Vector< RefCountedPtr< LevelData< EBFluxFAB > > > &a_lambda, const Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_etaIrreg, const Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_lambdaIrreg)
Definition: EBViscousTensorOpFactory.H:119
int m_numLevels
Definition: EBViscousTensorOpFactory.H:172
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_lambdaMG
Definition: EBViscousTensorOpFactory.H:143
Definition: AMRMultiGrid.H:231
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_lambda
Definition: EBViscousTensorOpFactory.H:163
EBViscousTensorOpFactory()
weak construction bad
Definition: EBViscousTensorOpFactory.H:177
IntVect m_ghostCellsPhi
Definition: EBViscousTensorOpFactory.H:170