00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _EBLEVELMACPROJECTOR_H_
00012 #define _EBLEVELMACPROJECTOR_H_
00013 #include "DisjointBoxLayout.H"
00014 #include "EBISLayout.H"
00015 #include "Box.H"
00016 #include "REAL.H"
00017 #include "LevelData.H"
00018 #include "EBFluxFAB.H"
00019 #include "EBCellFAB.H"
00020 #include "EBSimpleSolver.H"
00021 #include "EBAMRPoissonOp.H"
00022 #include "EBAMRPoissonOpFactory.H"
00023 #include "MultiGrid.H"
00024 #include "BiCGStabSolver.H"
00025 #include "NamespaceHeader.H"
00026
00028
00034 class EBLevelMACProjector
00035 {
00036 public:
00037
00039 ~EBLevelMACProjector();
00040
00042
00058 EBLevelMACProjector(const DisjointBoxLayout& a_grids,
00059 const EBISLayout& a_ebisl,
00060 const ProblemDomain& a_domain,
00061 const RealVect& a_dx,
00062 const RealVect& a_origin,
00063 const LinearSolver<LevelData<EBCellFAB> >& a_bottomSolver,
00064 const RefCountedPtr<BaseEBBCFactory>& a_ebbcPhi,
00065 const RefCountedPtr<BaseDomainBCFactory>& a_domainbcPhi,
00066 const RefCountedPtr<BaseDomainBCFactory>& a_domainbcVel,
00067 const int & a_numSmooths,
00068 const int & a_mgCycle,
00069 const int & a_maxIterations,
00070 const Real & a_tolerance,
00071 const int & a_maxDepth,
00072 const Real& a_time,
00073 const IntVect& a_nghostPhi,
00074 const IntVect& a_nghostRhs);
00075
00076
00078
00083 void
00084 project(LevelData<EBFluxFAB>& a_velocity,
00085 LevelData<EBFluxFAB>& a_gradient,
00086 const LevelData< BaseIVFAB<Real> >* const a_boundaryVelocity = NULL);
00087
00088 static void setVerbose(bool a_verbose);
00089 static void setCurLevel(int a_curLevel);
00090 static void setDebugString(string a_debugString);
00091 static string getDebugString();
00092 static int getCurLevel();
00093 static bool getVerbose();
00094
00095 protected:
00096
00097 void
00098 solve(LevelData<EBCellFAB>& a_phi,
00099 const LevelData<EBCellFAB>& a_rhs);
00100
00101 int m_maxIterations;
00102 Real m_tolerance;
00103 DisjointBoxLayout m_grids;
00104 EBISLayout m_ebisl;
00105 ProblemDomain m_domain;
00106 RealVect m_dx;
00107 RealVect m_origin;
00108 EBAMRPoissonOpFactory* m_levelOpFactory;
00109 RefCountedPtr<BaseEBBCFactory> m_ebbcPhi;
00110 RefCountedPtr<BaseDomainBCFactory> m_domainBCFactPhi;
00111 RefCountedPtr<BaseDomainBCFactory> m_domainBCFactVel;
00112
00113 IntVect m_nghostPhi;
00114 IntVect m_nghostRhs;
00115
00116 MultiGrid<LevelData<EBCellFAB> > m_solver;
00117
00118
00119 static int s_curLevel;
00120 static bool s_verbose;
00121 static string s_debugString;
00122 private:
00123 EBLevelMACProjector(const EBLevelMACProjector& a_input)
00124 {
00125 MayDay::Error("We disallow copy construction for objects with pointered data");
00126 }
00127
00128 void operator=(const EBLevelMACProjector& a_input)
00129 {
00130 MayDay::Error("We disallow assignment for objects with pointered data");
00131 }
00132
00133 EBLevelMACProjector()
00134 {
00135 MayDay::Error("weak construction is bad");
00136 }
00137 };
00138
00139
00140 extern void
00141 macGradient(LevelData<EBFluxFAB>& a_gradPhi,
00142 const LevelData<EBCellFAB>& a_phi,
00143 const DisjointBoxLayout& a_dbl,
00144 const EBISLayout& a_ebisl,
00145 const ProblemDomain& a_domain,
00146 const RealVect& a_dx);
00147
00148 extern void
00149 macGradient(EBFluxFAB& a_gradPhi,
00150 const EBCellFAB& a_phi,
00151 const EBISBox& a_ebisBox,
00152 const Box& a_box,
00153 const ProblemDomain& a_domain,
00154 const RealVect& a_dx);
00155
00157 extern void
00158 macKappaDivergence(LevelData<EBCellFAB>& a_divVel,
00159 const LevelData<EBFluxFAB>& a_velocity,
00160 const DisjointBoxLayout& a_dbl,
00161 const EBISLayout& a_ebisl,
00162 const ProblemDomain& a_domain,
00163 const RealVect& a_dx,
00164 const LevelData<BaseIVFAB<Real> >* a_boundaryVelo = NULL);
00165
00167 extern void
00168 macKappaDivergence(EBCellFAB& a_divVel,
00169 const EBFluxFAB& a_velocity,
00170 const EBISBox& a_ebisBox,
00171 const Box& a_box,
00172 const ProblemDomain& a_domain,
00173 const RealVect& a_dx,
00174 const BaseIVFAB<Real>* a_boundaryVel = NULL);
00175
00176 extern void
00177 macEnforceVelocityBC(LevelData<EBFluxFAB>& a_velocity,
00178 const DisjointBoxLayout& a_grids,
00179 const EBISLayout& a_ebisl,
00180 const ProblemDomain& a_domain,
00181 const RealVect& a_dx,
00182 const RealVect& a_origin,
00183 RefCountedPtr<BaseDomainBCFactory> a_domainbcVel,
00184 const Real& a_time,
00185 const bool& a_doDivFreeOutflow,
00186 const LevelData<BaseIVFAB<Real> >* const a_boundaryVelocity);
00187
00188 extern void
00189 macEnforceGradientBC(LevelData<EBFluxFAB>& a_gradPhi,
00190 const LevelData<EBCellFAB>& a_phi,
00191 const DisjointBoxLayout& a_grids,
00192 const EBISLayout& a_ebisl,
00193 const ProblemDomain& a_domain,
00194 const RealVect& a_dx,
00195 const RealVect& a_origin,
00196 const Real& a_time,
00197 RefCountedPtr<BaseDomainBCFactory> a_domainBCFactPhi);
00198 #include "NamespaceFooter.H"
00199 #endif