ENH: use SubList for CompactListList access

- this was previously a UList instead of SubList,
  but SubList supports better assignment of values

ENH: add invertOneToManyCompact

- returns a CompactListList<label> instead of labelListList, which
  allows for reuse as partitioning table etc and/or slightly reduced
  memory overhead
This commit is contained in:
Mark Olesen
2024-03-05 09:22:27 +01:00
parent 78fc102df1
commit 5a70be0846
6 changed files with 111 additions and 54 deletions

View File

@ -65,16 +65,19 @@ void Foam::meshDualiser::checkPolyTopoChange(const polyTopoChange& meshMod)
if (nUnique < points.size())
{
labelListList newToOld(invertOneToMany(nUnique, oldToNew));
CompactListList<label> newToOld
(
invertOneToManyCompact(nUnique, oldToNew)
);
forAll(newToOld, newI)
forAll(newToOld, newi)
{
if (newToOld[newI].size() != 1)
if (newToOld[newi].size() != 1)
{
FatalErrorInFunction
<< "duplicate verts:" << newToOld[newI]
<< "duplicate verts:" << newToOld[newi]
<< " coords:"
<< UIndirectList<point>(points, newToOld[newI])
<< UIndirectList<point>(points, newToOld[newi])
<< abort(FatalError);
}
}