Fix maxh issue for splines

This commit is contained in:
Matthias Hochsteger 2020-10-19 13:19:25 +02:00
parent 2b5d00b259
commit 9d5661fdc5

View File

@ -242,16 +242,20 @@ namespace netgen
mesh2d.RestrictLocalHLine (Point<3>(p1(0),p1(1),0),
Point<3>(p2(0),p2(1),0), len/mp.segmentsperedge);
// skip curvature restrictions for straight lines
if(spline.MaxCurvature()==0)
continue;
double hcurve = min (spline.hmax, h/spline.reffak);
double hl = GetDomainMaxh (spline.leftdom);
if (hl > 0) hcurve = min2 (hcurve, hl);
double hr = GetDomainMaxh (spline.rightdom);
if (hr > 0) hcurve = min2 (hcurve, hr);
// skip curvature restrictions for straight lines
if(spline.MaxCurvature()==0)
{
mesh2d.RestrictLocalHLine (Point<3>(p1(0),p1(1),0),
Point<3>(p2(0),p2(1),0), hcurve);
}
else
{
int np = 1000;
for (double t = 0.5/np; t < 1; t += 1.0/np)
{
@ -260,6 +264,7 @@ namespace netgen
mesh2d.RestrictLocalH (Point<3> (x(0), x(1), 0), min2(hc, hcurve));
}
}
}
for (auto mspnt : mp.meshsize_points)
mesh2d.RestrictLocalH (mspnt.pnt, mspnt.h);