Chombo + EB  3.2
NWOEBConductivityOpFactory.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 _NWOEBCONDUCTIVITYOPFACTORY_H_
12 #define _NWOEBCONDUCTIVITYOPFACTORY_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 "NWOEBConductivityOp.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 "NWOEBQuadCFInterp.H"
39 #include "NamespaceHeader.H"
40 
41 
42 //! \class NWOEBConductivityOpFactory
43 //! Factory class to generate NWOEBConductivityOps. This follows the
44 //! AMRLevelOpFactory interface.
45 class NWOEBConductivityOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
46 {
47 public:
48 
49  //! Constructs a factory that builds NWOEBConductivityOps with time-independent
50  //! A and B coefficients.
52  const Vector<RefCountedPtr<NWOEBQuadCFInterp> >& a_quadCFI,
53  const Real& a_alpha,
54  const Real & a_beta,
55  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
56  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
57  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
58  const Real& a_dxCoarse,
59  const Vector<int>& a_refRatio,
60  const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
61  const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
62  const IntVect& a_ghostCellsPhi,
63  const IntVect& a_ghostCellsRhs,
64  const int& a_relaxType,
65  int a_numLevels = -1);
66 
67 
68  //! Destructor.
70 
71  ///
72  virtual void setData( Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_data)
73  {
74  m_data = a_data;
75  m_dataBased = true;
76  }
77 
78  ///
79  virtual NWOEBConductivityOp*
80  MGnewOp(const ProblemDomain& a_FineindexSpace,
81  int a_depth,
82  bool a_homoOnly = true);
83 
84  NWOEBConductivityOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
85  const EBLevelGrid& a_eblgCoarMG,
86  const bool& a_hasMGObjects,
87  const RealVect& a_dxMGLevel,
88  const RealVect& a_dxCoar,
89  const int& a_whichLevel);
90  ///
91  virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
92 
93  ///
94  virtual NWOEBConductivityOp*
95  AMRnewOp(const ProblemDomain& a_FineindexSpace);
96 
97  ///
98  virtual void AMRreclaim(NWOEBConductivityOp* a_reclaim);
99 
100  ///
101  /** Refinement ratio between this level and coarser level.
102  Returns 1 when there are no coarser AMRLevelOp objects */
103  virtual int refToFiner(const ProblemDomain& a_domain) const;
104 
105  ///
106  /**
107  testRef is the size of the coarsest domain allowed in multigrid. If testRef=2,
108  then the coarsest domain in multigrid will be 2x2(x2)
109  **/
110  static void setTestRef(int a_testRef)
111  {
112  s_testRef = a_testRef;
113  }
114 
115  static void setMaxBoxSize(int a_maxBoxSize)
116  {
117  s_maxBoxSize = a_maxBoxSize;
118  }
119 
120  static int s_testRef;
121  static int s_maxBoxSize;
122 
123  //! Reset the coefficients for the conductivity operator (time-independent).
124  void resetCoefficients(const Real& a_alpha,
125  const Real & a_beta,
126  const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
127  const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
128  const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
129  {
130  m_alpha = a_alpha ;
131  m_beta = a_beta ;
132  m_acoef = a_acoef ;
133  m_bcoef = a_bcoef ;
134  m_bcoefIrreg = a_bcoefIrreg ;
135  }
136 
137 
138 protected:
139 
143 
144  //! Time-independent A multigrid coefficients
146 
147  //! Beginning-of-step (time-dependent) A multigrid coefficients
149 
150  //! End-of-step (time-dependent) A multigrid coefficients
152 
155 
161 
162  //! Time-independent A coefficients.
164 
165 
175  std::vector< bool > m_hasMGObjects;
177 private:
178  ///weak construction bad
180  {
181  MayDay::Error("invalid operator");
182  }
183 
184  //copy constructor and operator= disallowed for all the usual reasons
186  {
187  MayDay::Error("invalid operator");
188  }
189 
190  //copy constructor and operator= disallowed for all the usual reasons
192  {
193  MayDay::Error("invalid operator");
194  }
195 };
196 
197 #include "NamespaceFooter.H"
198 #endif
static void setMaxBoxSize(int a_maxBoxSize)
Definition: NWOEBConductivityOpFactory.H:115
static int s_maxBoxSize
Definition: NWOEBConductivityOpFactory.H:121
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG0
Beginning-of-step (time-dependent) A multigrid coefficients.
Definition: NWOEBConductivityOpFactory.H:148
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_data
Definition: NWOEBConductivityOpFactory.H:140
bool m_dataBased
Definition: NWOEBConductivityOpFactory.H:141
RefCountedPtr< BaseDomainBCFactory > m_domainBCFactory
Definition: NWOEBConductivityOpFactory.H:170
virtual NWOEBConductivityOp * MGnewOp(const ProblemDomain &a_FineindexSpace, int a_depth, bool a_homoOnly=true)
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG
Time-independent A multigrid coefficients.
Definition: NWOEBConductivityOpFactory.H:145
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Real m_dxCoarse
Definition: NWOEBConductivityOpFactory.H:168
Vector< Vector< RefCountedPtr< LevelData< EBFluxFAB > > > > m_bcoefMG
Definition: NWOEBConductivityOpFactory.H:153
Definition: NWOEBConductivityOp.H:52
virtual void setData(Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > &a_data)
Definition: NWOEBConductivityOpFactory.H:72
Real m_alpha
Definition: NWOEBConductivityOpFactory.H:159
Vector< EBLevelGrid > m_eblgs
Definition: NWOEBConductivityOpFactory.H:157
Definition: EBLevelGrid.H:30
virtual int refToFiner(const ProblemDomain &a_domain) const
Vector< int > m_refRatio
Definition: NWOEBConductivityOpFactory.H:169
Vector< RefCountedPtr< LevelData< EBCellFAB > > > m_acoef
Time-independent A coefficients.
Definition: NWOEBConductivityOpFactory.H:163
void operator=(const NWOEBConductivityOpFactory &a_opin)
Definition: NWOEBConductivityOpFactory.H:191
virtual ~NWOEBConductivityOpFactory()
Destructor.
static void setTestRef(int a_testRef)
Definition: NWOEBConductivityOpFactory.H:110
std::vector< bool > m_hasMGObjects
Definition: NWOEBConductivityOpFactory.H:175
Vector< Real > m_dx
Definition: NWOEBConductivityOpFactory.H:176
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_bcoefIrreg
Definition: NWOEBConductivityOpFactory.H:167
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > m_bcoef
Definition: NWOEBConductivityOpFactory.H:166
static int s_testRef
Definition: NWOEBConductivityOpFactory.H:120
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 void AMRreclaim(NWOEBConductivityOp *a_reclaim)
Vector< Vector< EBLevelGrid > > m_eblgsMG
Definition: NWOEBConductivityOpFactory.H:142
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void reclaim(MGLevelOp< LevelData< EBCellFAB > > *a_reclaim)
virtual NWOEBConductivityOp * AMRnewOp(const ProblemDomain &a_FineindexSpace)
NWOEBConductivityOpFactory(const NWOEBConductivityOpFactory &a_opin)
Definition: NWOEBConductivityOpFactory.H:185
int m_numLevels
Definition: NWOEBConductivityOpFactory.H:174
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Real m_beta
Definition: NWOEBConductivityOpFactory.H:160
Vector< RefCountedPtr< NWOEBQuadCFInterp > > m_quadCFI
Definition: NWOEBConductivityOpFactory.H:158
NWOEBConductivityOp * 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)
Definition: NWOEBConductivityOpFactory.H:45
Vector< Vector< RefCountedPtr< LevelData< EBCellFAB > > > > m_acoefMG1
End-of-step (time-dependent) A multigrid coefficients.
Definition: NWOEBConductivityOpFactory.H:151
int m_relaxType
Definition: NWOEBConductivityOpFactory.H:156
Definition: AMRMultiGrid.H:233
Vector< Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > > m_bcoefIrregMG
Definition: NWOEBConductivityOpFactory.H:154
NWOEBConductivityOpFactory()
weak construction bad
Definition: NWOEBConductivityOpFactory.H:179
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: NWOEBConductivityOpFactory.H:124
IntVect m_ghostCellsPhi
Definition: NWOEBConductivityOpFactory.H:172
IntVect m_ghostCellsRhs
Definition: NWOEBConductivityOpFactory.H:173
RefCountedPtr< BaseEBBCFactory > m_ebBCFactory
Definition: NWOEBConductivityOpFactory.H:171