mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add fallback behaviour for distanceSurface proximity regions (#1631)
- using the proximityRegions filter when there is no enclosing surface to segregate domains causes a surface of zero-faces to be created. In most cases, this means that a simpler proximityFaces filter would have been more appropriate. To increase overall robustness, revert to the simpler proximityFaces filter logic when the proximityRegions would otherwise result in zero faces (globally seen).
This commit is contained in:
@ -279,6 +279,7 @@ Foam::distanceSurface::distanceSurface
|
||||
|| (distance_ < 0)
|
||||
|| dict.getOrDefault<bool>("signed", true)
|
||||
),
|
||||
|
||||
isoParams_
|
||||
(
|
||||
dict,
|
||||
@ -374,6 +375,7 @@ Foam::distanceSurface::distanceSurface
|
||||
|| (distance_ < 0)
|
||||
|| useSignedDistance
|
||||
),
|
||||
|
||||
isoParams_(params),
|
||||
topoFilter_(topologyFilterType::NONE),
|
||||
nearestPoints_(),
|
||||
|
||||
@ -429,6 +429,27 @@ void Foam::distanceSurface::filterRegionProximity
|
||||
}
|
||||
|
||||
|
||||
// If filtering with region proximity results in zero faces,
|
||||
// revert to face-only proximity filter
|
||||
if (returnReduce(acceptFaces.none(), andOp<bool>()))
|
||||
{
|
||||
acceptFaces.reset();
|
||||
prune = false;
|
||||
|
||||
// Consider the absolute proximity of the face centres
|
||||
forAll(faceDistance, facei)
|
||||
{
|
||||
if (absProximity_ < faceDistance[facei])
|
||||
{
|
||||
prune = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
acceptFaces.set(facei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (prune)
|
||||
{
|
||||
labelList pointMap, faceMap;
|
||||
|
||||
Reference in New Issue
Block a user