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