00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _NWOEBVISCOUSTENSOROPFACTORY_H_
00012 #define _NWOEBVISCOUSTENSOROPFACTORY_H_
00013
00014 #include "REAL.H"
00015 #include "Box.H"
00016 #include "FArrayBox.H"
00017 #include "Vector.H"
00018 #include <map>
00019 #include "RefCountedPtr.H"
00020
00021 #include "AMRMultiGrid.H"
00022
00023 #include "EBIndexSpace.H"
00024 #include "EBCellFAB.H"
00025 #include "EBCellFactory.H"
00026 #include "NWOEBViscousTensorOp.H"
00027 #include "EBLevelDataOps.H"
00028 #include "BaseEBBC.H"
00029 #include "BaseDomainBC.H"
00030 #include "CFIVS.H"
00031 #include "EBFluxRegister.H"
00032 #include "EBMGAverage.H"
00033 #include "EBMGInterp.H"
00034 #include "EBCoarsen.H"
00035 #include "PolyGeom.H"
00036 #include "EBAMRPoissonOp.H"
00037 #include "EBLevelGrid.H"
00038 #include "BaseDomainBC.H"
00039 #include "BaseEBBC.H"
00040 #include "NamespaceHeader.H"
00041
00042
00043
00044
00045
00046 class NWOEBViscousTensorOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
00047 {
00048 public:
00049
00050
00051 virtual ~NWOEBViscousTensorOpFactory();
00052
00053
00054
00055 NWOEBViscousTensorOpFactory(const Vector<EBLevelGrid>& a_eblgs,
00056 const Real& a_alpha,
00057 const Real & a_beta,
00058 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00059 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_eta,
00060 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
00061 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
00062 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg,
00063 const Real& a_dxCoarse,
00064 const Vector<int>& a_refRatio,
00065 const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
00066 const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
00067 const IntVect& a_ghostCellsPhi,
00068 const IntVect& a_ghostCellsRhs,
00069 int a_numLevels = -1,
00070 bool a_noMG = false);
00071
00072
00073
00074 NWOEBViscousTensorOpFactory(EBLevelGrid & a_eblgs,
00075 const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
00076 const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory);
00077
00078
00079 virtual NWOEBViscousTensorOp*
00080 MGnewOp(const ProblemDomain& a_FineindexSpace,
00081 int a_depth,
00082 bool a_homoOnly = true);
00083
00084
00085
00086 virtual NWOEBViscousTensorOp*
00087 newOpForTimingOnly(const ProblemDomain& a_FineindexSpace);
00088
00089
00090 NWOEBViscousTensorOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
00091 const EBLevelGrid& a_eblgCoarMG,
00092 const bool& a_hasMGObjects,
00093 const RealVect& a_dxMGLevel,
00094 const RealVect& a_dxCoar,
00095 const int& a_whichLevel);
00096
00097 virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
00098
00099
00100 virtual NWOEBViscousTensorOp*
00101 AMRnewOp(const ProblemDomain& a_FineindexSpace);
00102
00103
00104 virtual void AMRreclaim(NWOEBViscousTensorOp* a_reclaim);
00105
00106
00107
00108
00109 virtual int refToFiner(const ProblemDomain& a_domain) const;
00110
00111
00112 void resetCoefficients(const Real& a_alpha,
00113 const Real & a_beta,
00114 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00115 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_eta,
00116 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lambda,
00117 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_etaIrreg,
00118 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_lambdaIrreg)
00119 {
00120 m_alpha = a_alpha ;
00121 m_beta = a_beta ;
00122 m_acoef = a_acoef ;
00123 m_eta = a_eta ;
00124 m_lambda = a_lambda ;
00125 m_etaIrreg = a_etaIrreg ;
00126 m_lambdaIrreg = a_lambdaIrreg;
00127 }
00128
00129 IntVect getGhostPhi() const
00130 {
00131 return m_ghostCellsPhi;
00132 }
00133 IntVect getGhostRHS() const
00134 {
00135 return m_ghostCellsRhs;
00136 }
00137 protected:
00138 Vector< Vector<EBLevelGrid> > m_eblgsMG;
00139
00140
00141 Vector< Vector< RefCountedPtr<LevelData<EBCellFAB> > > > m_acoefMG;
00142
00143 Vector< Vector<RefCountedPtr<LevelData<EBFluxFAB> > > > m_etaMG;
00144 Vector< Vector<RefCountedPtr<LevelData<EBFluxFAB> > > > m_lambdaMG;
00145 Vector< Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > > m_etaIrregMG;
00146 Vector< Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > > m_lambdaIrregMG;
00147 Vector< Vector<NWOEBViscousTensorOp*> > m_MGops;
00148 std::vector< bool > m_hasMGObjects;
00149
00150 Vector<EBLevelGrid> m_eblgs;
00151 Real m_alpha;
00152 Real m_beta;
00153
00154
00155 Vector<RefCountedPtr<LevelData<EBCellFAB> > > m_acoef;
00156
00157
00158 Vector<RefCountedPtr<LevelData<EBFluxFAB> > > m_eta;
00159 Vector<RefCountedPtr<LevelData<EBFluxFAB> > > m_lambda;
00160 Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > m_etaIrreg;
00161 Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > m_lambdaIrreg;
00162 Real m_dxCoarse;
00163 Vector<int> m_refRatio;
00164 RefCountedPtr<BaseDomainBCFactory> m_domainBCFactory;
00165 RefCountedPtr<BaseEBBCFactory> m_ebBCFactory;
00166 IntVect m_ghostCellsPhi;
00167 IntVect m_ghostCellsRhs;
00168 int m_numLevels;
00169 Vector<Real> m_dx;
00170 bool m_noMG;
00171 bool m_forTimingOnly;
00172 private:
00173
00174 NWOEBViscousTensorOpFactory()
00175 {
00176 MayDay::Error("invalid operator");
00177 }
00178
00179
00180 NWOEBViscousTensorOpFactory(const NWOEBViscousTensorOpFactory& a_opin)
00181 {
00182 MayDay::Error("invalid operator");
00183 }
00184
00185
00186 void operator=(const NWOEBViscousTensorOpFactory& a_opin)
00187 {
00188 MayDay::Error("invalid operator");
00189 }
00190 };
00191
00192 #include "NamespaceFooter.H"
00193 #endif