Stop blayer limitation if 1e-10 is reached, and throw an Exception

This commit is contained in:
Matthias Hochsteger 2024-10-24 15:50:44 +02:00
parent 72e25d45a4
commit aa2e0ace99

View File

@ -617,6 +617,13 @@ struct GrowthVectorLimiter
} }
} }
void CheckLimits ()
{
for (auto i : Range(growthvectors))
if (limits[i] < 1e-10)
throw NgException("Stop meshing in boundary layer thickness limitation: overlapping regions detected");
}
void Perform () void Perform ()
{ {
limits.SetSize(mesh.Points().Size()); limits.SetSize(mesh.Points().Size());
@ -631,22 +638,24 @@ struct GrowthVectorLimiter
{ {
PrintMessage(4, "GrowthVectorLimiter pass ", i_pass); PrintMessage(4, "GrowthVectorLimiter pass ", i_pass);
double safety = safeties[i_pass]; double safety = safeties[i_pass];
CheckLimits();
// intersect segment with original surface elements // intersect segment with original surface elements
LimitOriginalSurface(2.1); LimitOriginalSurface(2.1);
CheckLimits();
// intersect prisms with themself // intersect prisms with themself
LimitSelfIntersection(1.3 * safety); LimitSelfIntersection(1.3 * safety);
CheckLimits();
// intesect segment with prism // intesect segment with prism
LimitBoundaryLayer(safety); LimitBoundaryLayer(safety);
CheckLimits();
for (auto i : Range(3)) for (auto i : Range(3))
EqualizeLimits(smoothing_factors[i_pass]); EqualizeLimits(smoothing_factors[i_pass]);
CheckLimits();
for (auto i : Range(growthvectors))
if (limits[i] < 1e-10)
throw NgException("Stop meshing in boundary layer thickness limitation: overlapping regions detected");
if (i_pass == safeties.size() - 1) if (i_pass == safeties.size() - 1)
FixIntersectingSurfaceTrigs(); FixIntersectingSurfaceTrigs();
CheckLimits();
} }
for (auto i : Range(growthvectors)) for (auto i : Range(growthvectors))