00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _EBLEVELCCPROJECTOR_H_
00012 #define _EBLEVELCCPROJECTOR_H_
00013 #include "EBLevelMACProjector.H"
00014 #include "DisjointBoxLayout.H"
00015 #include "EBISLayout.H"
00016 #include "Box.H"
00017 #include "REAL.H"
00018 #include "LevelData.H"
00019 #include "EBFluxFAB.H"
00020 #include "EBCellFAB.H"
00021 #include "EBSimpleSolver.H"
00022 #include "EBAMRPoissonOp.H"
00023 #include "MultiGrid.H"
00024 #include "EBQuadCFInterp.H"
00025 #include "NamespaceHeader.H"
00026
00028
00039 class EBLevelCCProjector
00040 {
00041 public:
00042
00044 ~EBLevelCCProjector();
00045
00047
00067 EBLevelCCProjector(const DisjointBoxLayout & a_grids,
00068 const DisjointBoxLayout & a_gridsCoar,
00069 const EBISLayout & a_ebisl,
00070 const EBISLayout & a_ebislCoar,
00071 const ProblemDomain & a_domain,
00072 const RealVect & a_dx,
00073 const RealVect & a_origin,
00074 const int & a_refToCoar,
00075 const bool & a_hasCoarser,
00076 const LinearSolver<LevelData<EBCellFAB> > & a_bottomSolver,
00077 const RefCountedPtr<BaseEBBCFactory> & a_ebbcPhi,
00078 const RefCountedPtr<BaseDomainBCFactory> & a_domainbcPhi,
00079 const RefCountedPtr<BaseDomainBCFactory> & a_domainbcVel,
00080 const int & a_numSmooths,
00081 const int & a_mgCycle,
00082 const int & a_maxIterations,
00083 const Real & a_tolerance,
00084 const int & a_maxDepth,
00085 const Real& a_time,
00086 const bool& a_doEBCFCrossing,
00087 const IntVect& a_nghostPhi,
00088 const IntVect& a_nghostRhs) ;
00089
00090
00092
00098 void
00099 project(LevelData<EBCellFAB>& a_velocity,
00100 LevelData<EBCellFAB>& a_gradient,
00101 const LevelData<EBCellFAB>& a_velCoar,
00102 const LevelData<BaseIVFAB<Real> >* const a_boundaryVel = NULL);
00103
00104 void
00105 kappaDivergence(LevelData<EBCellFAB>& a_divergence,
00106 LevelData<EBCellFAB>& a_velocity,
00107 const LevelData<EBCellFAB>& a_velCoar,
00108 const LevelData<BaseIVFAB<Real> >* const a_boundaryVel = NULL);
00109
00110 protected:
00111
00112 DisjointBoxLayout m_grids;
00113 EBISLayout m_ebisl;
00114 DisjointBoxLayout m_gridsCoar;
00115 EBISLayout m_ebislCoar;
00116 ProblemDomain m_domain;
00117 RealVect m_dx;
00118 EBLevelMACProjector* m_macProjector;
00119 EBQuadCFInterp m_patcher;
00120 bool m_doEBCFCrossing;
00121 int m_refToCoar;
00122 bool m_hasCoarser;
00123 IntVect m_nghostPhi;
00124 IntVect m_nghostRhs;
00125 LayoutData<IntVectSet> m_cfivs;
00126
00127 private:
00128
00129 EBLevelCCProjector()
00130 {
00131 MayDay::Error("Weak construction is bad");
00132 }
00133 EBLevelCCProjector(const EBLevelCCProjector& a_input)
00134 {
00135 MayDay::Error("We disallow copy construction for objects with pointered data");
00136 }
00137 void operator=(const EBLevelCCProjector& a_input)
00138 {
00139 MayDay::Error("We disallow assignment for objects with pointered data");
00140 }
00141
00142 };
00143
00144
00145 extern void
00146 ccpAverageVelocityToFaces(LevelData<EBFluxFAB>& a_macVeloc,
00147 const LevelData<EBCellFAB>& a_cellVeloc,
00148 const DisjointBoxLayout& a_grids,
00149 const EBISLayout& a_ebisl,
00150 const ProblemDomain& a_domain,
00151 const RealVect& a_dx,
00152 const LayoutData<IntVectSet>& a_cfivs);
00153
00154 extern void
00155 ccpAverageVelocityToFaces(EBFaceFAB& a_faceVel,
00156 const EBCellFAB& a_cellVel,
00157 const EBGraph& a_ebGraph,
00158 const Box& a_grid,
00159 const int& a_idir,
00160 const ProblemDomain& a_domain,
00161 const RealVect& a_dx);
00162
00163 extern void
00164 ccpAverageFaceToCells(LevelData<EBCellFAB>& a_cellData,
00165 const LevelData<EBFluxFAB>& a_macData,
00166 const DisjointBoxLayout& a_grids,
00167 const EBISLayout& a_ebisl,
00168 const ProblemDomain& a_domain,
00169 const RealVect& a_dx);
00170
00171 extern void
00172 ccpAverageFaceToCells(EBCellFAB& a_cellData,
00173 const EBFluxFAB& a_fluxData,
00174 const EBGraph& a_ebGraph,
00175 const Box& a_grid,
00176 const ProblemDomain& a_domain,
00177 const RealVect& a_dx);
00178
00179 extern void
00180 ccpExtrapolateToDomainBoundaries(LevelData<EBFluxFAB>& a_macData,
00181 const DisjointBoxLayout& a_grids,
00182 const EBISLayout& a_ebisl,
00183 const ProblemDomain& a_domain,
00184 const RealVect& a_dx);
00185
00186 extern void
00187 ccpExtrapolateToDomainBoundaries(EBFaceFAB& a_faceData,
00188 const EBGraph& a_ebGraph,
00189 const Box& a_grid,
00190 const int& a_idir,
00191 const ProblemDomain& a_domain,
00192 const RealVect& a_dx);
00193
00194 extern void
00195 ccpLinearInterp(Real & a_dataOnLine,
00196 const Vector<RealVect>& a_faceLoc,
00197 const RealVect& a_intersectLoc,
00198 const Vector<Real>& a_interpolationData,
00199 const int& a_planeDir);
00200
00201 extern void
00202 ccpBilinearInterp(Real & a_dataOnLine,
00203 const Vector<RealVect>& a_faceLoc,
00204 const RealVect& a_intersectLoc,
00205 const Vector<Real>& a_interpolationData,
00206 const Tuple<int, SpaceDim-1>& a_planeDir);
00207
00208
00209 extern void
00210 ccpExtrapFaceToCovered(bool& a_dropOrder,
00211 Real& a_extrapVal,
00212 const EBFaceFAB& a_primFace,
00213 const VolIndex& a_vof,
00214 const int& a_faceDir,
00215 const Side::LoHiSide& a_sd,
00216 const RealVect& a_normal,
00217 const RealVect& a_dx,
00218 const int& a_icomp);
00219
00221
00224 extern void
00225 ccpJohansenExtrapFaceToCovered(bool& a_dropOrder,
00226 Real& a_extrapVal,
00227 const EBFaceFAB& a_primFace,
00228 const EBISBox& a_ebisBox,
00229 const VolIndex& a_vof,
00230 const int& a_faceDir,
00231 const Side::LoHiSide& a_sd,
00232 const RealVect& a_normal,
00233 const RealVect& a_dx,
00234 const int& a_icomp) ;
00235
00237
00241 extern Real
00242 ccpOneDCoveredExtrapValue(const VolIndex& a_vof,
00243 const int& a_idir,
00244 const Side::LoHiSide a_side,
00245 const EBFaceFAB & a_faceGrad,
00246 const EBISBox & a_ebisBox,
00247 const Box & a_grid,
00248 const ProblemDomain & a_domain,
00249 const RealVect & a_dx,
00250 const int& a_icomp);
00251
00253
00258 extern Real
00259 ccpGetCoveredExtrapValue(const VolIndex& a_vof,
00260 const int& a_idir,
00261 const Side::LoHiSide a_side,
00262 const EBFaceFAB & a_faceGrad,
00263 const EBISBox & a_ebisBox,
00264 const Box & a_grid,
00265 const ProblemDomain & a_domain,
00266 const RealVect & a_dx,
00267 const int& a_icomp);
00268
00269 #include "NamespaceFooter.H"
00270 #endif