Why is tetramesh painfully slow?

I have a tetrahedral mesh with 35000+ vertices and 60,000+ faces. When I use tetramesh to plot it, it takes like 10 minutes.
If I use freeboundary to exctract that triangular mesh of the surface, and use trisurf, it is extremely fast, like less than a second. Of course number of data is reduced maybe by half but I don't think this is the resason.
Because if I use pdeplot3d to plot the tetrahedral mesh, similarly, it is super-fast. Less than a second also.
It seems like tetramesh is just so slow. Why?
I can't use pdeplot3d because it only accepts nodel data for its colormap. I need to use the faces for the colormap data.

10 Comments

You haven't provided any code or example that let's us verify and test what you are seeing.
Thanks but the code is very basic. Nothing unusual here:
nodes = Input(:,1:3);
elements = Input(:,4:7);
nodes=rmmissing(nodes);
elements = rmmissing(elements);
%using pdePlot3D
pdeplot3D (nodes',elements')
%using tetramesh
tetramesh (elements,nodes)
%using trisurf and surface mesh only
TR = triangulation(elements,nodes)
[F,P] = freeBoundary(TR);
trisurf (F,P(:,1),P(:,2),P(:,3))
@Matt J you can try this
n = 32000;
x = rand([n 1]);
y = rand([n 1]);
z = rand([n 1]);
DT = delaunayTriangulation(x,y,z);
tetramesh(DT)
Thanks. But
1) delaunayTriangulation is for convex hull only. So the detail of the geometry are lost.
2) tetramesh(DT) takes just as long.
3) I already have the connectivity list "elements" which is working beautifully with pdeplot3d.
@Pelajar UM You need to attach Input in a .mat file so that we can run the code.
Pelajar UM
Pelajar UM on 25 Apr 2022
Edited: Pelajar UM on 25 Apr 2022
@Matt J This problem is not specific to any particular mesh, but if you want to try, here, you can use this bracket with a hole example from MATLAB PDE toolbox:
Bruno Luong
Bruno Luong on 25 Apr 2022
Edited: Bruno Luong on 25 Apr 2022
@Pelajar UM" delaunayTriangulation is for convex hull only. So the detail of the geometry are lost. "
I don't have any "detail geometry", we just try to emulate the slownest of tetramesh for high number of vertices that you have reported.
"This problem is not specific to any particular mesh"
I'm lost, so my random mesh is OK or not to illustrate the issue?
If you have more realistic data, then please do provide (I think it's doesn't matter much on the phenomenon).
Obviously tetramesh has to more work hard to handle transparency and color supperposition in the volumic depth, or simple it is not well implemented. Who knows (beside TMW but they rarely comment here)?
Please use the elements and nodes attached. You will see my point.
If you are not familiar, please google what a convex hull is. But this mesh for example is not a convex hull.
Using pdemesh3D (how it should be):
delaunayTriangulation: makes it convex hull:
Bruno Luong
Bruno Luong on 25 Apr 2022
Edited: Bruno Luong on 25 Apr 2022
I know well what the convex hull is, My data are random volume not a specific geometry. Does the convex volume matter for the slownest you want to point out? Yes or no?
No, it doesn't matter. tetramesh (DT) and tetramesh(elements, nodes) are both super slow.
I have attached a list of nodes and elements that you can try. Time tetramesh vs pdemesh3d. You will see the difference is massive.

Sign in to comment.

Answers (0)

Asked:

on 25 Apr 2022

Commented:

on 25 Apr 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!