krober10nd / SeismicMesh

2D/3D serial and parallel triangular mesh generation tool for finite element methods.
https://seismicmesh.readthedocs.io/
GNU General Public License v3.0
127 stars 33 forks source link

Distmesh initialization in 3D #54

Closed nschloe closed 4 years ago

nschloe commented 4 years ago

In 2D, distmesh initializes with a triangular space-filling pattern. How do you initialize tets in 3D? Link is fine.

krober10nd commented 4 years ago

In parallel I build a structured grid in blocks each owned by one core and in serial here:

https://github.com/krober10nd/SeismicMesh/blob/c18aa4fa18ee0d7e2525775d2529737fc3de0877/SeismicMesh/generation/mesh_generator.py#L510

nschloe commented 4 years ago

Okay, meshgrid. How so you generate the tets from the points then?

krober10nd commented 4 years ago

I call a Bowyer-Watson Deluanay triangulation algorithm that operates on the local point set (if parallel).

I wrote a Python wrapper to the 2D and 3D Delaunay triangulation class from the cgal package.

https://github.com/krober10nd/SeismicMesh/blob/c18aa4fa18ee0d7e2525775d2529737fc3de0877/SeismicMesh/generation/mesh_generator.py#L311

krober10nd commented 4 years ago

https://github.com/krober10nd/SeismicMesh/blob/api_overhaul/SeismicMesh/generation/cpp/delaunay_class.cpp

nschloe commented 4 years ago

Okay. Do you do any edge/face flip magic or does this then only work for convex domains?

krober10nd commented 4 years ago

Okay. Do you do any edge/face flip magic

No, not doing any of that.

or does this then only work for convex domains?

Per the original DistMesh algorithm paper, I remove points "outside" of the domain each meshing iteration by evaluating the signed distance function with the centroid of each cell. Thus, it can mesh any domain (including convex, non-convex or a disjoint domain).

krober10nd commented 4 years ago

I tried a different way to form the initial point distribution (that works in both 2 and 3d)

https://github.com/krober10nd/SeismicMesh/blob/aa6533bb22ff26f19b881427ef956df989079919/SeismicMesh/generation/utils.py#L28

nschloe commented 4 years ago

There are more tetrahedral space-fillings to play around with, https://demonstrations.wolfram.com/SpaceFillingTetrahedra/, and since those filling are all regular, you can very cheaply create the cells, too. I'm not sure if any of those fillings is better than what you're trying. Eventually, the most natural solution would be the tet-oct honeycomb, but since pre-/post-processing software support for octs is weak, it's not a viable option yet.

krober10nd commented 4 years ago

Very cool. Yea I can put severa in and see when I have more time. I came across a paper that created the honey comb meshes for some numerical analysis.

nschloe commented 4 years ago

I never implemented any of those, too afraid of the index war. That'd perhaps be something for meshzoo one day. Anyway, not a requirement from my side for the paper.

krober10nd commented 4 years ago

I see. Yes, it's just something interesting. The ending mesh quality is reduced if you don't use the staggered grid.

But yea probably a good utility for 'meshzoo'