// Same check as snapMesh void checkSnapMesh ( const Time& runTime, const polyMesh& mesh, labelHashSet& wrongFaces ) { IOdictionary snapDict ( IOobject ( "snapMeshDict", runTime.system(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); // Max nonorthogonality allowed scalar maxNonOrtho(readScalar(snapDict.lookup("maxNonOrtho"))); // Max concaveness allowed. scalar maxConcave(readScalar(snapDict.lookup("maxConcave"))); // Min volume allowed (factor of minimum cellVolume) scalar relMinVol(readScalar(snapDict.lookup("minVol"))); const scalar minCellVol = min(mesh.cellVolumes()); const scalar minPyrVol = relMinVol*minCellVol; // Min area scalar minArea(readScalar(snapDict.lookup("minArea"))); if (maxNonOrtho < 180.0-SMALL) { Pout<< "Checking non orthogonality" << endl; label nOldSize = wrongFaces.size(); mesh.setNonOrthThreshold(maxNonOrtho); mesh.checkFaceOrthogonality(false, &wrongFaces); Pout<< "Detected " << wrongFaces.size() - nOldSize << " faces with non-orthogonality > " << maxNonOrtho << " degrees" << endl; } if (minPyrVol > -GREAT) { Pout<< "Checking face pyramids" << endl; label nOldSize = wrongFaces.size(); mesh.checkFacePyramids(false, minPyrVol, &wrongFaces); Pout<< "Detected additional " << wrongFaces.size() - nOldSize << " faces with illegal face pyramids" << endl; } if (maxConcave < 180.0-SMALL) { Pout<< "Checking face angles" << endl; label nOldSize = wrongFaces.size(); mesh.checkFaceAngles(false, maxConcave, &wrongFaces); Pout<< "Detected additional " << wrongFaces.size() - nOldSize << " faces with concavity > " << maxConcave << " degrees" << endl; } if (minArea > -SMALL) { Pout<< "Checking face areas" << endl; label nOldSize = wrongFaces.size(); const scalarField magFaceAreas = mag(mesh.faceAreas()); forAll(magFaceAreas, faceI) { if (magFaceAreas[faceI] < minArea) { wrongFaces.insert(faceI); } } Pout<< "Detected additional " << wrongFaces.size() - nOldSize << " faces with area < " << minArea << " m^2" << endl; }