Chombo + EB  3.0
GeometryShop.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // ANAG, LBNL, DTG
12 
13 #ifndef _GEOMETRYSHOP_H_
14 #define _GEOMETRYSHOP_H_
15 
16 #include "REAL.H"
17 #include "RealVect.H"
18 #include "Box.H"
19 #include "IntVect.H"
20 
21 #include "EBISBox.H"
22 #include "BaseIF.H"
23 #include "GeometryService.H"
24 #include "Moments.H"
25 
26 #include "NamespaceHeader.H"
27 
28 ///
29 /**
30  This is the base class for the workshop algorithm.
31  It forms the interface between the workshop classes
32  and the geometryservice class.
33  */
35 {
36 public:
37  ///
38  /**
39  Define the workshop using the local geometry description
40  */
41  GeometryShop(const BaseIF& a_localGeom,
42  int a_verbosity,
43  RealVect a_vectDx,
44  Real a_thrshdVoF = 0.0);
45 
46  ///
47  ~GeometryShop();
48 
49  ///
50  bool twoEdgeIntersections(edgeMo a_edges[4]) const;
51 
52  /**
53  Return true if every cell in region is regular at the
54  refinement described by dx.
55  */
56  bool isRegular(const Box& a_region,
57  const ProblemDomain& a_domain,
58  const RealVect& a_origin,
59  const Real& a_dx) const;
60 
61  ///
62  /**
63  Return true if every cell in region is covered at the
64  refinement described by dx.
65  */
66  bool isCovered(const Box& a_region,
67  const ProblemDomain& a_domain,
68  const RealVect& a_origin,
69  const Real& a_dx) const;
70 
71 
72  virtual bool isIrregular(const Box& a_region,
73  const ProblemDomain& a_domain,
74  const RealVect& a_origin,
75  const Real& a_dx) const ;
76 
77  virtual InOut InsideOutside(const Box& a_region,
78  const ProblemDomain& a_domain,
79  const RealVect& a_origin,
80  const Real& a_dx) const ;
81 
82 
83  virtual bool canGenerateMultiCells() const
84  {
85  return false;
86  }
87 
88  ///
89  /**
90  Define the internals of the input ebisRegion.
91  */
92  virtual void fillGraph(BaseFab<int>& a_regIrregCovered,
93  Vector<IrregNode>& a_nodes,
94  const Box& a_validRegion,
95  const Box& a_ghostRegion,
96  const ProblemDomain& a_domain,
97  const RealVect& a_origin,
98  const Real& a_dx) const;
99 
100  /**
101  */
102  void computeVoFInternals(Real& a_volFrac,
103  Vector<int> a_loArc[SpaceDim],
104  Vector<int> a_hiArc[SpaceDim],
105  Vector<Real> a_loAreaFrac[SpaceDim],
106  Vector<Real> a_hiAreaFrac[SpaceDim],
107  Real& a_bndryArea,
108  RealVect& a_normal,
109  RealVect& a_volCentroid,
110  RealVect& a_bndryCentroid,
111  Vector<RealVect> a_loFaceCentroid[SpaceDim],
112  Vector<RealVect> a_hiFaceCentroid[SpaceDim],
113  const IntVectSet& a_ivsIrreg,
114  const VolIndex& a_vof,
115  const ProblemDomain& a_domain,
116  const RealVect& a_origin,
117  const Real& a_dx,
118  const RealVect& a_vectDx,
119  const IntVect& a_iv) const;
120 
121  int m_phase;
122 
123 private:
127  Real m_thrshdVoF; //CP, threshold to remove very small VoFs.
128 
130 
132 
133  static bool s_verbose;
134 
135  // local geometry description
136  // const BaseLocalGeometry* m_localGeomPtr;
137 
138  /**
139  Return true if every cell in region is regular at the
140  refinement described by dx.
141  */
142  bool isRegularEveryPoint(const Box& a_region,
143  const ProblemDomain& a_domain,
144  const RealVect& a_origin,
145  const Real& a_dx) const;
146 
147  ///
148  /**
149  Return true if every cell in region is covered at the
150  refinement described by dx.
151  */
152  bool isCoveredEveryPoint(const Box& a_region,
153  const ProblemDomain& a_domain,
154  const RealVect& a_origin,
155  const Real& a_dx) const;
156 
157 
158  virtual bool isIrregularEveryPoint(const Box& a_region,
159  const ProblemDomain& a_domain,
160  const RealVect& a_origin,
161  const Real& a_dx,
162  const Real& a_originVal) const ;
163 
164  void edgeData3D(edgeMo a_edges[4],
165  bool& a_faceCovered,
166  bool& a_faceRegular,
167  bool& a_faceDontKnow,
168  const int a_hiLoFace,
169  const int a_faceNormal,
170  const Real& a_dx,
171  const RealVect& a_vectDx,
172  const IntVect& a_coord,
173  const ProblemDomain& a_domain,
174  const RealVect& a_origin) const;
175 
176  void edgeData2D(edgeMo a_edges[4],
177  bool& a_faceCovered,
178  bool& a_faceRegular,
179  bool& a_faceDontKnow,
180  const Real& a_dx,
181  const RealVect& a_vectDx,
182  const IntVect& a_coord,
183  const ProblemDomain& a_domain,
184  const RealVect& a_origin) const;
185 
186  void edgeType(bool& a_regular,
187  bool& a_covered,
188  bool& a_dontKnow,
189  Real& a_signHi,
190  Real& a_signLo) const;
191 
192  Real BrentRootFinder(const RealVect& a_x1,
193  const RealVect& a_x2,
194  const int& a_range) const;
195 
196 #if 1
198  RealVect& a_yVec) const;
199 #endif
200 
201  int getNumCellsClipped();
202 
203  Real Min(const Real x, const Real y) const;
204 
205  //stuff disallowed for all the usual reasons.
207  {
208  MayDay::Abort("GeometryShop uses strong construction only");
209  }
210  GeometryShop(const GeometryShop& a_workshopin)
211  {
212  MayDay::Abort("GeometryShop disallows copy contruction");
213  }
214  void operator=(const GeometryShop& a_workshopin)
215  {
216  MayDay::Abort("GeometryShop disallows the assignment operator");
217  }
218 
219 };
220 #include "NamespaceFooter.H"
221 #endif
void edgeData2D(edgeMo a_edges[4], bool &a_faceCovered, bool &a_faceRegular, bool &a_faceDontKnow, const Real &a_dx, const RealVect &a_vectDx, const IntVect &a_coord, const ProblemDomain &a_domain, const RealVect &a_origin) const
GeometryShop()
Definition: GeometryShop.H:206
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
Real m_threshold
Definition: GeometryShop.H:126
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
virtual bool isIrregularEveryPoint(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx, const Real &a_originVal) const
static bool s_verbose
Definition: GeometryShop.H:133
Definition: Moments.H:24
int m_verbosity
Definition: GeometryShop.H:125
one dimensional dynamic array
Definition: Vector.H:52
void edgeData3D(edgeMo a_edges[4], bool &a_faceCovered, bool &a_faceRegular, bool &a_faceDontKnow, const int a_hiLoFace, const int a_faceNormal, const Real &a_dx, const RealVect &a_vectDx, const IntVect &a_coord, const ProblemDomain &a_domain, const RealVect &a_origin) const
RealVect m_vectDx
Definition: GeometryShop.H:129
Definition: GeometryShop.H:34
Real Min(const Real x, const Real y) const
bool isCovered(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
const int SpaceDim
Definition: SPACE.H:39
void computeVoFInternals(Real &a_volFrac, Vector< int > a_loArc[SpaceDim], Vector< int > a_hiArc[SpaceDim], Vector< Real > a_loAreaFrac[SpaceDim], Vector< Real > a_hiAreaFrac[SpaceDim], Real &a_bndryArea, RealVect &a_normal, RealVect &a_volCentroid, RealVect &a_bndryCentroid, Vector< RealVect > a_loFaceCentroid[SpaceDim], Vector< RealVect > a_hiFaceCentroid[SpaceDim], const IntVectSet &a_ivsIrreg, const VolIndex &a_vof, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx, const RealVect &a_vectDx, const IntVect &a_iv) const
InOut
Definition: GeometryService.H:41
virtual bool isIrregular(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
void operator=(const GeometryShop &a_workshopin)
Definition: GeometryShop.H:214
int m_phase
Definition: GeometryShop.H:121
const BaseIF * m_implicitFunction
Definition: GeometryShop.H:131
Definition: BaseIF.H:30
Real PrismoidalAreaCalc(RealVect &a_xVec, RealVect &a_yVec) const
double Real
Definition: REAL.H:33
bool isCoveredEveryPoint(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
Definition: GeometryService.H:37
Real BrentRootFinder(const RealVect &a_x1, const RealVect &a_x2, const int &a_range) const
void edgeType(bool &a_regular, bool &a_covered, bool &a_dontKnow, Real &a_signHi, Real &a_signLo) const
virtual bool canGenerateMultiCells() const
Definition: GeometryShop.H:83
int getNumCellsClipped()
Real m_thrshdVoF
Definition: GeometryShop.H:127
bool isRegular(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void fillGraph(BaseFab< int > &a_regIrregCovered, Vector< IrregNode > &a_nodes, const Box &a_validRegion, const Box &a_ghostRegion, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
virtual InOut InsideOutside(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
GeometryShop(const GeometryShop &a_workshopin)
Definition: GeometryShop.H:210
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Volume of Fluid Index.
Definition: VolIndex.H:31
int m_numCellsClipped
Definition: GeometryShop.H:124
bool isRegularEveryPoint(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
bool twoEdgeIntersections(edgeMo a_edges[4]) const
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).