diff --git a/applications/test/primitivePatch/Test-PrimitivePatch.C b/applications/test/primitivePatch/Test-PrimitivePatch.C index a74deb4bdf..e53f81b409 100644 --- a/applications/test/primitivePatch/Test-PrimitivePatch.C +++ b/applications/test/primitivePatch/Test-PrimitivePatch.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,6 +34,7 @@ Description #include "polyMesh.H" #include "primitiveFacePatch.H" #include "primitivePatch.H" +#include "IndirectList.H" #include "Fstream.H" using namespace Foam; @@ -242,6 +243,28 @@ int main(int argc, char *argv[]) writeEdgeFaces(localPoints, localFaces, edges, edgeFaces); writeFaceFaces(localPoints, localFaces, faceFaces); + + const labelList bndFaceIds(pp.boundaryFaces()); + + Info<< "Have: " << bndFaceIds.size() << " boundary faces" << nl; + + // Can calculate by hand + if (!pp.hasFaceCentres()) + { + pointField boundaryCentres(bndFaceIds.size()); + + forAll(bndFaceIds, facei) + { + boundaryCentres[facei] = + pp[bndFaceIds[facei]].centre(pp.points()); + } + Info << "calc faceCentres:" + << boundaryCentres << nl; + } + + // But will often use the cached information + Info<< "faceCentres:" + << UIndirectList(pp.faceCentres(), bndFaceIds) << nl; } // Move construct diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 4ca6562acf..e7b0357b08 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -655,7 +655,7 @@ $(mapPolyMesh)/mapDistribute/IOmapDistribute.C $(mapPolyMesh)/mapAddedPolyMesh.C PrimitivePatch = $(primitiveMesh)/PrimitivePatch -$(PrimitivePatch)/PrimitivePatchName.C +$(PrimitivePatch)/PrimitivePatchBase.C pointMesh = meshes/pointMesh $(pointMesh)/pointMesh.C diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 3b98b0c996..9ff449fde5 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -2507,7 +2507,7 @@ Foam::autoPtr Foam::globalMeshData::mergePoints Foam::autoPtr Foam::globalMeshData::mergePoints ( const labelList& meshPoints, - const Map