mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adding counter to prevent infinite recursion in displacement limiting
function.
This commit is contained in:
@ -382,7 +382,8 @@ private:
|
||||
void limitDisplacement
|
||||
(
|
||||
const Triangulation::Finite_vertices_iterator& vit,
|
||||
vector& displacement
|
||||
vector& displacement,
|
||||
label callCount = 0
|
||||
) const;
|
||||
|
||||
//- Check if a location is in the exclusion range of an existing feature
|
||||
|
||||
@ -486,9 +486,18 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
||||
void Foam::conformalVoronoiMesh::limitDisplacement
|
||||
(
|
||||
const Triangulation::Finite_vertices_iterator& vit,
|
||||
vector& displacement
|
||||
vector& displacement,
|
||||
label callCount
|
||||
) const
|
||||
{
|
||||
callCount++;
|
||||
|
||||
// Do not allow infinite recursion
|
||||
if (callCount > 7)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
point pt = topoint(vit->point());
|
||||
point dispPt = pt + displacement;
|
||||
|
||||
@ -556,7 +565,7 @@ void Foam::conformalVoronoiMesh::limitDisplacement
|
||||
|
||||
// Info<< " Limiting displacement of point " << pt << endl;
|
||||
|
||||
limitDisplacement(vit, displacement);
|
||||
limitDisplacement(vit, displacement, callCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user