00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef polyMeshGeometry_H
00040 #define polyMeshGeometry_H
00041
00042 #include "pointFields.H"
00043 #include "HashSet.H"
00044
00045
00046
00047 namespace Foam
00048 {
00049
00050
00051
00052
00053
00054 class polyMeshGeometry
00055 {
00056
00057 const polyMesh& mesh_;
00058
00059
00060 vectorField faceAreas_;
00061
00062
00063 vectorField faceCentres_;
00064
00065
00066 vectorField cellCentres_;
00067
00068
00069 scalarField cellVolumes_;
00070
00071
00072
00073
00074
00075 void updateFaceCentresAndAreas
00076 (
00077 const pointField& p,
00078 const labelList& changedFaces
00079 );
00080
00081
00082
00083 void updateCellCentresAndVols
00084 (
00085 const labelList& changedCells,
00086 const labelList& changedFaces
00087 );
00088
00089
00090 static scalar checkNonOrtho
00091 (
00092 const polyMesh& mesh,
00093 const bool report,
00094 const scalar severeNonorthogonalityThreshold,
00095 const label faceI,
00096 const vector& s,
00097 const vector& d,
00098
00099 label& severeNonOrth,
00100 label& errorNonOrth,
00101 labelHashSet* setPtr
00102 );
00103
00104
00105 static scalar calcSkewness
00106 (
00107 const point& ownCc,
00108 const point& neiCc,
00109 const point& fc
00110 );
00111
00112 public:
00113
00114 ClassName("polyMeshGeometry");
00115
00116
00117
00118
00119 polyMeshGeometry(const polyMesh&);
00120
00121
00122
00123
00124
00125
00126 const polyMesh& mesh() const
00127 {
00128 return mesh_;
00129 }
00130
00131 const vectorField& faceAreas() const
00132 {
00133 return faceAreas_;
00134 }
00135 const vectorField& faceCentres() const
00136 {
00137 return faceCentres_;
00138 }
00139 const vectorField& cellCentres() const
00140 {
00141 return cellCentres_;
00142 }
00143 const scalarField& cellVolumes() const
00144 {
00145 return cellVolumes_;
00146 }
00147
00148
00149
00150
00151 void correct();
00152
00153
00154
00155 void correct
00156 (
00157 const pointField& p,
00158 const labelList& changedFaces
00159 );
00160
00161
00162 static labelList affectedCells
00163 (
00164 const polyMesh&,
00165 const labelList& changedFaces
00166 );
00167
00168
00169
00170
00171
00172
00173 static bool checkFaceDotProduct
00174 (
00175 const bool report,
00176 const scalar orthWarn,
00177 const polyMesh&,
00178 const vectorField& cellCentres,
00179 const vectorField& faceAreas,
00180 const labelList& checkFaces,
00181 const List<labelPair>& baffles,
00182 labelHashSet* setPtr
00183 );
00184
00185
00186 static bool checkFacePyramids
00187 (
00188 const bool report,
00189 const scalar minPyrVol,
00190 const polyMesh&,
00191 const vectorField& cellCentres,
00192 const pointField& p,
00193 const labelList& checkFaces,
00194 const List<labelPair>& baffles,
00195 labelHashSet*
00196 );
00197
00198
00199 static bool checkFaceSkewness
00200 (
00201 const bool report,
00202 const scalar internalSkew,
00203 const scalar boundarySkew,
00204 const polyMesh& mesh,
00205 const vectorField& cellCentres,
00206 const vectorField& faceCentres,
00207 const vectorField& faceAreas,
00208 const labelList& checkFaces,
00209 const List<labelPair>& baffles,
00210 labelHashSet* setPtr
00211 );
00212
00213
00214 static bool checkFaceWeights
00215 (
00216 const bool report,
00217 const scalar warnWeight,
00218 const polyMesh& mesh,
00219 const vectorField& cellCentres,
00220 const vectorField& faceCentres,
00221 const vectorField& faceAreas,
00222 const labelList& checkFaces,
00223 const List<labelPair>& baffles,
00224 labelHashSet* setPtr
00225 );
00226
00227
00228 static bool checkVolRatio
00229 (
00230 const bool report,
00231 const scalar warnRatio,
00232 const polyMesh& mesh,
00233 const scalarField& cellVolumes,
00234 const labelList& checkFaces,
00235 const List<labelPair>& baffles,
00236 labelHashSet* setPtr
00237 );
00238
00239
00240 static bool checkFaceAngles
00241 (
00242 const bool report,
00243 const scalar maxDeg,
00244 const polyMesh& mesh,
00245 const vectorField& faceAreas,
00246 const pointField& p,
00247 const labelList& checkFaces,
00248 labelHashSet* setPtr
00249 );
00250
00251
00252
00253 static bool checkFaceTwist
00254 (
00255 const bool report,
00256 const scalar minTwist,
00257 const polyMesh&,
00258 const vectorField& cellCentres,
00259 const vectorField& faceAreas,
00260 const vectorField& faceCentres,
00261 const pointField& p,
00262 const labelList& checkFaces,
00263 labelHashSet* setPtr
00264 );
00265
00266
00267 static bool checkTriangleTwist
00268 (
00269 const bool report,
00270 const scalar minTwist,
00271 const polyMesh&,
00272 const vectorField& faceAreas,
00273 const vectorField& faceCentres,
00274 const pointField& p,
00275 const labelList& checkFaces,
00276 labelHashSet* setPtr
00277 );
00278
00279
00280 static bool checkFaceArea
00281 (
00282 const bool report,
00283 const scalar minArea,
00284 const polyMesh&,
00285 const vectorField& faceAreas,
00286 const labelList& checkFaces,
00287 labelHashSet* setPtr
00288 );
00289
00290 static bool checkCellDeterminant
00291 (
00292 const bool report,
00293 const scalar minDet,
00294 const polyMesh&,
00295 const vectorField& faceAreas,
00296 const labelList& checkFaces,
00297 const labelList& affectedCells,
00298 labelHashSet* setPtr
00299 );
00300
00301
00302
00303
00304
00305 bool checkFaceDotProduct
00306 (
00307 const bool report,
00308 const scalar orthWarn,
00309 const labelList& checkFaces,
00310 const List<labelPair>& baffles,
00311 labelHashSet* setPtr
00312 ) const;
00313
00314 bool checkFacePyramids
00315 (
00316 const bool report,
00317 const scalar minPyrVol,
00318 const pointField& p,
00319 const labelList& checkFaces,
00320 const List<labelPair>& baffles,
00321 labelHashSet* setPtr
00322 ) const;
00323
00324 bool checkFaceSkewness
00325 (
00326 const bool report,
00327 const scalar internalSkew,
00328 const scalar boundarySkew,
00329 const labelList& checkFaces,
00330 const List<labelPair>& baffles,
00331 labelHashSet* setPtr
00332 ) const;
00333
00334 bool checkFaceWeights
00335 (
00336 const bool report,
00337 const scalar warnWeight,
00338 const labelList& checkFaces,
00339 const List<labelPair>& baffles,
00340 labelHashSet* setPtr
00341 ) const;
00342
00343 bool checkVolRatio
00344 (
00345 const bool report,
00346 const scalar warnRatio,
00347 const labelList& checkFaces,
00348 const List<labelPair>& baffles,
00349 labelHashSet* setPtr
00350 ) const;
00351
00352 bool checkFaceAngles
00353 (
00354 const bool report,
00355 const scalar maxDeg,
00356 const pointField& p,
00357 const labelList& checkFaces,
00358 labelHashSet* setPtr
00359 ) const;
00360
00361 bool checkFaceTwist
00362 (
00363 const bool report,
00364 const scalar minTwist,
00365 const pointField& p,
00366 const labelList& checkFaces,
00367 labelHashSet* setPtr
00368 ) const;
00369
00370 bool checkTriangleTwist
00371 (
00372 const bool report,
00373 const scalar minTwist,
00374 const pointField& p,
00375 const labelList& checkFaces,
00376 labelHashSet* setPtr
00377 ) const;
00378
00379 bool checkFaceArea
00380 (
00381 const bool report,
00382 const scalar minArea,
00383 const labelList& checkFaces,
00384 labelHashSet* setPtr
00385 ) const;
00386
00387 bool checkCellDeterminant
00388 (
00389 const bool report,
00390 const scalar warnDet,
00391 const labelList& checkFaces,
00392 const labelList& affectedCells,
00393 labelHashSet* setPtr
00394 ) const;
00395 };
00396
00397
00398
00399 }
00400
00401
00402
00403 #endif
00404
00405