Mesh with 6.2.2504

The following script fails in NGSolve version 6.2.2505 with an

NgException   Traceback (most recent call last)
Cell In[1], line 130
    127 B.Set((x,y,z))
    129 for x_ in [0.01, 0.024]:
--> 130 	print([x_, B(mesh(x_, 0, 0.00))])

NgException: Meshpoint not in mesh!

However, the script runs correctly in version 6.2.2501.

from ngsolve import *
from netgen.occ import *
from numpy import *

pnt1 = Pnt(0.0250000, -0.0200000, 0.0050000)
pnt2 = Pnt(0.0250000, -0.0200000, 0.1050000)
pnt3 = Pnt(0.0250000, 0.1625000, 0.1050000)
pnt4 = Pnt(0.0250000, 0.1625000, 0.0000000)
pnt5 = Pnt(0.0250000, 0.1000000, 0.0000000)
pnt6 = Pnt(0.0250000, 0.1000000, 0.0550000)
pnt7 = Pnt(0.0250000, 0.0200000, 0.0550000)
pnt8 = Pnt(0.0250000, 0.0200000, 0.0050000)

york_seg1 = Segment(pnt1, pnt2)
york_seg2 = Segment(pnt2, pnt3)
york_seg3 = Segment(pnt3, pnt4)
york_seg4 = Segment(pnt4, pnt5)
york_seg5 = Segment(pnt5, pnt6)
york_seg6 = Segment(pnt6, pnt7)
york_seg7 = Segment(pnt7, pnt8)
york_seg8 = Segment(pnt8, pnt1)

york = Wire([york_seg1, york_seg2, york_seg3, york_seg4, york_seg5, york_seg6, york_seg7, york_seg8])
york = Face(york)
york = york.Extrude(Vec(-0.025000,0,0)).mat('york')

york = york.MakeChamfer (york.edges[28:31], 0.008 )
york.faces.Min(X).name = "symmetry"

coil_t = 0.0525
pnt1 = Pnt(0.0000000, 0.1675000, 0.000000)
pnt2 = Pnt(0.0250000, 0.1675000, 0.000000)
pnt3 = Pnt(0.0250000, 0.2025000, 0.000000)
pnt4 = Pnt(0.0000000, 0.2025000, 0.000000)

coil_1_seg1 = Segment(pnt1, pnt2)
coil_1_seg2 = Segment(pnt2, pnt3)
coil_1_seg3 = Segment(pnt3, pnt4)
coil_1_seg4 = Segment(pnt4, pnt1)

coil_1 = Wire([coil_1_seg1, coil_1_seg2, coil_1_seg3, coil_1_seg4])
coil_1 = Face(coil_1)
coil_1 = coil_1.Extrude(Vec(0,0,coil_t)).mat('coil_1')

pnt1 = Pnt(0.0250000, 0.1675000, 0.000000)
pnt2 = Pnt(0.0285355, 0.1660355, 0.000000)
pnt3 = Pnt(0.0300000, 0.1625000, 0.000000)
pnt4 = Pnt(0.0650000, 0.1625000, 0.000000)
pnt5 = Pnt(0.0532843, 0.1907843, 0.000000)
pnt6 = Pnt(0.0250000, 0.2025000, 0.000000)

coil_2_r1 = ArcOfCircle(pnt1, pnt2, pnt3)
coil_2_seg1 = Segment(pnt3, pnt4)
coil_2_r2 = ArcOfCircle(pnt4, pnt5, pnt6)
coil_2_seg2 = Segment(pnt6, pnt1)
coil_2 = Wire([coil_2_r1, coil_2_seg1, coil_2_r2, coil_2_seg2])
coil_2 = Face(coil_2)
coil_2 = coil_2.Extrude(Vec(0,0,coil_t)).mat('coil_2')

pnt1 = Pnt(0.0300000, 0.1625000, 0.000000)
pnt2 = Pnt(0.0300000, 0.1000000, 0.000000)
pnt3 = Pnt(0.0650000, 0.1000000, 0.000000)
pnt4 = Pnt(0.0650000, 0.1625000, 0.000000)

coil_3_seg1 = Segment(pnt1, pnt2)
coil_3_seg2 = Segment(pnt2, pnt3)
coil_3_seg3 = Segment(pnt3, pnt4)
coil_3_seg4 = Segment(pnt4, pnt1)

coil_3 = Wire([coil_3_seg1, coil_3_seg2, coil_3_seg3, coil_3_seg4])
coil_3 = Face(coil_3)
coil_3 = coil_3.Extrude(Vec(0,0,coil_t)).mat('coil_3')

pnt1 = Pnt(0.0300000, 0.1000000, 0.000000)
pnt2 = Pnt(0.0285355, 0.0964645, 0.000000)
pnt3 = Pnt(0.0250000, 0.0950000, 0.000000)
pnt4 = Pnt(0.0250000, 0.0600000, 0.000000)
pnt5 = Pnt(0.0532843, 0.0717157, 0.000000)
pnt6 = Pnt(0.0650000, 0.1000000, 0.000000)

coil_4_r1 = ArcOfCircle(pnt1, pnt2, pnt3)
coil_4_seg1 = Segment(pnt3, pnt4)
coil_4_r2 = ArcOfCircle(pnt4, pnt5, pnt6)
coil_4_seg2 = Segment(pnt6, pnt1)
coil_4 = Wire([coil_4_r1, coil_4_seg1, coil_4_r2, coil_4_seg2])
coil_4 = Face(coil_4)
coil_4 = coil_4.Extrude(Vec(0,0,coil_t)).mat('coil_4')

pnt1 = Pnt(0.0250000, 0.0950000, 0.000000)
pnt2 = Pnt(0.0000000, 0.0950000, 0.000000)
pnt3 = Pnt(0.0000000, 0.0600000, 0.000000)
pnt4 = Pnt(0.0250000, 0.0600000, 0.000000)

coil_5_seg1 = Segment(pnt1, pnt2)
coil_5_seg2 = Segment(pnt2, pnt3)
coil_5_seg3 = Segment(pnt3, pnt4)
coil_5_seg4 = Segment(pnt4, pnt1)
coil_5 = Wire([coil_5_seg1, coil_5_seg2, coil_5_seg3, coil_5_seg4])
coil_5 = Face(coil_5)
coil_5 = coil_5.Extrude(Vec(0,0,coil_t)).mat('coil_5')

Sair = Box(Pnt(0,-0.0725/2,0), Pnt(0.04125,0.0725/2,0.013)).mat('air')
Sair = Sair - york
Sair.maxh = 0.004

air = Box(Pnt(0.0000000,-0.2000000,0.0000000), Pnt(0.25000000, 0.35000000, 0.25000000)).mat('air')

air.faces.Min(X).name = "symmetry"
air.faces.Max(X).name = "outer"
air.faces.Min(Y).name = "outer"
air.faces.Max(Y).name = "outer"
air.faces.Max(Z).name = "outer"
air.faces.Min(Z).name = "midplane"
air.maxh = 0.04

shape = Glue([york, coil_1, coil_2, coil_3, coil_4, coil_5, Sair, air])
shape.faces.Min(X).name = "symmetry"

order = 1
mesh = Mesh(OCCGeometry(shape, dim=3).GenerateMesh(maxh=0.4)).Curve(order)
#mesh = Mesh(OCCGeometry(Sair, dim=3).GenerateMesh(maxh=0.4)).Curve(order)

fes = HCurl(mesh, order=order, nograds=True, dirichlet="symmetry|outer")

B = GridFunction(fes)
B.Set((x,y,z))

for x_ in [0.01, 0.024]:
	print([x_, B(mesh(x_, 0, 0.00))])

Hi Kengo,
thank you for reporting, the bug should be fixed in the latest pre-release:

pip install --upgrade --pre ngsolve

Joachim