00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _EBCOMPOSITECCPROJECTOR_H_
00012 #define _EBCOMPOSITECCPROJECTOR_H_
00013
00014 #include "EBLevelCCProjector.H"
00015 #include "DisjointBoxLayout.H"
00016 #include "EBISLayout.H"
00017 #include "Box.H"
00018 #include "REAL.H"
00019 #include "LevelData.H"
00020 #include "EBFluxFAB.H"
00021 #include "EBCellFAB.H"
00022 #include "EBSimpleSolver.H"
00023 #include "EBAMRPoissonOp.H"
00024 #include "MultiGrid.H"
00025 #include "LevelFluxRegister.H"
00026 #include "EBQuadCFInterp.H"
00027 #include "EBCompositeMACProjector.H"
00028 #include "NamespaceHeader.H"
00029
00031
00040 class EBCompositeCCProjector
00041 {
00042 public:
00043
00045 ~EBCompositeCCProjector();
00046
00048
00068 EBCompositeCCProjector(const Vector<EBLevelGrid>& a_dbl,
00069 const Vector<int>& a_refRat,
00070 const Vector<RefCountedPtr<EBQuadCFInterp> >& a_quadCFI,
00071 const RealVect& a_coarsestDx,
00072 const RealVect& a_origin,
00073 const RefCountedPtr<BaseDomainBCFactory>& a_baseDomainBCVel,
00074 const RefCountedPtr<BaseDomainBCFactory>& a_baseDomainBCPhi,
00075 const RefCountedPtr<BaseEBBCFactory>& a_ebbcPhi,
00076 const bool& a_subtractOffMean,
00077 const int& a_numLevels,
00078 const int& a_verbosity,
00079 const int& a_numPreCondIters,
00080 const Real& a_time,
00081 const int& a_relaxType,
00082 const int& a_bottomSolverType,
00083 EBCompositeMACProjector* a_inputMAC= NULL);
00084
00086
00094 int
00095 project(Vector<LevelData<EBCellFAB>* >& a_velocity,
00096 Vector<LevelData<EBCellFAB>* >& a_gradient,
00097 const Real& a_gradCoef=1.0,
00098 const Real& a_divuCoef=1.0,
00099 const Vector<LevelData<BaseIVFAB<Real> >* >* a_boundaryVelo=NULL);
00100
00102 Vector<LevelData<EBFluxFAB>* >& getMacVelocity()
00103 {
00104 return m_macVelo;
00105 }
00106
00108 const Vector<LevelData<EBFluxFAB>* >& getMacVelocity() const
00109 {
00110 return m_macVelo;
00111 }
00112
00114 void
00115 setSolverParams(int a_numSmooth,
00116 int a_itermax,
00117 int a_mgcycle,
00118 Real a_hang,
00119 Real a_tolerance,
00120 int a_verbosity=3,
00121 Real a_normThresh=1.e-12);
00122
00123 void
00124 gradient(Vector<LevelData<EBCellFAB>* >& a_gradient,
00125 Vector<LevelData<EBCellFAB>* >& a_phi);
00126
00128 void kappaDivergence(Vector<LevelData<EBCellFAB>* >& a_divu,
00129 Vector<LevelData<EBCellFAB>* >& a_velo,
00130 const Vector<LevelData<BaseIVFAB<Real> >* >* a_boundaryVelo = NULL);
00131
00132 void
00133 averageVelocityToFaces(Vector<LevelData<EBFluxFAB>* >& a_macVelo,
00134 Vector<LevelData<EBCellFAB>* >& a_velocity);
00135
00136 void
00137 averageFaceToCells(Vector<LevelData<EBCellFAB>* >& a_cellData,
00138 const Vector<LevelData<EBFluxFAB>* >& a_faceData);
00139
00140 Vector<LevelData<EBCellFAB>* >& getPhi()
00141 {return m_macProjector->getPhi();}
00142
00144
00147 void
00148 setInitialPhi(Vector<LevelData<EBCellFAB>* >& a_phi)
00149 {m_macProjector->setInitialPhi(a_phi);}
00150
00151 protected:
00152
00153
00154 EBCompositeMACProjector* m_macProjector;
00155
00156 bool m_externMAC;
00157 bool m_subtractOffMean;
00158 Vector<LevelData<EBFluxFAB>* > m_macVelo;
00159 Vector<LevelData<EBFluxFAB>* > m_macGrad;
00160
00161
00162 Vector<EBLevelGrid> m_eblg;
00163 Vector<RefCountedPtr<EBQuadCFInterp> > m_quadCFI;
00164 Vector<RealVect> m_dx;
00165 Vector<int> m_refRat;
00166 int m_numLevels;
00167
00168 private:
00169
00170 EBCompositeCCProjector()
00171 {
00172 MayDay::Error("Weak construction is bad where there is this much memory management");
00173 }
00174
00175 EBCompositeCCProjector(const EBCompositeCCProjector& a_input)
00176 {
00177 MayDay::Error("We disallow copy construction for objects with pointered data");
00178 }
00179
00180 void operator=(const EBCompositeCCProjector& a_input)
00181 {
00182 MayDay::Error("We disallow assignment for objects with pointered data");
00183 }
00184
00185 };
00186
00187 #include "NamespaceFooter.H"
00188 #endif