From 46f829761a2f4b0b30f14c2fc925c1d982ac8934 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 18 Oct 2023 12:39:04 +0100 Subject: [PATCH] Renamed namespace polyMeshCheck -> meshCheck This namespace is to be used for both primitiveMesh, polyMesh and fvMesh checking functions. --- .../manipulation/checkMesh/checkGeometry.C | 12 +++---- .../polyMesh/polyMeshCheck/polyMeshCheck.C | 32 +++++++------------ .../polyMesh/polyMeshCheck/polyMeshCheck.H | 7 ++-- .../meshes/primitiveMesh/primitiveMesh.C | 4 +-- .../meshes/primitiveMesh/primitiveMesh.H | 2 +- .../primitiveMeshCheck/primitiveMeshCheck.C | 17 +++++++--- .../attachPolyTopoChanger.C | 2 +- .../utilities/checkMesh/checkMesh.C | 2 +- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 6ce2b71957..0ed8058f3f 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -550,7 +550,7 @@ Foam::label Foam::checkGeometry ) || ( validDirs == solDirs - && polyMeshCheck::checkEdgeAlignment + && meshCheck::checkEdgeAlignment ( mesh, true, @@ -677,7 +677,7 @@ Foam::label Foam::checkGeometry { faceSet faces(mesh, "nonOrthoFaces", mesh.nFaces()/100+1); - if (polyMeshCheck::checkFaceOrthogonality(mesh, true, &faces)) + if (meshCheck::checkFaceOrthogonality(mesh, true, &faces)) { noFailedChecks++; } @@ -722,7 +722,7 @@ Foam::label Foam::checkGeometry { faceSet faces(mesh, "skewFaces", mesh.nFaces()/100+1); - if (polyMeshCheck::checkFaceSkewness(mesh, true, &faces)) + if (meshCheck::checkFaceSkewness(mesh, true, &faces)) { noFailedChecks++; @@ -897,7 +897,7 @@ Foam::label Foam::checkGeometry if (allGeometry) { cellSet cells(mesh, "underdeterminedCells", mesh.nCells()/100); - if (polyMeshCheck::checkCellDeterminant(mesh, true, &cells)) + if (meshCheck::checkCellDeterminant(mesh, true, &cells)) { noFailedChecks++; @@ -937,7 +937,7 @@ Foam::label Foam::checkGeometry if (allGeometry) { faceSet faces(mesh, "lowWeightFaces", mesh.nFaces()/100); - if (polyMeshCheck::checkFaceWeight(mesh, true, 0.05, &faces)) + if (meshCheck::checkFaceWeight(mesh, true, 0.05, &faces)) { noFailedChecks++; @@ -958,7 +958,7 @@ Foam::label Foam::checkGeometry if (allGeometry) { faceSet faces(mesh, "lowVolRatioFaces", mesh.nFaces()/100); - if (polyMeshCheck::checkVolRatio(mesh, true, 0.01, &faces)) + if (meshCheck::checkVolRatio(mesh, true, 0.01, &faces)) { noFailedChecks++; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C index 9502c55618..a66bcefad0 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C @@ -28,17 +28,9 @@ License #include "unitConversion.H" #include "syncTools.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -Foam::scalar Foam::polyMeshCheck::closedThreshold = 1.0e-6; -Foam::scalar Foam::polyMeshCheck::aspectThreshold = 1000; -Foam::scalar Foam::polyMeshCheck::nonOrthThreshold = 70; // deg -Foam::scalar Foam::polyMeshCheck::skewThreshold = 4; -Foam::scalar Foam::polyMeshCheck::planarCosAngle = 1.0e-6; - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::polyMeshCheck::checkFaceOrthogonality +bool Foam::meshCheck::checkFaceOrthogonality ( const polyMesh& mesh, const bool report, @@ -65,7 +57,7 @@ bool Foam::polyMeshCheck::checkFaceOrthogonality // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(degToRad(polyMeshCheck::nonOrthThreshold)); + ::cos(degToRad(meshCheck::nonOrthThreshold)); scalar minDDotS = great; @@ -134,7 +126,7 @@ bool Foam::polyMeshCheck::checkFaceOrthogonality if (severeNonOrth > 0) { Info<< " *Number of severely non-orthogonal (> " - << polyMeshCheck::nonOrthThreshold << " degrees) faces: " + << meshCheck::nonOrthThreshold << " degrees) faces: " << severeNonOrth << "." << endl; } } @@ -161,7 +153,7 @@ bool Foam::polyMeshCheck::checkFaceOrthogonality } -bool Foam::polyMeshCheck::checkFaceSkewness +bool Foam::meshCheck::checkFaceSkewness ( const polyMesh& mesh, const bool report, @@ -201,7 +193,7 @@ bool Foam::polyMeshCheck::checkFaceSkewness { // Check if the skewness vector is greater than the PN vector. // This does not cause trouble but is a good indication of a poor mesh. - if (skew[facei] > polyMeshCheck::skewThreshold) + if (skew[facei] > meshCheck::skewThreshold) { if (setPtr) { @@ -242,7 +234,7 @@ bool Foam::polyMeshCheck::checkFaceSkewness } -bool Foam::polyMeshCheck::checkEdgeAlignment +bool Foam::meshCheck::checkEdgeAlignment ( const polyMesh& mesh, const bool report, @@ -380,7 +372,7 @@ bool Foam::polyMeshCheck::checkEdgeAlignment } -bool Foam::polyMeshCheck::checkCellDeterminant +bool Foam::meshCheck::checkCellDeterminant ( const polyMesh& mesh, const bool report, @@ -464,7 +456,7 @@ bool Foam::polyMeshCheck::checkCellDeterminant } -bool Foam::polyMeshCheck::checkFaceWeight +bool Foam::meshCheck::checkFaceWeight ( const polyMesh& mesh, const bool report, @@ -561,7 +553,7 @@ bool Foam::polyMeshCheck::checkFaceWeight } -bool Foam::polyMeshCheck::checkVolRatio +bool Foam::meshCheck::checkVolRatio ( const polyMesh& mesh, const bool report, @@ -650,7 +642,7 @@ bool Foam::polyMeshCheck::checkVolRatio } -bool Foam::polyMeshCheck::checkTopology(const polyMesh& mesh, const bool report) +bool Foam::meshCheck::checkTopology(const polyMesh& mesh, const bool report) { label noFailedChecks = 0; @@ -682,7 +674,7 @@ bool Foam::polyMeshCheck::checkTopology(const polyMesh& mesh, const bool report) } -bool Foam::polyMeshCheck::checkGeometry(const polyMesh& mesh, const bool report) +bool Foam::meshCheck::checkGeometry(const polyMesh& mesh, const bool report) { label noFailedChecks = 0; @@ -716,7 +708,7 @@ bool Foam::polyMeshCheck::checkGeometry(const polyMesh& mesh, const bool report) } -bool Foam::polyMeshCheck::checkMesh(const polyMesh& mesh, const bool report) +bool Foam::meshCheck::checkMesh(const polyMesh& mesh, const bool report) { const label noFailedChecks = checkTopology(mesh, report) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.H b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.H index b968950728..d83e93c537 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.H @@ -22,11 +22,10 @@ License along with OpenFOAM. If not, see . Namespace - Foam::polyMeshCheck + Foam::meshCheck Description - SourceFiles polyMeshCheck.C @@ -43,10 +42,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Namespace polyMeshCheck Declaration + Namespace meshCheck Declaration \*---------------------------------------------------------------------------*/ -namespace polyMeshCheck +namespace meshCheck { //- Check non-orthogonality bool checkFaceOrthogonality diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C index 3ad1c30218..ef49edca2a 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License namespace Foam { -defineTypeNameAndDebug(primitiveMesh, 0); + defineTypeNameAndDebug(primitiveMesh, 0); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H index 80401fb043..69c521b692 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H @@ -740,7 +740,7 @@ public: }; -namespace polyMeshCheck +namespace meshCheck { //- Data to control mesh checking diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index e3417b50f8..ed98ad17f1 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -31,6 +31,15 @@ License #include "EdgeMap.H" #include "primitiveMeshTools.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +Foam::scalar Foam::meshCheck::closedThreshold = 1.0e-6; +Foam::scalar Foam::meshCheck::aspectThreshold = 1000; +Foam::scalar Foam::meshCheck::nonOrthThreshold = 70; // deg +Foam::scalar Foam::meshCheck::skewThreshold = 4; +Foam::scalar Foam::meshCheck::planarCosAngle = 1.0e-6; + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::primitiveMesh::checkClosedBoundary @@ -63,7 +72,7 @@ bool Foam::primitiveMesh::checkClosedBoundary vector openness = sumClosed/(sumMagClosedBoundary + vSmall); - if (cmptMax(cmptMag(openness)) > polyMeshCheck::closedThreshold) + if (cmptMax(cmptMag(openness)) > meshCheck::closedThreshold) { if (debug || report) { @@ -156,7 +165,7 @@ bool Foam::primitiveMesh::checkClosedCells // Check the sums forAll(openness, celli) { - if (openness[celli] > polyMeshCheck::closedThreshold) + if (openness[celli] > meshCheck::closedThreshold) { if (setPtr) { @@ -166,7 +175,7 @@ bool Foam::primitiveMesh::checkClosedCells nOpen++; } - if (aspectRatio[celli] > polyMeshCheck::aspectThreshold) + if (aspectRatio[celli] > meshCheck::aspectThreshold) { if (aspectSetPtr) { @@ -674,7 +683,7 @@ bool Foam::primitiveMesh::checkConcaveCells pC /= max(mag(pC), vSmall); - if ((pC & fN) > -polyMeshCheck::planarCosAngle) + if ((pC & fN) > -meshCheck::planarCosAngle) { // Concave or planar face diff --git a/src/dynamicMesh/polyTopoChange/attachPolyTopoChanger/attachPolyTopoChanger.C b/src/dynamicMesh/polyTopoChange/attachPolyTopoChanger/attachPolyTopoChanger.C index 57d0589c2b..9281f0f5b1 100644 --- a/src/dynamicMesh/polyTopoChange/attachPolyTopoChanger/attachPolyTopoChanger.C +++ b/src/dynamicMesh/polyTopoChange/attachPolyTopoChanger/attachPolyTopoChanger.C @@ -120,7 +120,7 @@ void Foam::attachPolyTopoChanger::attach(const bool removeEmptyPatches) << "Finished attaching mesh" << endl; } - polyMeshCheck::checkMesh(mesh_); + meshCheck::checkMesh(mesh_); } diff --git a/src/functionObjects/utilities/checkMesh/checkMesh.C b/src/functionObjects/utilities/checkMesh/checkMesh.C index 7fd7265483..190ede7d8a 100644 --- a/src/functionObjects/utilities/checkMesh/checkMesh.C +++ b/src/functionObjects/utilities/checkMesh/checkMesh.C @@ -67,7 +67,7 @@ bool Foam::functionObjects::checkMesh::execute() { if (mesh_.changing()) { - return polyMeshCheck::checkMesh(mesh_, true); + return meshCheck::checkMesh(mesh_, true); } else {