1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::primitiveMeshGeometry
29 Updateable mesh geometry + checking routines.
32 primitiveMeshGeometry.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef primitiveMeshGeometry_H
37 #define primitiveMeshGeometry_H
39 #include "pointFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class primitiveMeshGeometry Declaration
49 \*---------------------------------------------------------------------------*/
51 class primitiveMeshGeometry
53 //- Reference to primitiveMesh.
54 const primitiveMesh& mesh_;
56 //- Uptodate copy of face areas
57 vectorField faceAreas_;
59 //- Uptodate copy of face centres
60 vectorField faceCentres_;
62 //- Uptodate copy of cell centres
63 vectorField cellCentres_;
65 //- Uptodate copy of cell volumes
66 scalarField cellVolumes_;
69 // Private Member Functions
71 //- Update face areas and centres on selected faces.
72 void updateFaceCentresAndAreas
75 const labelList& changedFaces
78 //- Update cell volumes and centres on selected cells. Requires
79 // cells and faces to be consistent set.
80 void updateCellCentresAndVols
82 const labelList& changedCells,
83 const labelList& changedFaces
88 ClassName("primitiveMeshGeometry");
92 //- Construct from mesh
93 primitiveMeshGeometry(const primitiveMesh&);
100 const primitiveMesh& mesh() const
105 const vectorField& faceAreas() const
109 const vectorField& faceCentres() const
113 const vectorField& cellCentres() const
117 const scalarField& cellVolumes() const
124 //- Take over properties from mesh
127 //- Recalculate on selected faces. Recalculates cell properties
128 // on owner and neighbour of these cells.
132 const labelList& changedFaces
135 //- Helper function: get affected cells from faces
136 labelList affectedCells(const labelList& changedFaces) const;
139 // Checking of selected faces with supplied geometry (mesh only used for
140 // topology). Parallel aware.
142 static bool checkFaceDotProduct
145 const scalar orthWarn,
146 const primitiveMesh&,
147 const vectorField& cellCentres,
148 const vectorField& faceAreas,
149 const labelList& checkFaces,
153 static bool checkFacePyramids
156 const scalar minPyrVol,
157 const primitiveMesh&,
158 const vectorField& cellCentres,
160 const labelList& checkFaces,
164 static bool checkFaceSkewness
167 const scalar internalSkew,
168 const scalar boundarySkew,
169 const primitiveMesh& mesh,
170 const vectorField& cellCentres,
171 const vectorField& faceCentres,
172 const vectorField& faceAreas,
173 const labelList& checkFaces,
177 static bool checkFaceWeights
180 const scalar warnWeight,
181 const primitiveMesh& mesh,
182 const vectorField& cellCentres,
183 const vectorField& faceCentres,
184 const vectorField& faceAreas,
185 const labelList& checkFaces,
189 static bool checkFaceAngles
193 const primitiveMesh& mesh,
194 const vectorField& faceAreas,
196 const labelList& checkFaces,
200 //static bool checkFaceFlatness
202 // const bool report,
203 // const scalar warnFlatness,
204 // const primitiveMesh&,
205 // const vectorField& faceAreas,
206 // const vectorField& faceCentres,
207 // const pointField& p,
208 // const labelList& checkFaces,
209 // labelHashSet* setPtr
212 static bool checkFaceTwist
215 const scalar minTwist,
216 const primitiveMesh&,
217 const vectorField& faceAreas,
218 const vectorField& faceCentres,
220 const labelList& checkFaces,
224 static bool checkFaceArea
227 const scalar minArea,
228 const primitiveMesh&,
229 const vectorField& faceAreas,
230 const labelList& checkFaces,
234 static bool checkCellDeterminant
238 const primitiveMesh&,
239 const vectorField& faceAreas,
240 const labelList& checkFaces,
241 const labelList& affectedCells,
246 // Checking of selected faces with local geometry. Uses above static
247 // functions. Parallel aware.
249 bool checkFaceDotProduct
252 const scalar orthWarn,
253 const labelList& checkFaces,
257 bool checkFacePyramids
260 const scalar minPyrVol,
262 const labelList& checkFaces,
266 bool checkFaceSkewness
269 const scalar internalSkew,
270 const scalar boundarySkew,
271 const labelList& checkFaces,
275 bool checkFaceWeights
278 const scalar warnWeight,
279 const labelList& checkFaces,
288 const labelList& checkFaces,
292 //bool checkFaceFlatness
294 // const bool report,
295 // const scalar warnFlatness,
296 // const pointField& p,
297 // const labelList& checkFaces,
298 // labelHashSet* setPtr
304 const scalar minTwist,
306 const labelList& checkFaces,
313 const scalar minArea,
314 const labelList& checkFaces,
318 bool checkCellDeterminant
321 const scalar warnDet,
322 const labelList& checkFaces,
323 const labelList& affectedCells,
328 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
330 } // End namespace Foam
332 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
336 // ************************************************************************* //