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 "STLIF.H"
00024 #include "GeometryService.H"
00025 #include "Moments.H"
00026
00027 #include "NamespaceHeader.H"
00028
00029
00030
00031
00032
00033
00034
00035 class GeometryShop: public GeometryService
00036 {
00037 public:
00038
00039
00040
00041
00042 GeometryShop(const BaseIF& a_localGeom,
00043 int a_verbosity,
00044 RealVect a_vectDx,
00045 Real a_thrshdVoF = 1.0e-16);
00046
00047
00048 ~GeometryShop();
00049
00050
00051 bool twoEdgeIntersections(edgeMo a_edges[4]) const;
00052
00053
00054
00055
00056
00057 bool isRegular(const Box& a_region,
00058 const ProblemDomain& a_domain,
00059 const RealVect& a_origin,
00060 const Real& a_dx) const;
00061
00062
00063
00064
00065
00066
00067 bool isCovered(const Box& a_region,
00068 const ProblemDomain& a_domain,
00069 const RealVect& a_origin,
00070 const Real& a_dx) const;
00071
00072
00073 virtual bool isIrregular(const Box& a_region,
00074 const ProblemDomain& a_domain,
00075 const RealVect& a_origin,
00076 const Real& a_dx) const ;
00077
00078 virtual InOut InsideOutside(const Box& a_region,
00079 const ProblemDomain& a_domain,
00080 const RealVect& a_origin,
00081 const Real& a_dx) const ;
00082
00083
00084 virtual bool canGenerateMultiCells() const
00085 {
00086 return false;
00087 }
00088
00089
00090
00091
00092
00093 virtual void fillGraph(BaseFab<int>& a_regIrregCovered,
00094 Vector<IrregNode>& a_nodes,
00095 const Box& a_validRegion,
00096 const Box& a_ghostRegion,
00097 const ProblemDomain& a_domain,
00098 const RealVect& a_origin,
00099 const Real& a_dx,
00100 const DataIndex& a_di) const;
00101
00102
00103
00104 void computeVoFInternals(Real& a_volFrac,
00105 Vector<int> a_loArc[SpaceDim],
00106 Vector<int> a_hiArc[SpaceDim],
00107 Vector<Real> a_loAreaFrac[SpaceDim],
00108 Vector<Real> a_hiAreaFrac[SpaceDim],
00109 Real& a_bndryArea,
00110 RealVect& a_normal,
00111 RealVect& a_volCentroid,
00112 RealVect& a_bndryCentroid,
00113 Vector<RealVect> a_loFaceCentroid[SpaceDim],
00114 Vector<RealVect> a_hiFaceCentroid[SpaceDim],
00115 const BaseFab<int>& a_regIrregCovered,
00116 const IntVectSet& a_ivsIrreg,
00117 const VolIndex& a_vof,
00118 const ProblemDomain& a_domain,
00119 const RealVect& a_origin,
00120 const Real& a_dx,
00121 const RealVect& a_vectDx,
00122 const IntVect& a_iv) const;
00123
00124 void
00125 getFullNodeWithCoveredFace(IrregNode & a_newNode,
00126 const BaseFab<int> & a_regIrregCovered,
00127 const IntVect & a_iv,
00128 const ProblemDomain & a_domain) const;
00129
00130 void
00131 fixRegularCellsNextToCovered(Vector<IrregNode> & a_nodes,
00132 BaseFab<int> & a_regIrregCovered,
00133 const Box & a_validRegion,
00134 const ProblemDomain & a_domain,
00135 const IntVect & a_iv,
00136 const Real & a_dx) const;
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 virtual void makeGrids( const ProblemDomain& a_domain,
00148 DisjointBoxLayout& a_grids,
00149 const int& a_maxGridSize,
00150 const int& a_maxIrregGridSize );
00151
00152 int m_phase;
00153
00154 private:
00155 int m_numCellsClipped;
00156 int m_verbosity;
00157 Real m_threshold;
00158 Real m_thrshdVoF;
00159
00160 RealVect m_vectDx;
00161
00162 BaseIF* m_implicitFunction;
00163 const STLIF* m_stlIF;
00164 mutable bool m_STLBoxSet;
00165
00166 static bool s_verbose;
00167
00168
00169
00170
00171
00172
00173
00174
00175 bool isRegularEveryPoint(const Box& a_region,
00176 const ProblemDomain& a_domain,
00177 const RealVect& a_origin,
00178 const Real& a_dx) const;
00179
00180
00181
00182
00183
00184
00185 bool isCoveredEveryPoint(const Box& a_region,
00186 const ProblemDomain& a_domain,
00187 const RealVect& a_origin,
00188 const Real& a_dx) const;
00189
00190
00191 virtual bool isIrregularEveryPoint(const Box& a_region,
00192 const ProblemDomain& a_domain,
00193 const RealVect& a_origin,
00194 const Real& a_dx,
00195 const Real& a_originVal) const ;
00196
00197 void edgeData3D(edgeMo a_edges[4],
00198 bool& a_faceCovered,
00199 bool& a_faceRegular,
00200 bool& a_faceDontKnow,
00201 const int a_hiLoFace,
00202 const int a_faceNormal,
00203 const Real& a_dx,
00204 const RealVect& a_vectDx,
00205 const IntVect& a_coord,
00206 const ProblemDomain& a_domain,
00207 const RealVect& a_origin) const;
00208
00209 void edgeData2D(edgeMo a_edges[4],
00210 bool& a_faceCovered,
00211 bool& a_faceRegular,
00212 bool& a_faceDontKnow,
00213 const Real& a_dx,
00214 const RealVect& a_vectDx,
00215 const IntVect& a_coord,
00216 const ProblemDomain& a_domain,
00217 const RealVect& a_origin) const;
00218
00219 void edgeType(bool& a_regular,
00220 bool& a_covered,
00221 bool& a_dontKnow,
00222 Real& a_signHi,
00223 Real& a_signLo) const;
00224
00225 Real BrentRootFinder(const RealVect& a_x1,
00226 const RealVect& a_x2,
00227 const int& a_range) const;
00228
00229 #if 1
00230 Real PrismoidalAreaCalc(RealVect& a_xVec,
00231 RealVect& a_yVec) const;
00232 #endif
00233
00234 int getNumCellsClipped();
00235
00236 Real Min(const Real x, const Real y) const;
00237
00238
00239 GeometryShop()
00240 {
00241 MayDay::Abort("GeometryShop uses strong construction only");
00242 }
00243 GeometryShop(const GeometryShop& a_workshopin)
00244 {
00245 MayDay::Abort("GeometryShop disallows copy contruction");
00246 }
00247 void operator=(const GeometryShop& a_workshopin)
00248 {
00249 MayDay::Abort("GeometryShop disallows the assignment operator");
00250 }
00251
00252 };
00253 #include "NamespaceFooter.H"
00254 #endif