diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index c9b6517778..01e5882e4e 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ Description #include "argList.H" #include "polyMesh.H" #include "Time.H" -#include "boundaryMesh.H" +#include "repatchMesh.H" #include "repatchPolyTopoChanger.H" #include "unitConversion.H" #include "OFstream.H" @@ -44,21 +44,21 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Get all feature edges. -void collectFeatureEdges(const boundaryMesh& bMesh, labelList& markedEdges) +void collectFeatureEdges(const repatchMesh& rMesh, labelList& markedEdges) { - markedEdges.setSize(bMesh.mesh().nEdges()); + markedEdges.setSize(rMesh.mesh().nEdges()); label markedI = 0; - forAll(bMesh.featureSegments(), i) + forAll(rMesh.featureSegments(), i) { - const labelList& segment = bMesh.featureSegments()[i]; + const labelList& segment = rMesh.featureSegments()[i]; forAll(segment, j) { label featEdgeI = segment[j]; - label meshEdgeI = bMesh.featureToEdge()[featEdgeI]; + label meshEdgeI = rMesh.featureToEdge()[featEdgeI]; markedEdges[markedI++] = meshEdgeI; } @@ -95,24 +95,24 @@ int main(int argc, char *argv[]) << endl; // - // Use boundaryMesh to reuse all the featureEdge stuff in there. + // Use repatchMesh to reuse all the featureEdge stuff in there. // - boundaryMesh bMesh; - bMesh.read(mesh); + repatchMesh rMesh; + rMesh.read(mesh); // Set feature angle (calculate feature edges) - bMesh.setFeatureEdges(minCos); + rMesh.setFeatureEdges(minCos); // Collect all feature edges as edge labels labelList markedEdges; - collectFeatureEdges(bMesh, markedEdges); + collectFeatureEdges(rMesh, markedEdges); // (new) patch ID for every face in mesh. - labelList patchIDs(bMesh.mesh().size(), -1); + labelList patchIDs(rMesh.mesh().size(), -1); // // Fill patchIDs with values for every face by floodfilling without @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) // // Current patch number. - label newPatchi = bMesh.patches().size(); + label newPatchi = rMesh.patches().size(); label suffix = 0; @@ -141,17 +141,17 @@ int main(int argc, char *argv[]) { patchName = "auto" + name(suffix++); } - while (bMesh.findPatchID(patchName) != -1); + while (rMesh.findPatchID(patchName) != -1); - bMesh.addPatch(patchName); + rMesh.addPatch(patchName); - bMesh.changePatchType(patchName, "patch"); + rMesh.changePatchType(patchName, "patch"); // Fill visited with all faces reachable from unsetFacei. - boolList visited(bMesh.mesh().size()); + boolList visited(rMesh.mesh().size()); - bMesh.markFaces(markedEdges, unsetFacei, visited); + rMesh.markFaces(markedEdges, unsetFacei, visited); // Assign all visited faces to current patch @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) - const PtrList& patches = bMesh.patches(); + const PtrList& patches = rMesh.patches(); // Create new list of patches with old ones first List newPatchPtrList(patches.size()); @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) // Add new ones with empty size. for (label patchi = newPatchi; patchi < patches.size(); patchi++) { - const boundaryPatch& bp = patches[patchi]; + const repatchPatch& bp = patches[patchi]; newPatchPtrList[newPatchi] = polyPatch::New ( @@ -230,9 +230,9 @@ int main(int argc, char *argv[]) // Change face ordering - // Since bMesh read from mesh there is one to one mapping so we don't + // Since rMesh read from mesh there is one to one mapping so we don't // have to do the geometric stuff. - const labelList& meshFace = bMesh.meshFace(); + const labelList& meshFace = rMesh.meshFace(); forAll(patchIDs, facei) { diff --git a/applications/utilities/surface/surfaceToPatch/Make/options b/applications/utilities/surface/surfaceToPatch/Make/options index 6b0ab4880e..39929ff890 100644 --- a/applications/utilities/surface/surfaceToPatch/Make/options +++ b/applications/utilities/surface/surfaceToPatch/Make/options @@ -3,7 +3,6 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude - EXE_LIBS = \ -ltriSurface \ -lmeshTools \ diff --git a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C index 308dd14787..2cd7da6e4c 100644 --- a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C +++ b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,14 +25,14 @@ Application surfaceToPatch Description - Reads surface and applies surface regioning to a mesh. Uses boundaryMesh + Reads surface and applies surface regioning to a mesh. Uses repatchMesh to do the hard work. \*---------------------------------------------------------------------------*/ #include "argList.H" #include "Time.H" -#include "boundaryMesh.H" +#include "repatchMesh.H" #include "polyMesh.H" #include "faceSet.H" #include "polyTopoChange.H" @@ -103,7 +103,7 @@ label addPatch(polyMesh& mesh, const word& patchName) bool repatchFace ( const polyMesh& mesh, - const boundaryMesh& bMesh, + const repatchMesh& rMesh, const labelList& nearest, const labelList& surfToMeshPatch, const label facei, @@ -117,9 +117,9 @@ bool repatchFace if (nearest[bFacei] != -1) { // Use boundary mesh one. - label bMeshPatchID = bMesh.whichPatch(nearest[bFacei]); + label rMeshPatchID = rMesh.whichPatch(nearest[bFacei]); - label patchID = surfToMeshPatch[bMeshPatchID]; + label patchID = surfToMeshPatch[rMeshPatchID]; if (patchID != mesh.boundaryMesh().whichPatch(facei)) { @@ -230,13 +230,13 @@ int main(int argc, char *argv[]) Info<< endl; - boundaryMesh bMesh; + repatchMesh rMesh; // Load in the surface. - bMesh.readTriSurface(surfName); + rMesh.readTriSurface(surfName); // Add all the boundaryMesh patches to the mesh. - const PtrList& bPatches = bMesh.patches(); + const PtrList& bPatches = rMesh.patches(); // Map from surface patch ( = boundaryMesh patch) to polyMesh patch labelList patchMap(bPatches.size()); @@ -246,10 +246,10 @@ int main(int argc, char *argv[]) patchMap[i] = addPatch(mesh, bPatches[i].name()); } - // Obtain nearest face in bMesh for each boundary face in mesh that + // Obtain nearest face in rMesh for each boundary face in mesh that // is within search span. // Note: should only determine for faceSet if working with that. - labelList nearest(bMesh.getNearest(mesh, searchSpan)); + labelList nearest(rMesh.getNearest(mesh, searchSpan)); { // Dump unmatched faces to faceSet for debugging. @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) { label facei = iter.key(); - if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod)) + if (repatchFace(mesh, rMesh, nearest, patchMap, facei, meshMod)) { nChanged++; } @@ -297,7 +297,7 @@ int main(int argc, char *argv[]) { label facei = mesh.nInternalFaces() + bFacei; - if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod)) + if (repatchFace(mesh, rMesh, nearest, patchMap, facei, meshMod)) { nChanged++; } diff --git a/src/dynamicMesh/Make/files b/src/dynamicMesh/Make/files index e6720f3723..3313fbb444 100644 --- a/src/dynamicMesh/Make/files +++ b/src/dynamicMesh/Make/files @@ -53,8 +53,9 @@ slidingInterface/decoupleSlidingInterface.C perfectInterface/perfectInterface.C -boundaryMesh/boundaryMesh.C -boundaryPatch/boundaryPatch.C +repatchMesh/repatchMesh.C +repatchMesh/repatchPatch.C + setUpdater/setUpdater.C meshModifiers = meshCut/meshModifiers diff --git a/src/dynamicMesh/boundaryMesh/bMesh.H b/src/dynamicMesh/boundaryMesh/bMesh.H deleted file mode 100644 index e2bb1dbb06..0000000000 --- a/src/dynamicMesh/boundaryMesh/bMesh.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation - \\/ 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 3 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, see . - -Typedef - Foam::bMesh - -Description - Holder of faceList and points. (v.s. e.g. primitivePatch which references - points) - -\*---------------------------------------------------------------------------*/ - -#ifndef bMesh_H -#define bMesh_H - -#include "PrimitivePatch.H" -#include "faceList.H" -#include "pointField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - typedef PrimitivePatch bMesh; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.C b/src/dynamicMesh/repatchMesh/repatchMesh.C similarity index 62% rename from src/dynamicMesh/boundaryMesh/boundaryMesh.C rename to src/dynamicMesh/repatchMesh/repatchMesh.C index 0e975379ef..31ac807fcc 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.C +++ b/src/dynamicMesh/repatchMesh/repatchMesh.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "boundaryMesh.H" +#include "repatchMesh.H" #include "Time.H" #include "polyMesh.H" #include "repatchPolyTopoChanger.H" @@ -39,20 +39,20 @@ License namespace Foam { -defineTypeNameAndDebug(boundaryMesh, 0); +defineTypeNameAndDebug(repatchMesh, 0); // Normal along which to divide faces into categories (used in getNearest) -const vector boundaryMesh::splitNormal_(3, 2, 1); +const vector repatchMesh::splitNormal_(3, 2, 1); // Distance to face tolerance for getNearest -const scalar boundaryMesh::distanceTol_ = 1e-2; +const scalar repatchMesh::distanceTol_ = 1e-2; } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Returns number of feature edges connected to pointi -Foam::label Foam::boundaryMesh::nFeatureEdges(label pointi) const +Foam::label Foam::repatchMesh::nFeatureEdges(label pointi) const { label nFeats = 0; @@ -72,7 +72,7 @@ Foam::label Foam::boundaryMesh::nFeatureEdges(label pointi) const // Returns next feature edge connected to pointi -Foam::label Foam::boundaryMesh::nextFeatureEdge +Foam::label Foam::repatchMesh::nextFeatureEdge ( const label edgeI, const label vertI @@ -102,7 +102,7 @@ Foam::label Foam::boundaryMesh::nextFeatureEdge // Finds connected feature edges, starting from startPointi and returns // feature labels (not edge labels). Marks feature edges handled in // featVisited. -Foam::labelList Foam::boundaryMesh::collectSegment +Foam::labelList Foam::repatchMesh::collectSegment ( const boolList& isFeaturePoint, const label startEdgeI, @@ -189,119 +189,9 @@ Foam::labelList Foam::boundaryMesh::collectSegment } -void Foam::boundaryMesh::markEdges -( - const label maxDistance, - const label edgeI, - const label distance, - labelList& minDistance, - DynamicList