BUG: Managing topoBitSet as source in haloToCell. See issue #2137

This commit is contained in:
sergio
2021-06-22 11:07:26 -07:00
committed by Mattijs Janssens
parent 6101272133
commit acd8e53310

View File

@ -28,6 +28,7 @@ License
#include "haloToCell.H" #include "haloToCell.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "cellSet.H" #include "cellSet.H"
#include "topoBitSet.H"
#include "syncTools.H" #include "syncTools.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -82,10 +83,17 @@ void Foam::haloToCell::combine(topoSet& set, const bool add) const
// The starting set of cells // The starting set of cells
bitSet current(cells.size()); bitSet current(cells.size());
if (isA<topoBitSet>(set))
{
current |= refCast<const topoBitSet>(set).addressing();
}
else
{
for (const label celli : set) for (const label celli : set)
{ {
current.set(celli); current.set(celli);
} }
}
// The perimeter faces of the cell set // The perimeter faces of the cell set
bitSet outsideFaces(mesh_.nFaces()); bitSet outsideFaces(mesh_.nFaces());