mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user