Dear NGSolve developers,
I am interested in knowing if it’s possible to perform boolean operations on external meshes in step formats. I have a solid geometry (say volume1 and given in a step file) which needs to be embedded inside another volume, ideally a sphere (say volume2 and created with CSGeometry() ) and i then need to mesh the region (volume2 - volume1) and define dirichlet boundary conditions on the surface of volume1. I tried performing the boolean operation in gmsh but as i understand from mailing list there, a boolean between step and geometric entities in gmsh is not possible (also i get incorrect results so not sure if the boolean operation is being performed correctly).
I started looking at the merge.py given here and this actually merges my step file with a sphere without trouble (attached the adapted script). However it’s not clear to me how to obtain the volume mesh for the region in between and define a boundary condition on interior surface. The line mesh.GenerateVolumeMesh() in the merge.py ends up in error in my case, i receive an error: Stop meshing since too many attempts. I am not sure why this happens as i could get a volume mesh with gmsh and i also added a line geo1.Heal() that fixes the errors in my step file if any.
Provided i am able to generate a volume mesh, would the following syntax make sense in order to apply the dirichlet condition on the surface of volume1:
mesh.SetMaterial(1,'inner') # set the volume1 material as inner
uVal = x+2.0
mesh.SetMaterial(2,'outer') # set the volume2 material as outer and then
fes = H1(mesh, order=2, dirichlet="inner")
ubar = GridFunction (fes)
ubar.Set (uVal, definedon=mesh.Boundaries("inner"))
Thanks in advance for your help!