Chombo + EB  3.2
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 
71  ///
72  virtual EBViscousTensorOp*
73  MGnewOp(const ProblemDomain& a_FineindexSpace,
74  int a_depth,
75  bool a_homoOnly = true);
76 
77  EBViscousTensorOp* 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 EBViscousTensorOp*
88  AMRnewOp(const ProblemDomain& a_FineindexSpace);
89 
90  ///
91  virtual void AMRreclaim(EBViscousTensorOp* 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_eta,
103  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
104  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
105  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg)
106  {
107  m_alpha = a_alpha ;
108  m_beta = a_beta ;
109  m_acoef = a_acoef ;
110  m_eta = a_eta ;
111  m_lambda = a_lambda ;
112  m_etaIrreg = a_etaIrreg ;
113  m_lambdaIrreg = a_lambdaIrreg;
114  }
115 
116 protected:
118 
119  //! Time-independent a multigrid coefficients
121 
127  std::vector< bool > m_hasMGObjects;
128 
132 
133  //! Time-independent a coefficients.
135 
148  bool m_noMG;
149 private:
150  ///weak construction bad
152  {
153  MayDay::Error("invalid operator");
154  }
155 
156  //copy constructor and operator= disallowed for all the usual reasons
158  {
159  MayDay::Error("invalid operator");
160  }
161 
162  //copy constructor and operator= disallowed for all the usual reasons
164  {
165  MayDay::Error("invalid operator");
166  }
167 };
168 
169 #include "NamespaceFooter.H"
170 #endif
virtual int refToFiner(const ProblemDomain &a_domain) const
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: EBViscousTensorOpFactory.H:117
A reference-counting handle class.
Definition: RefCountedPtr.H:173
Real m_alpha
Definition: EBViscousTensorOpFactory.H:130
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
virtual ~EBViscousTensorOpFactory()
Real m_dxCoarse
Definition: EBViscousTensorOpFactory.H:140
virtual void AMRreclaim(EBViscousTensorOp *a_reclaim)
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_eta
Definition: EBViscousTensorOpFactory.H:136
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_lambdaIrreg
Definition: EBViscousTensorOpFactory.H:139
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:124
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_etaIrreg
Definition: EBViscousTensorOpFactory.H:138
Definition: EBLevelGrid.H:30
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_etaMG
Definition: EBViscousTensorOpFactory.H:122
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: EBViscousTensorOpFactory.H:142
bool m_noMG
Definition: EBViscousTensorOpFactory.H:148
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_lambdaIrregMG
Definition: EBViscousTensorOpFactory.H:125
std::vector< bool > m_hasMGObjects
Definition: EBViscousTensorOpFactory.H:127
Vector< Vector< EBViscousTensorOp * > > m_MGops
Definition: EBViscousTensorOpFactory.H:126
Vector< int > m_refRatio
Definition: EBViscousTensorOpFactory.H:141
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Time-independent a coefficients.
Definition: EBViscousTensorOpFactory.H:134
Vector< EBLevelGrid > m_eblgs
Definition: EBViscousTensorOpFactory.H:129
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
Real m_beta
Definition: EBViscousTensorOpFactory.H:131
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: EBViscousTensorOpFactory.H:143
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:145
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:120
Definition: EBViscousTensorOp.H:55
void operator=(const EBViscousTensorOpFactory &a_opin)
Definition: EBViscousTensorOpFactory.H:163
EBViscousTensorOpFactory(const EBViscousTensorOpFactory &a_opin)
Definition: EBViscousTensorOpFactory.H:157
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:147
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:99
int m_numLevels
Definition: EBViscousTensorOpFactory.H:146
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_lambdaMG
Definition: EBViscousTensorOpFactory.H:123
Definition: AMRMultiGrid.H:233
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_lambda
Definition: EBViscousTensorOpFactory.H:137
EBViscousTensorOpFactory()
weak construction bad
Definition: EBViscousTensorOpFactory.H:151
IntVect m_ghostCellsPhi
Definition: EBViscousTensorOpFactory.H:144