Open zhang-qiang-github opened 1 year ago
At the moment the mesh pointdata is not passed to the tetmesh so the only way I can think is to loop over all mesh points to find the closest point in the output tetmesh and manually associate the desired info to the tetmesh points. In this way you can separate inlet and outlet too - but I think there is no way to do it "automatically", you still need to inform the system about what is what.
Adding pointdata from the original mesh including the original pointID could be an interesting feature so I add the "enhancement" tag but I cannot promise on when this could be implemented.
Thanks for kindly reply. And I find pygmsh
may be a solution. My test code is:
import pygmsh
from vedo import *
with pygmsh.geo.Geometry() as geom:
box = geom.add_ball(x0=[0, 0, 0], radius=5)
mesh = geom.generate_mesh()
points = mesh.points
elem = mesh.cells_dict['tetra']
triangle = mesh.cells_dict['triangle']
msh1 = Mesh([points, elem]).wireframe() ############################ tetrahedron
msh2 = Mesh([points, triangle]).alpha(0.2).c('b') ###################### surface
show(msh1, msh2)
But, I still need a solution to distinguish inlet/outlet
.
I want to implement a computer fluid dynamic (CFD) simulation, and a mesh is required.
Firstly, I use
Tube
as the vessel model:The result is:
The yellow color indicates the inlet and outlet of vessel, and red color indicates the vessel wall
Question 1: The yellow part is generated by
Tube().cap()
, and I can not distinguish which is inlet and which is outlet. How can I seperate the yellow polydata into two polydata inlet/outlet?Then, the
CFD
need a tetrahedron mesh, which should provide the point id and cell connection. The tetrahedron can be generated by:Question 2: In the
tet
, how can I know the cell id and point id for the polydata ofinlet/outlet/wall
? Theinlet/outlet
is generated fromTube().cap()
, andwall
is the polydata oft2
.Hopes your suggestions~~~