Hello everyone,
I use a 3D stp file of which I convert the top face into a 2D mesh:
from netgen.occ import *
geo = OCCGeometry('TOMAS2D2.step')
logging.info('Extracting face 8')
shape2 = geo.shape
shape2.faces[8].name = "TheOne"
for i in range(len(shape2.edges)):
shape2.edges[i].name = "Wall"
if not bude:
shape2.edges[38].name = "Antenna"
else:
shape2.edges[38].name = "lim"
#shape2.edges[36].name = "Buffer"
#shape2.edges[40].name = "Buffer"
Draw(shape2)
#shape2.edges["Wall"].maxh = 0.003 # set the mesh size of the edges with the name "el.*" to 0.003
rt = Glue (shape2.faces["TheOne"])
rt = rt.Scale((0,0,0), 1/1000)
geo = OCCGeometry(rt,dim=2)
logging.info('Generating the mesh')
with TaskManager():
mesh = Mesh(geo.GenerateMesh (maxh=MAXH))
mesh.Curve(5)
After solving on this mesh when I want the value at a certain point I do
point = mesh(0.78,0.0)
gfu1(point)
this gives me the “point not inside mesh” error, however when I do the same
thing with a geometry that I constructed in ngsolve
import netgen.geom2d as geom2d
from netgen.geom2d import CSG2d, Circle, Rectangle
geo = CSG2d()
VesselWall = Circle( center=(0+0.78,0), radius=0.26, bc="Wall" )
CircleWithAntennaRadius = Circle( center=(0+0.78,0), radius=0.265, bc="Antenna" )
AntennaCut1 = Rectangle( pmin=(-3+0.78,-1), pmax=(0+0.78,1), bc="cut" )
AntennaCut2 = Rectangle( pmin=(-4+0.78,0.21*np.sin(np.deg2rad(40))), pmax=(1,1 + 0.21*np.sin(np.deg2rad(40))), bc="cut")
AntennaCut3 = Rectangle( pmin=(-2+0.78,-1 + 0.21*np.sin(np.deg2rad(-40))), pmax=(1,0.21*np.sin(np.deg2rad(-40))), bc="cut" )
CircleWithLessthanAntennaRadius = Circle( center=(0+0.78,0), radius=0.26, bc="Antenna" )
Antenna = CircleWithAntennaRadius - CircleWithLessthanAntennaRadius - AntennaCut1 - AntennaCut2 - AntennaCut3
#System = VesselWall-Antenna
geo.Add(VesselWall)
geo.Add(Antenna)
logging.info('Generating the mesh')
with TaskManager():
mesh = Mesh(geo.GenerateMesh (maxh=MAXH))
mesh.Curve(5)
it does not give an error, the problem is not with the stp file as if I plot
Draw(x,mesh)
Draw(y,mesh)
it shows that (0.78,0) is perfectly in the middle, might this be a bug?