From 3feae1f3f6955ae8cb9228c325e4db00de99acda Mon Sep 17 00:00:00 2001 From: mattijs <mattijs@hunt.opencfd.co.uk> Date: Wed, 8 Oct 2008 11:41:38 +0100 Subject: [PATCH] extraneous copy --- .../manipulation/checkMesh.save/Make/files | 6 - .../manipulation/checkMesh.save/Make/options | 5 - .../checkMesh.save/checkGeometry.C | 220 ---------------- .../checkMesh.save/checkGeometry.H | 13 - .../manipulation/checkMesh.save/checkMesh.C | 152 ----------- .../checkMesh.save/checkTopology.C | 236 ------------------ .../checkMesh.save/checkTopology.H | 8 - .../checkMesh.save/printMeshStats.C | 95 ------- .../checkMesh.save/printMeshStats.H | 6 - 9 files changed, 741 deletions(-) delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/Make/files delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/Make/options delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.C delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.H delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/checkMesh.C delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.C delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.H delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.C delete mode 100644 applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.H diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/Make/files b/applications/utilities/mesh/manipulation/checkMesh.save/Make/files deleted file mode 100644 index f0b7c166946..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/Make/files +++ /dev/null @@ -1,6 +0,0 @@ -printMeshStats.C -checkTopology.C -checkGeometry.C -checkMesh.C - -EXE = $(FOAM_APPBIN)/checkMesh diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/Make/options b/applications/utilities/mesh/manipulation/checkMesh.save/Make/options deleted file mode 100644 index 54c035b8f55..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/Make/options +++ /dev/null @@ -1,5 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lmeshTools diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.C deleted file mode 100644 index 9eb4ef63ad7..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.C +++ /dev/null @@ -1,220 +0,0 @@ -#include "checkGeometry.H" -#include "polyMesh.H" -#include "globalMeshData.H" -#include "cellSet.H" -#include "faceSet.H" -#include "pointSet.H" - -Foam::label Foam::checkGeometry -( - const polyMesh& mesh, - bool checkPointNearness, - bool checkCellDeterminant -) -{ - label noFailedChecks = 0; - - Info<< "\nChecking geometry..." << endl; - - boundBox bb(mesh.points()); - - Pout<< " Domain bounding box: " - << bb.min() << " " << bb.max() << endl; - - // Get a small relative length from the bounding box - const boundBox& globalBb = mesh.globalData().bb(); - - if (Pstream::parRun()) - { - Info<< " Overall domain bounding box: " - << globalBb.min() << " " << globalBb.max() << endl; - } - - - // Min length - scalar minDistSqr = magSqr(1e-6*(globalBb.max() - globalBb.min())); - - - if (mesh.checkClosedBoundary(true)) noFailedChecks++; - - { - cellSet cells(mesh, "nonClosedCells", mesh.nCells()/100+1); - cellSet aspectCells(mesh, "highAspectRatioCells", mesh.nCells()/100+1); - if (mesh.checkClosedCells(true, &cells, &aspectCells)) - { - noFailedChecks++; - - if (cells.size() > 0) - { - Pout<< " <<Writing " << cells.size() - << " non closed cells to set " << cells.name() << endl; - cells.write(); - } - } - if (aspectCells.size() > 0) - { - Pout<< " <<Writing " << aspectCells.size() - << " cells with high aspect ratio to set " - << aspectCells.name() << endl; - aspectCells.write(); - } - } - - { - faceSet faces(mesh, "zeroAreaFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFaceAreas(true, &faces)) - { - noFailedChecks++; - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " zero area faces to set " << faces.name() << endl; - faces.write(); - } - } - } - - { - cellSet cells(mesh, "zeroVolumeCells", mesh.nCells()/100 + 1); - if (mesh.checkCellVolumes(true, &cells)) - { - noFailedChecks++; - - if (cells.size() > 0) - { - Pout<< " <<Writing " << cells.size() - << " zero volume cells to set " << cells.name() << endl; - cells.write(); - } - } - } - - { - faceSet faces(mesh, "nonOrthoFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFaceOrthogonality(true, &faces)) - { - noFailedChecks++; - } - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " non-orthogonal faces to set " << faces.name() << endl; - faces.write(); - } - } - - - { - faceSet faces(mesh, "wrongOrientedFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFacePyramids(true, -SMALL, &faces)) - { - noFailedChecks++; - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " faces with incorrect orientation to set " - << faces.name() << endl; - faces.write(); - } - } - } - - { - faceSet faces(mesh, "skewFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFaceSkewness(true, &faces)) - { - noFailedChecks++; - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " skew faces to set " << faces.name() << endl; - faces.write(); - } - } - } - - if (checkPointNearness) - { - // Note use of nPoints since don't want edge construction. - pointSet points(mesh, "shortEdges", mesh.nPoints()/1000 + 1); - if (mesh.checkEdgeLength(true, minDistSqr, &points)) - { - //noFailedChecks++; - - if (points.size() > 0) - { - Pout<< " <<Writing " << points.size() - << " points on short edges to set " << points.name() - << endl; - points.write(); - } - } - - label nEdgeClose = points.size(); - - if (mesh.checkPointNearness(false, minDistSqr, &points)) - { - //noFailedChecks++; - - if (points.size() > nEdgeClose) - { - pointSet nearPoints(mesh, "nearPoints", points); - Pout<< " <<Writing " << nearPoints.size() - << " near (closer than " << Foam::sqrt(minDistSqr) - << " apart) points to set " << nearPoints.name() << endl; - nearPoints.write(); - } - } - } - - { - faceSet faces(mesh, "concaveFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFaceAngles(true, 10, &faces)) - { - //noFailedChecks++; - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " faces with concave angles to set " << faces.name() - << endl; - faces.write(); - } - } - } - - { - faceSet faces(mesh, "warpedFaces", mesh.nFaces()/100 + 1); - if (mesh.checkFaceFlatness(true, 0.8, &faces)) - { - //noFailedChecks++; - - if (faces.size() > 0) - { - Pout<< " <<Writing " << faces.size() - << " warped faces to set " << faces.name() << endl; - faces.write(); - } - } - } - - if (checkCellDeterminant) - { - cellSet cells(mesh, "underdeterminedCells", mesh.nCells()/100); - if (mesh.checkCellDeterminant(true, &cells)) - { - noFailedChecks++; - - Pout<< " <<Writing " << cells.size() - << " under-determines cells to set " << cells.name() << endl; - cells.write(); - } - } - - - return noFailedChecks; -} diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.H b/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.H deleted file mode 100644 index 791b007820d..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/checkGeometry.H +++ /dev/null @@ -1,13 +0,0 @@ -#include "label.H" - -namespace Foam -{ - class polyMesh; - - label checkGeometry - ( - const polyMesh& mesh, - bool checkPointNearness, - bool checkCellDeterminant - ); -} diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh.save/checkMesh.C deleted file mode 100644 index ec598b4c215..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/checkMesh.C +++ /dev/null @@ -1,152 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Application - checkMesh - -Description - Checks validity of a mesh - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "polyMesh.H" -#include "globalMeshData.H" - -#include "printMeshStats.H" -#include "checkTopology.H" -#include "checkGeometry.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - -# include "addTimeOptionsNoConstant.H" - - argList::validOptions.insert("fullTopology", ""); - argList::validOptions.insert("pointNearness", ""); - argList::validOptions.insert("cellDeterminant", ""); - -# include "setRootCase.H" -# include "createTime.H" - - // Get times list - instantList Times = runTime.times(); - -# include "checkTimeOptionsNoConstant.H" - - runTime.setTime(Times[startTime], startTime); - -# include "createPolyMesh.H" - - bool firstCheck = true; - - for (label i=startTime; i<endTime; i++) - { - runTime.setTime(Times[i], i); - - polyMesh::readUpdateState state = mesh.readUpdate(); - - if - ( - firstCheck - || state == polyMesh::TOPO_CHANGE - || state == polyMesh::TOPO_PATCH_CHANGE - ) - { - firstCheck = false; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Clear mesh before checking - mesh.clearOut(); - - // Reconstruct globalMeshData - mesh.globalData(); - - printMeshStats(mesh); - - label noFailedChecks = 0; - - noFailedChecks += checkTopology - ( - mesh, - args.options().found("fullTopology") - ); - - noFailedChecks += checkGeometry - ( - mesh, - args.options().found("pointNearness"), - args.options().found("cellDeterminant") - ); - - reduce(noFailedChecks, sumOp<label>()); - - if (noFailedChecks == 0) - { - Info<< "\nMesh OK." - << nl << endl; - } - else - { - Info<< "\nFailed " << noFailedChecks << " mesh checks." - << nl << endl; - } - } - else if (state == polyMesh::POINTS_MOVED) - { - label noFailedChecks = checkGeometry - ( - mesh, - args.options().found("pointNearness"), - args.options().found("cellDeterminant") - ); - - reduce(noFailedChecks, sumOp<label>()); - - if (noFailedChecks == 0) - { - Info << "\nMesh OK." - << nl << endl; - } - else - { - Info<< "\nFailed " << noFailedChecks << " mesh checks." - << nl << endl; - } - } - } - - Info<< "End\n" << endl; - - return(0); -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.C deleted file mode 100644 index 885c5f36aa9..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.C +++ /dev/null @@ -1,236 +0,0 @@ -#include "checkTopology.H" -#include "polyMesh.H" -#include "Time.H" -#include "regionSplit.H" -#include "cellSet.H" -#include "faceSet.H" -#include "pointSet.H" -#include "IOmanip.H" - -Foam::label Foam::checkTopology(const polyMesh& mesh, bool fullTopology) -{ - label noFailedChecks = 0; - - Pout<< "Checking topology..." << endl; - - // Check if the boundary definition is unique - mesh.boundaryMesh().checkDefinition(true); - - // Check if the boundary processor patches are correct - mesh.boundaryMesh().checkParallelSync(true); - - { - pointSet points(mesh, "unusedPoints", mesh.nPoints()/100); - if (mesh.checkPoints(true, &points)) - { - noFailedChecks++; - - Pout<< " <<Writing " << points.size() - << " unused points to set " << points.name() << endl; - points.write(); - } - } - - { - faceSet faces(mesh, "upperTriangularFace", mesh.nFaces()/100); - if (mesh.checkUpperTriangular(true, &faces)) - { - noFailedChecks++; - - Pout<< " <<Writing " << faces.size() - << " unordered faces to set " << faces.name() << endl; - faces.write(); - } - } - - { - cellSet cells(mesh, "zipUpCells", mesh.nCells()/100); - if (mesh.checkCellsZipUp(true, &cells)) - { - noFailedChecks++; - - Pout<< " <<Writing " << cells.size() - << " cells with over used edges to set " << cells.name() - << endl; - cells.write(); - } - } - - { - faceSet faces(mesh, "outOfRangeFaces", mesh.nFaces()/100); - if (mesh.checkFaceVertices(true, &faces)) - { - noFailedChecks++; - - Pout<< " <<Writing " << faces.size() - << " faces with out-of-range vertices to set " << faces.name() - << endl; - faces.write(); - } - } - - { - faceSet faces(mesh, "edgeFaces", mesh.nFaces()/100); - if (mesh.checkFaceFaces(true, &faces)) - { - noFailedChecks++; - - Pout<< " <<Writing " << faces.size() - << " faces with incorrect edges to set " << faces.name() - << endl; - faces.write(); - } - } - - { - regionSplit rs(mesh); - - if (rs.nRegions() == 1) - { - Info<< " Number of regions: " << rs.nRegions() << " (OK)." - << endl; - - } - else - { - Info<< " *Number of regions: " << rs.nRegions() << endl; - - Info<< " The mesh has multiple regions which are not connected " - "by any face." << endl - << " <<Writing region information to " - << mesh.time().timeName()/"cellToRegion" - << endl; - - labelIOList ctr - ( - IOobject - ( - "cellToRegion", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - rs - ); - ctr.write(); - } - } - - if (!Pstream::parRun()) - { - Pout<< "\nChecking patch topology for multiply connected surfaces ..." - << endl; - - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - - // Non-manifold points - pointSet points - ( - mesh, - "nonManifoldPoints", - mesh.nPoints()/100 - ); - - Pout.setf(ios_base::left); - - Pout<< " " - << setw(20) << "Patch" - << setw(9) << "Faces" - << setw(9) << "Points" - << " Surface" << endl; - - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - primitivePatch::surfaceTopo pTyp = pp.surfaceType(); - - if (pp.size() == 0) - { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (empty)" << endl; - } - else if (pTyp == primitivePatch::MANIFOLD) - { - if (pp.checkPointManifold(true, &points)) - { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected (shared point)" << endl; - } - else - { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (closed singly connected surface)" << endl; - } - - // Add points on non-manifold edges to make set complete - pp.checkTopology(false, &points); - } - else - { - pp.checkTopology(false, &points); - - if (pTyp == primitivePatch::OPEN) - { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (not multiply connected)" << endl; - } - else - { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected surface (shared edge)" - << endl; - } - } - } - - if (points.size() > 0) - { - Pout<< " <<Writing " << points.size() - << " conflicting points to set " - << points.name() << endl; - - points.write(); - } - - //Pout.setf(ios_base::right); - } - - // Force creation of all addressing if requested. - // Errors will be reported as required - if (fullTopology) - { - mesh.cells(); - mesh.faces(); - mesh.edges(); - mesh.points(); - mesh.faceOwner(); - mesh.faceNeighbour(); - mesh.cellCells(); - mesh.edgeCells(); - mesh.pointCells(); - mesh.edgeFaces(); - mesh.pointFaces(); - mesh.cellEdges(); - mesh.faceEdges(); - mesh.pointEdges(); - } - - return noFailedChecks; -} diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.H b/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.H deleted file mode 100644 index 6db7e0d3c50..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/checkTopology.H +++ /dev/null @@ -1,8 +0,0 @@ -#include "label.H" - -namespace Foam -{ - class polyMesh; - - label checkTopology(const polyMesh& mesh, bool fullTopology); -} diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.C b/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.C deleted file mode 100644 index 30da859db62..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.C +++ /dev/null @@ -1,95 +0,0 @@ -#include "printMeshStats.H" -#include "polyMesh.H" -#include "globalMeshData.H" - -#include "hexMatcher.H" -#include "wedgeMatcher.H" -#include "prismMatcher.H" -#include "pyrMatcher.H" -#include "tetWedgeMatcher.H" -#include "tetMatcher.H" - - -void Foam::printMeshStats(const polyMesh& mesh) -{ - Pout<< "Mesh stats" << nl - << " points: " << mesh.points().size() << nl - << " faces: " << mesh.faces().size() << nl - << " internal faces: " << mesh.faceNeighbour().size() << nl - << " cells: " << mesh.cells().size() << nl - << " boundary patches: " << mesh.boundaryMesh().size() << nl - << " point zones: " << mesh.pointZones().size() << nl - << " face zones: " << mesh.faceZones().size() << nl - << " cell zones: " << mesh.cellZones().size() << nl - << endl; - - if (Pstream::parRun()) - { - const globalMeshData& parData = mesh.globalData(); - - Info<< "Overall stats" << nl - << " points: " << parData.nTotalPoints() << nl - << " faces: " << parData.nTotalFaces() << nl - << " cells: " << parData.nTotalCells() << nl - << endl; - } - - // Construct shape recognizers - hexMatcher hex; - prismMatcher prism; - wedgeMatcher wedge; - pyrMatcher pyr; - tetWedgeMatcher tetWedge; - tetMatcher tet; - - // Counters for different cell types - label nHex = 0; - label nWedge = 0; - label nPrism = 0; - label nPyr = 0; - label nTet = 0; - label nTetWedge = 0; - label nUnknown = 0; - - for(label cellI = 0; cellI < mesh.nCells(); cellI++) - { - if (hex.isA(mesh, cellI)) - { - nHex++; - } - else if (tet.isA(mesh, cellI)) - { - nTet++; - } - else if (pyr.isA(mesh, cellI)) - { - nPyr++; - } - else if (prism.isA(mesh, cellI)) - { - nPrism++; - } - else if (wedge.isA(mesh, cellI)) - { - nWedge++; - } - else if (tetWedge.isA(mesh, cellI)) - { - nTetWedge++; - } - else - { - nUnknown++; - } - } - - Pout<< "Number of cells of each type: " << nl - << " hexahedra: " << nHex << nl - << " prisms: " << nPrism << nl - << " wedges: " << nWedge << nl - << " pyramids: " << nPyr << nl - << " tet wedges: " << nTetWedge << nl - << " tetrahedra: " << nTet << nl - << " polyhedra: " << nUnknown - << nl << endl; -} diff --git a/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.H b/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.H deleted file mode 100644 index 2da12011883..00000000000 --- a/applications/utilities/mesh/manipulation/checkMesh.save/printMeshStats.H +++ /dev/null @@ -1,6 +0,0 @@ -namespace Foam -{ - class polyMesh; - - void printMeshStats(const polyMesh& mesh); -} -- GitLab