ENH: PatchTools::gatherAndMerge with recovery of the globalIndex

- support globalIndex for points/faces as an output parameter,
  which allows reuse in subsequent field merge operations.

- make pointMergeMap an optional parameter. This information is not
  always required. Eg, if only using gatherAndMerge to combine faces
  but without any point fields.

ENH: make globalIndex() noexcept, add globalIndex::clear() method
This commit is contained in:
Mark Olesen
2022-11-08 10:12:44 +01:00
committed by Andrew Heather
parent 70208a7399
commit 799d247142
7 changed files with 107 additions and 29 deletions

View File

@ -418,15 +418,12 @@ combineSurfaceGeometry
// Dimension as fraction of surface
const scalar mergeDim = 1e-10*boundBox(s.points(), true).mag();
labelList pointsMap;
PatchTools::gatherAndMerge
Foam::PatchTools::gatherAndMerge
(
mergeDim,
primitivePatch(SubList<face>(s.faces()), s.points()),
points,
faces,
pointsMap
faces
);
}
else
@ -444,15 +441,12 @@ combineSurfaceGeometry
// Dimension as fraction of mesh bounding box
const scalar mergeDim = 1e-10*mesh_.bounds().mag();
labelList pointsMap;
PatchTools::gatherAndMerge
Foam::PatchTools::gatherAndMerge
(
mergeDim,
primitivePatch(SubList<face>(s.faces()), s.points()),
points,
faces,
pointsMap
faces
);
}
else