00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _EBCONDUCTIVITYOPFACTORY_H_
00012 #define _EBCONDUCTIVITYOPFACTORY_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 "EBConductivityOp.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 "NamespaceHeader.H"
00039
00040
00042
00045 class EBConductivityOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
00046 {
00047 public:
00048
00050 virtual ~EBConductivityOpFactory();
00051
00053
00055 EBConductivityOpFactory(const Vector<EBLevelGrid>& a_eblgs,
00056 const Vector<RefCountedPtr<EBQuadCFInterp> >& a_quadCFI,
00057 const Real& a_alpha,
00058 const Real & a_beta,
00059 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00060 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
00061 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
00062 const Real& a_dxCoarse,
00063 const Vector<int>& a_refRatio,
00064 const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
00065 const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
00066 const IntVect& a_ghostCellsPhi,
00067 const IntVect& a_ghostCellsRhs,
00068 int a_numLevels = -1);
00069
00071 virtual EBConductivityOp*
00072 MGnewOp(const ProblemDomain& a_FineindexSpace,
00073 int a_depth,
00074 bool a_homoOnly = true);
00075
00076 EBConductivityOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
00077 const EBLevelGrid& a_eblgCoarMG,
00078 const bool& a_hasMGObjects,
00079 const RealVect& a_dxMGLevel,
00080 const RealVect& a_dxCoar,
00081 const int& a_whichLevel);
00083 virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
00084
00086 virtual EBConductivityOp*
00087 AMRnewOp(const ProblemDomain& a_FineindexSpace);
00088
00090 virtual void AMRreclaim(EBConductivityOp* a_reclaim);
00091
00093
00095 virtual int refToFiner(const ProblemDomain& a_domain) const;
00096
00097
00098 void resetCoefficients(const Real& a_alpha,
00099 const Real & a_beta,
00100 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00101 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
00102 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
00103 {
00104 m_alpha = a_alpha ;
00105 m_beta = a_beta ;
00106 m_acoef = a_acoef ;
00107 m_bcoef = a_bcoef ;
00108 m_bcoefIrreg = a_bcoefIrreg ;
00109 }
00110
00111 protected:
00112
00113 Vector< Vector<EBLevelGrid> > m_eblgsMG;
00114 Vector< Vector< RefCountedPtr<LevelData<EBCellFAB> > > > m_acoefMG;
00115 Vector< Vector< RefCountedPtr<LevelData<EBFluxFAB> > > > m_bcoefMG;
00116 Vector< Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > > > m_bcoefIrregMG;
00117
00118 Vector<EBLevelGrid> m_eblgs;
00119 Vector<RefCountedPtr<EBQuadCFInterp> > m_quadCFI;
00120 Real m_alpha;
00121 Real m_beta;
00122 Vector<RefCountedPtr<LevelData<EBCellFAB> > > m_acoef;
00123 Vector<RefCountedPtr<LevelData<EBFluxFAB> > > m_bcoef;
00124 Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > m_bcoefIrreg;
00125 Real m_dxCoarse;
00126 Vector<int> m_refRatio;
00127 RefCountedPtr<BaseDomainBCFactory> m_domainBCFactory;
00128 RefCountedPtr<BaseEBBCFactory> m_ebBCFactory;
00129 IntVect m_ghostCellsPhi;
00130 IntVect m_ghostCellsRhs;
00131 int m_numLevels;
00132 std::vector< bool > m_hasMGObjects;
00133 Vector<Real> m_dx;
00134 private:
00136 EBConductivityOpFactory()
00137 {
00138 MayDay::Error("invalid operator");
00139 }
00140
00141
00142 EBConductivityOpFactory(const EBConductivityOpFactory& a_opin)
00143 {
00144 MayDay::Error("invalid operator");
00145 }
00146
00147
00148 void operator=(const EBConductivityOpFactory& a_opin)
00149 {
00150 MayDay::Error("invalid operator");
00151 }
00152 };
00153
00154 #include "NamespaceFooter.H"
00155 #endif