00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _GEOMETRYSHOP_H_
00014 #define _GEOMETRYSHOP_H_
00015
00016 #include "REAL.H"
00017 #include "RealVect.H"
00018 #include "Box.H"
00019 #include "IntVect.H"
00020
00021 #include "EBISBox.H"
00022 #include "BaseIF.H"
00023 #include "GeometryService.H"
00024 #include "Moments.H"
00025
00026 #include "NamespaceHeader.H"
00027
00029
00034 class GeometryShop: public GeometryService
00035 {
00036 public:
00038
00041 GeometryShop(const BaseIF& a_localGeom,
00042 int a_verbosity,
00043 RealVect a_vectDx);
00044
00046 ~GeometryShop();
00047
00049 bool twoEdgeIntersections(edgeMo a_edges[4]) const;
00050
00055 bool isRegular(const Box& a_region,
00056 const ProblemDomain& a_domain,
00057 const RealVect& a_origin,
00058 const Real& a_dx) const;
00059
00061
00065 bool isCovered(const Box& a_region,
00066 const ProblemDomain& a_domain,
00067 const RealVect& a_origin,
00068 const Real& a_dx) const;
00069
00070
00071 virtual bool isIrregular(const Box& a_region,
00072 const ProblemDomain& a_domain,
00073 const RealVect& a_origin,
00074 const Real& a_dx) const ;
00075
00076 virtual InOut InsideOutside(const Box& a_region,
00077 const ProblemDomain& a_domain,
00078 const RealVect& a_origin,
00079 const Real& a_dx) const ;
00080
00081
00082 virtual bool canGenerateMultiCells() const
00083 {
00084 return false;
00085 }
00086
00088
00091 virtual void fillGraph(BaseFab<int>& a_regIrregCovered,
00092 Vector<IrregNode>& a_nodes,
00093 const Box& a_validRegion,
00094 const Box& a_ghostRegion,
00095 const ProblemDomain& a_domain,
00096 const RealVect& a_origin,
00097 const Real& a_dx) const;
00098
00101 void computeVoFInternals(Real& a_volFrac,
00102 Vector<int> a_loArc[SpaceDim],
00103 Vector<int> a_hiArc[SpaceDim],
00104 Vector<Real> a_loAreaFrac[SpaceDim],
00105 Vector<Real> a_hiAreaFrac[SpaceDim],
00106 Real& a_bndryArea,
00107 RealVect& a_normal,
00108 RealVect& a_volCentroid,
00109 RealVect& a_bndryCentroid,
00110 Vector<RealVect> a_loFaceCentroid[SpaceDim],
00111 Vector<RealVect> a_hiFaceCentroid[SpaceDim],
00112 const IntVectSet& a_ivsIrreg,
00113 const VolIndex& a_vof,
00114 const ProblemDomain& a_domain,
00115 const RealVect& a_origin,
00116 const Real& a_dx,
00117 const RealVect& a_vectDx,
00118 const IntVect& a_iv) const;
00119
00120 int m_phase;
00121
00122 private:
00123 int m_numCellsClipped;
00124 int m_verbosity;
00125 Real m_threshold;
00126
00127 RealVect m_vectDx;
00128
00129 const BaseIF* m_implicitFunction;
00130
00131 static bool s_verbose;
00132
00133
00134
00135
00140 bool isRegularEveryPoint(const Box& a_region,
00141 const ProblemDomain& a_domain,
00142 const RealVect& a_origin,
00143 const Real& a_dx) const;
00144
00146
00150 bool isCoveredEveryPoint(const Box& a_region,
00151 const ProblemDomain& a_domain,
00152 const RealVect& a_origin,
00153 const Real& a_dx) const;
00154
00155
00156 virtual bool isIrregularEveryPoint(const Box& a_region,
00157 const ProblemDomain& a_domain,
00158 const RealVect& a_origin,
00159 const Real& a_dx,
00160 const Real& a_originVal) const ;
00161
00162 void edgeData3D(edgeMo a_edges[4],
00163 bool& a_faceCovered,
00164 bool& a_faceRegular,
00165 bool& a_faceDontKnow,
00166 const int a_hiLoFace,
00167 const int a_faceNormal,
00168 const Real& a_dx,
00169 const RealVect& a_vectDx,
00170 const IntVect& a_coord,
00171 const ProblemDomain& a_domain,
00172 const RealVect& a_origin) const;
00173
00174 void edgeData2D(edgeMo a_edges[4],
00175 bool& a_faceCovered,
00176 bool& a_faceRegular,
00177 bool& a_faceDontKnow,
00178 const Real& a_dx,
00179 const RealVect& a_vectDx,
00180 const IntVect& a_coord,
00181 const ProblemDomain& a_domain,
00182 const RealVect& a_origin) const;
00183
00184 void edgeType(bool& a_regular,
00185 bool& a_covered,
00186 bool& a_dontKnow,
00187 Real& a_signHi,
00188 Real& a_signLo) const;
00189
00190 Real BrentRootFinder(const RealVect& a_x1,
00191 const RealVect& a_x2,
00192 const int& a_range) const;
00193
00194 #if 1
00195 Real PrismoidalAreaCalc(RealVect& a_xVec,
00196 RealVect& a_yVec) const;
00197 #endif
00198
00199 int getNumCellsClipped();
00200
00201 Real Min(const Real x, const Real y) const;
00202
00203
00204 GeometryShop()
00205 {
00206 MayDay::Error("GeometryShop uses strong construction only");
00207 }
00208 GeometryShop(const GeometryShop& a_workshopin)
00209 {
00210 MayDay::Error("GeometryShop disallows copy contruction");
00211 }
00212 void operator=(const GeometryShop& a_workshopin)
00213 {
00214 MayDay::Error("GeometryShop disallows the assignment operator");
00215 }
00216
00217 };
00218 #include "NamespaceFooter.H"
00219 #endif