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