00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _GEOMETRYSERVICE_H_
00014 #define _GEOMETRYSERVICE_H_
00015
00016 #include <cmath>
00017 #include <cstdlib>
00018
00019 #include "REAL.H"
00020 #include "LoHiSide.H"
00021 #include "RealVect.H"
00022 #include "Box.H"
00023 #include "IntVect.H"
00024
00025 #include "EBISBox.H"
00026 #include "VolIndex.H"
00027 #include "FaceIndex.H"
00028 #include "IrregNode.H"
00029 #include "DisjointBoxLayout.H"
00030 #include "NamespaceHeader.H"
00031
00032
00033
00034
00035
00036
00037 class GeometryService
00038 {
00039 public:
00040
00041 enum InOut
00042 {
00043 Regular,
00044 Covered,
00045 Irregular
00046 };
00047
00048 GeometryService();
00049
00050 virtual ~GeometryService();
00051
00052
00053
00054
00055
00056
00057 virtual bool isRegular(const Box& a_region,
00058 const ProblemDomain& a_domain,
00059 const RealVect& a_origin,
00060 const Real& a_dx) const = 0;
00061
00062
00063
00064
00065
00066
00067 virtual bool isCovered(const Box& a_region,
00068 const ProblemDomain& a_domain,
00069 const RealVect& a_origin,
00070 const Real& a_dx) const = 0;
00071
00072 virtual bool isIrregular(const Box& a_region,
00073 const ProblemDomain& a_domain,
00074 const RealVect& a_origin,
00075 const Real& a_dx) const ;
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 virtual void fillGraph(BaseFab<int>& a_regIrregCovered,
00087 Vector<IrregNode>& a_nodes,
00088 const Box& a_validRegion,
00089 const Box& a_ghostRegion,
00090 const ProblemDomain& a_domain,
00091 const RealVect& a_origin,
00092 const Real& a_dx) const = 0;
00093
00094
00095
00096
00097
00098
00099 virtual void fillGraph(BaseFab<int>& a_regIrregCovered,
00100 Vector<IrregNode>& a_nodes,
00101 const Box& a_validRegion,
00102 const Box& a_ghostRegion,
00103 const ProblemDomain& a_domain,
00104 const RealVect& a_origin,
00105 const Real& a_dx,
00106 const DataIndex& a_di ) const
00107 {
00108 return fillGraph( a_regIrregCovered, a_nodes, a_validRegion, a_ghostRegion,
00109 a_domain, a_origin, a_dx );
00110 }
00111
00112
00113 virtual bool canGenerateMultiCells() const;
00114
00115 virtual InOut InsideOutside(const Box& a_region,
00116 const ProblemDomain& a_domain,
00117 const RealVect& a_origin,
00118 const Real& a_dx) const ;
00119
00120
00121
00122
00123
00124
00125
00126 virtual InOut InsideOutside(const Box& a_region,
00127 const ProblemDomain& a_domain,
00128 const RealVect& a_origin,
00129 const Real& a_dx,
00130 const DataIndex& a_di ) const
00131 {
00132 return InsideOutside( a_region, a_domain, a_origin, a_dx );
00133 }
00134
00135
00136 static bool intersection(const RealVect& a_lo1, const RealVect& a_hi1,
00137 const RealVect& a_lo2, const RealVect& a_hi2);
00138
00139 static bool intersection(const Box& a_region,
00140 const RealVect& a_origin,
00141 const Real& a_dx,
00142 const RealVect& a_lower,
00143 const RealVect& a_upper);
00144
00145
00146
00147
00148
00149
00150 virtual void postMakeBoxLayout(const DisjointBoxLayout& a_dbl,
00151 const RealVect& a_dx);
00152
00153
00154
00155
00156
00157
00158
00159 virtual void makeGrids( const ProblemDomain& a_domain,
00160 DisjointBoxLayout& a_grids,
00161 const int& a_maxGridSize,
00162 const int& a_maxIrregGridSize )
00163 { MayDay::Error("GeometryService::makeGrids not defined"); }
00164
00165 protected:
00166
00167 };
00168 #include "NamespaceFooter.H"
00169 #endif