00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _NWOEBCONDUCTIVITYOPFACTORY_H_
00012 #define _NWOEBCONDUCTIVITYOPFACTORY_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 "NWOEBConductivityOp.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 "NWOEBQuadCFInterp.H"
00039 #include "NamespaceHeader.H"
00040
00041
00042
00043
00044
00045 class NWOEBConductivityOpFactory: public AMRLevelOpFactory<LevelData<EBCellFAB> >
00046 {
00047 public:
00048
00049
00050
00051 NWOEBConductivityOpFactory(const Vector<EBLevelGrid>& a_eblgs,
00052 const Vector<RefCountedPtr<NWOEBQuadCFInterp> >& a_quadCFI,
00053 const Real& a_alpha,
00054 const Real & a_beta,
00055 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00056 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
00057 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg,
00058 const Real& a_dxCoarse,
00059 const Vector<int>& a_refRatio,
00060 const RefCountedPtr<BaseDomainBCFactory>& a_domainBCFactory,
00061 const RefCountedPtr<BaseEBBCFactory> & a_ebBcFactory,
00062 const IntVect& a_ghostCellsPhi,
00063 const IntVect& a_ghostCellsRhs,
00064 const int& a_relaxType,
00065 int a_numLevels = -1);
00066
00067
00068
00069 virtual ~NWOEBConductivityOpFactory();
00070
00071
00072 virtual void setData( Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_data)
00073 {
00074 m_data = a_data;
00075 m_dataBased = true;
00076 }
00077
00078
00079 virtual NWOEBConductivityOp*
00080 MGnewOp(const ProblemDomain& a_FineindexSpace,
00081 int a_depth,
00082 bool a_homoOnly = true);
00083
00084 NWOEBConductivityOp* createOperator(const EBLevelGrid& a_eblgMGLevel,
00085 const EBLevelGrid& a_eblgCoarMG,
00086 const bool& a_hasMGObjects,
00087 const RealVect& a_dxMGLevel,
00088 const RealVect& a_dxCoar,
00089 const int& a_whichLevel);
00090
00091 virtual void reclaim(MGLevelOp<LevelData<EBCellFAB> >* a_reclaim);
00092
00093
00094 virtual NWOEBConductivityOp*
00095 AMRnewOp(const ProblemDomain& a_FineindexSpace);
00096
00097
00098 virtual void AMRreclaim(NWOEBConductivityOp* a_reclaim);
00099
00100
00101
00102
00103 virtual int refToFiner(const ProblemDomain& a_domain) const;
00104
00105
00106
00107
00108
00109
00110 static void setTestRef(int a_testRef)
00111 {
00112 s_testRef = a_testRef;
00113 }
00114
00115 static void setMaxBoxSize(int a_maxBoxSize)
00116 {
00117 s_maxBoxSize = a_maxBoxSize;
00118 }
00119
00120 static int s_testRef;
00121 static int s_maxBoxSize;
00122
00123
00124 void resetCoefficients(const Real& a_alpha,
00125 const Real & a_beta,
00126 const Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_acoef,
00127 const Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_bcoef,
00128 const Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > >& a_bcoefIrreg)
00129 {
00130 m_alpha = a_alpha ;
00131 m_beta = a_beta ;
00132 m_acoef = a_acoef ;
00133 m_bcoef = a_bcoef ;
00134 m_bcoefIrreg = a_bcoefIrreg ;
00135 }
00136
00137
00138 protected:
00139
00140 Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > m_data;
00141 bool m_dataBased;
00142 Vector< Vector<EBLevelGrid> > m_eblgsMG;
00143
00144
00145 Vector< Vector< RefCountedPtr<LevelData<EBCellFAB> > > > m_acoefMG;
00146
00147
00148 Vector< Vector< RefCountedPtr<LevelData<EBCellFAB> > > > m_acoefMG0;
00149
00150
00151 Vector< Vector< RefCountedPtr<LevelData<EBCellFAB> > > > m_acoefMG1;
00152
00153 Vector< Vector< RefCountedPtr<LevelData<EBFluxFAB> > > > m_bcoefMG;
00154 Vector< Vector< RefCountedPtr<LevelData<BaseIVFAB<Real> > > > > m_bcoefIrregMG;
00155
00156 int m_relaxType;
00157 Vector<EBLevelGrid> m_eblgs;
00158 Vector<RefCountedPtr<NWOEBQuadCFInterp> > m_quadCFI;
00159 Real m_alpha;
00160 Real m_beta;
00161
00162
00163 Vector<RefCountedPtr<LevelData<EBCellFAB> > > m_acoef;
00164
00165
00166 Vector<RefCountedPtr<LevelData<EBFluxFAB> > > m_bcoef;
00167 Vector<RefCountedPtr<LevelData<BaseIVFAB<Real> > > > m_bcoefIrreg;
00168 Real m_dxCoarse;
00169 Vector<int> m_refRatio;
00170 RefCountedPtr<BaseDomainBCFactory> m_domainBCFactory;
00171 RefCountedPtr<BaseEBBCFactory> m_ebBCFactory;
00172 IntVect m_ghostCellsPhi;
00173 IntVect m_ghostCellsRhs;
00174 int m_numLevels;
00175 std::vector< bool > m_hasMGObjects;
00176 Vector<Real> m_dx;
00177 private:
00178
00179 NWOEBConductivityOpFactory()
00180 {
00181 MayDay::Error("invalid operator");
00182 }
00183
00184
00185 NWOEBConductivityOpFactory(const NWOEBConductivityOpFactory& a_opin)
00186 {
00187 MayDay::Error("invalid operator");
00188 }
00189
00190
00191 void operator=(const NWOEBConductivityOpFactory& a_opin)
00192 {
00193 MayDay::Error("invalid operator");
00194 }
00195 };
00196
00197 #include "NamespaceFooter.H"
00198 #endif