ENH: improve PrimitivePatch access for edges

- return internalEdges() and boundaryEdges() sub lists directly

- calculate and return boundaryFaces() to identify faces attached to
  boundary edges.

- minor code cleanup, and add PrimitivePatchBase class for
  non-templated code.

STYLE: mark unused parameter in globalMeshData mergePoints
This commit is contained in:
Mark Olesen
2021-05-10 13:38:02 +02:00
parent ea2bf72740
commit 3bc8ab2839
17 changed files with 322 additions and 296 deletions

View File

@ -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<point>(pp.faceCentres(), bndFaceIds) << nl;
}
// Move construct