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