I have a mesh file generate by Gmsh(*.vtu), the mesh is a cube area and consist of tetrahedrons. Then I have a point (given by coordinate) in the cube, I want to find which tetrahedron contains the point, how did I do?
with pygmsh.occ.Geometry() as geom:
geom.add_box([0, 0, 0],
[1, 1, 1], mesh_size=0.1)
mesh = geom.generate_mesh()
mesh.write('original_gmsh.vtu')
uGridReader = vtkXMLUnstructuredGridReader()
uGridReader.SetFileName('original_gmsh.vtu')
uGridReader.Update()
uGrid: vtkUnstructuredGrid = uGridReader.GetOutput()
givenPoint = [0.5, 0.5, 0.5]