Thank you for the quick fix! I have somewhat of a follow-up question regarding the curved structured meshes.
I noticed that the point search mesh(…) fails when using secondorder=True in the structured mesh. This is not new behavior, I have also had the same issue in previous NGSolve versions:
from ngsolve import *
from ngsolve.webgui import Draw
from ngsolve.meshes import MakeStructured3DMesh
# Create mesh with ngmesh.SecondOrder()
mesh = MakeStructured3DMesh(nx=2, ny=2, nz=2, secondorder=True, mapping=lambda x, y, z: (x, y + 0.5*x**2, z))
# Check evaluation of GridFunction at a meshpoint:
gf = GridFunction(H1(mesh))
gf.Interpolate(y)
Draw(gf)
print(gf(mesh(1,1.5,1))) # Only works with secondorder=False
Another thing I noticed here is that the edges seem not to curve with the faces in the updated MakeStructured3DMesh code that you uploaded yesterday? But I haven’t tested this enough, so this may as well just be a visualization problem:
My workaround for getting the point search to work is to curve the mesh with SetDeformation and Curve(order):
from ngsolve import *
from ngsolve.webgui import Draw
from ngsolve.meshes import MakeStructured3DMesh
# Create mesh where we curve with SetDeformation and mesh.Curve(order)
mesh = MakeStructured3DMesh(nx=2, ny=2, nz=2, secondorder=False)
gf_mesh = GridFunction(VectorH1(mesh, order=2))
gf_mesh.Interpolate(CF((0,0.5*x**2,0)))
mesh.SetDeformation(gf_mesh)
mesh.Curve(2)
Draw(mesh) # --> Nicely curved mesh
# Check evaluation of GridFunction at a meshpoint:
gf = GridFunction(H1(mesh))
gf.Interpolate(y)
Draw(gf)
print(gf(mesh(1,1,1))) # Works fine
Here point search works and also in the new version that you sent yesterday, the edges behave nicely in Draw() :
I should note that the point search problem with mesh(…) is specific to the MakeStructuredMesh functions. When meshing OCC geometries, point search works fine with both SecondOrder() and .Curve(), so the issue seems specific to structured meshes rather than SecondOrder() in general.
Now to my question: Is the SetDeformation + .Curve() route generally the preferred approach when generating meshes with netgen directly, or am I missing something when not using the “traditional” (if we can call it that) approach SecondOrder()?