diff --git a/applications/test/globalMeshData/Make/files b/applications/test/globalMeshData/Make/files index 80e30e0d4a..cb776b3445 100644 --- a/applications/test/globalMeshData/Make/files +++ b/applications/test/globalMeshData/Make/files @@ -1,3 +1,3 @@ -Test-globalMeshData.C +Test-globalMeshData.cxx EXE = $(FOAM_USER_APPBIN)/Test-globalMeshData diff --git a/applications/test/globalMeshData/Test-globalMeshData.C b/applications/test/globalMeshData/Test-globalMeshData.cxx similarity index 97% rename from applications/test/globalMeshData/Test-globalMeshData.C rename to applications/test/globalMeshData/Test-globalMeshData.cxx index ffc357a549..b078620065 100644 --- a/applications/test/globalMeshData/Test-globalMeshData.C +++ b/applications/test/globalMeshData/Test-globalMeshData.cxx @@ -182,18 +182,11 @@ int main(int argc, char *argv[]) const labelListList& transformedSlaves = globalData.globalPointTransformedBoundaryFaces(); - const label nBnd = mesh.nBoundaryFaces(); - pointField fc(globalPointBoundaryFacesMap.constructSize()); - SubList(fc, nBnd) = + pointField::subList(fc, mesh.nBoundaryFaces()) = primitivePatch ( - SubList - ( - mesh.faces(), - nBnd, - mesh.nInternalFaces() - ), + mesh.boundaryMesh().faces(), mesh.points() ).faceCentres(); diff --git a/applications/test/syncTools/Make/files b/applications/test/syncTools/Make/files index a9c9a0e013..a1ddebcb63 100644 --- a/applications/test/syncTools/Make/files +++ b/applications/test/syncTools/Make/files @@ -1,3 +1,3 @@ -Test-syncTools.C +Test-syncTools.cxx EXE = $(FOAM_USER_APPBIN)/Test-syncTools diff --git a/applications/test/syncTools/Test-syncTools.C b/applications/test/syncTools/Test-syncTools.cxx similarity index 99% rename from applications/test/syncTools/Test-syncTools.C rename to applications/test/syncTools/Test-syncTools.cxx index 70c288274d..05bcbf46e2 100644 --- a/applications/test/syncTools/Test-syncTools.C +++ b/applications/test/syncTools/Test-syncTools.cxx @@ -195,16 +195,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) << "Position test of sparse data only correct for cases without cyclics" << " with shared points." << endl; - primitivePatch allBoundary - ( - SubList - ( - mesh.faces(), - mesh.nBoundaryFaces(), - mesh.nInternalFaces() - ), - mesh.points() - ); + primitivePatch allBoundary(mesh.boundaryMesh().faces(), mesh.points()); const pointField& localPoints = allBoundary.localPoints(); diff --git a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C index 34f157dfa0..cdce544196 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C +++ b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C @@ -417,14 +417,7 @@ int main(int argc, char *argv[]) // Get calculating engine for all of outside - const SubList outsideFaces - ( - mesh.faces(), - mesh.nBoundaryFaces(), - mesh.nInternalFaces() - ); - - primitivePatch allBoundary(outsideFaces, mesh.points()); + primitivePatch allBoundary(mesh.boundaryMesh().faces(), mesh.points()); // Look up mesh labels and convert to input for boundaryCutter. diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshVTK.H b/applications/utilities/mesh/generation/blockMesh/blockMeshVTK.H index e46205b7bc..b35c2a76c9 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshVTK.H +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshVTK.H @@ -104,18 +104,13 @@ const polyMesh& topoMesh = topoMeshPtr(); // Block boundary faces { - const label nIntFaces = topoMesh.nInternalFaces(); + const auto& patches = topoMesh.boundaryMesh(); const label nBndFaces = topoMesh.nBoundaryFaces(); - faceList bndFaces - ( - faceList::subList(topoMesh.faces(), nBndFaces, nIntFaces) - ); - vtk::surfaceWriter writer ( topoMesh.points(), - bndFaces, + faceList(patches.faces()), vtk::formatType::INLINE_ASCII, runTime.path()/"blockFaces" ); @@ -132,7 +127,7 @@ const polyMesh& topoMesh = topoMeshPtr(); for (const polyPatch& pp : patches) { - label bndFacei = pp.start() - nIntFaces; + label bndFacei = pp.offset(); label meshFacei = pp.start(); forAll(pp, bfacei) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C index 4a93e7117b..364613e238 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C @@ -608,12 +608,7 @@ void Foam::backgroundMeshDecomposition::buildPatchAndTree() { primitivePatch tmpBoundaryFaces ( - SubList - ( - mesh_.faces(), - mesh_.nBoundaryFaces(), - mesh_.nInternalFaces() - ), + mesh_.boundaryMesh().faces(), mesh_.points() ); diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C index 971e5fa169..14eebe1ec8 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016,2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -137,16 +137,7 @@ void simpleMarkFeatures // multiple 'half' cells. // Addressing for all outside faces - primitivePatch allBoundary - ( - SubList - ( - mesh.faces(), - mesh.nBoundaryFaces(), - mesh.nInternalFaces() - ), - mesh.points() - ); + primitivePatch allBoundary(patches.faces(), mesh.points()); // Check for non-manifold points (surface pinched at point) allBoundary.checkPointManifold(false, &singleCellFeaturePointSet); @@ -240,7 +231,9 @@ void simpleMarkFeatures // ~~~~~~~~~~~~~~~~~~~~~~~~~ // Face centres that need inclusion in the dual mesh - labelHashSet featureFaceSet(mesh.nBoundaryFaces()); + labelHashSet featureFaceSet; + featureFaceSet.reserve(mesh.nBoundaryFaces()); + // A. boundary faces. for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++) { diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/meshPointPatch/meshPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/meshPointPatch/meshPointPatch.C index 2e9c845c75..c86861ac92 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/meshPointPatch/meshPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/meshPointPatch/meshPointPatch.C @@ -160,14 +160,7 @@ void Foam::meshPointPatch::movePoints(PstreamBuffers&, const pointField& p) // Recalculate the point normals? Something like //if (owner()) //{ - // const SubList subFaces - // ( - // mesh.faces(), - // mesh.nBoundaryFaces(), - // mesh.nInternalFaces() - // ); - // const primitivePatch pp(subFaces, mesh.points()); - // + // const primitivePatch pp(mesh.boundaryMesh().faces(), mesh.points()); // // for (const label pointi : meshPoints()) // { @@ -180,9 +173,8 @@ void Foam::meshPointPatch::movePoints(PstreamBuffers&, const pointField& p) // const auto& point // // - } - + void Foam::meshPointPatch::updateMesh(PstreamBuffers&) { diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index db304f4b2e..ca3c41504e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2024 OpenCFD Ltd. + Copyright (C) 2018-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -91,7 +91,7 @@ Foam::polyPatch::polyPatch patchIdentifier(name, index), primitivePatch ( - faceSubList(bm.mesh().faces(), size, start), + SubList(bm.mesh().faces(), size, start), bm.mesh().points() ), start_(start), @@ -118,7 +118,7 @@ Foam::polyPatch::polyPatch patchIdentifier(name, index, physicalType, inGroups), primitivePatch ( - faceSubList(bm.mesh().faces(), size, start), + SubList(bm.mesh().faces(), size, start), bm.mesh().points() ), start_(start), @@ -138,7 +138,7 @@ Foam::polyPatch::polyPatch patchIdentifier(name, dict, index), primitivePatch ( - faceSubList + SubList ( bm.mesh().faces(), dict.get