0

For some work using the Finite Element Method, I manually generated a volumetric 3D mesh with tetrahedral elements, from medical image data. The object has an arbitrary shape that is almost cylindrical. I also have a separate mesh file for only the surface. I am trying to cut a slice / chunk out of the side of my mesh such that I end up with two new meshes that can be aligned at a common interface, and each mesh can function independently (with their own connectivity, etc remaining intact). I need a method that can be reproduced on other meshes of the same kind (some are more fine or more coarse). All the software and computational techniques I have found seem to only work with hollow/surface meshes. Please advice.

P.S. If it matters, the mesh file is in the INRIA MEDIT .mesh format but I have also managed to convert it to a Paraview .vtk format.

P.P.S. I see a vote to close. Please consider the fact that I am working in an interdisciplinary field and this question does not seem to be answered anywhere else. All I need are some pointers.

Cogicero
  • 1,514
  • 2
  • 17
  • 36
  • Only slightly related: You can use meshio to convert medit files to many other formats. https://github.com/nschloe/meshio – Nico Schlömer Feb 27 '20 at 10:00
  • I didn't vote to close, but the reason you got flagged once is that usually, "what are my options" questions are frowned upon on stackoverflow. The reason is that there cannot be a single best answer then; the primarily opinion-based. I do think it's a valid question though. – Nico Schlömer Feb 27 '20 at 10:01
  • @NicoSchlömer Thanks, I already did that actually. And in this case, there doesn't seem to be a range of options. I have been informed that this is something 3D modelers do, but I haven't been able to find out. – Cogicero Mar 02 '20 at 22:26

2 Answers2

1

So if you you already have the mesh as tetrahedra and you want to cut a slice out of it, you could simply select a submesh by selecting a bunch of tetrahedra, e.g., based on the coordinates of their corner points.

Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
  • Thank you. I would do this, except that this mesh has almost a million elements. Selecting hundreds of thousands of items and obtaining their coordinates in thatr way isn't at all trivial. – Cogicero Mar 02 '20 at 22:28
  • 1
    It seems super trivial to me. What's the issue? – Nico Schlömer Mar 03 '20 at 08:26
  • Seems I am out of my depth - I will try to describe the issue. I am not sure how to select such a submesh (or maybe I am not using the right tools?) I have a text file with all the coordinates, but with no way to identify which coordinates / which lines of the text file correspond to the elements I want to select. I also have a software that can visualize the mesh, but that one doesn't tell me the coordinates. If I had a method to see what I am selecting, and also tell me the coordinates then I think that could be trivial. – Cogicero Mar 03 '20 at 18:31
  • Well, how do you "select" a submesh? By "clicking" on tetrahedra? That's not practical. One typically has conditions on the point coordinates. Also, note that you can use [meshio](https://github.com/nschloe/meshio) to convert your code to many other formats. – Nico Schlömer Mar 03 '20 at 22:49
1

The typical approach I've seen would be to perform such operations in a proper CAD system and mesh the resulting geometry.

You have to do it this way because the original geometry probably wasn't created with the new boundaries in mind.

A simple example of what I have in mind would be a 2D rectangular region. It would be natural to mesh this with an element density of m x n. This is even more pronounced if the hole is not centered around the center of mass of the 2D region.

This would not do if you then decided to mesh that same 2D region with a hole in it, regardless of the original m x n density chosen.

It that case, I'd modify the original geometry to add the hole and then mesh that. The element density would certainly be more refined close to the hole so I could resolve stresses nearby.

You should work with the person who created the geometry and mesh.

I'd also look into the state of the art for automatic meshing systems. I'm sure they've come a long way since I did FEA for a living.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • Unfortunately, generating the mesh all over again is not possible in this case. The mesh is created from medical image data, and I can't make that sort of modification directly. Besides, it already took forever to generate the mesh. – Cogicero Mar 02 '20 at 22:32
  • Doing it with the mesh is also difficult, error prone, and not accurate. I wasn't trying to give you an easy solution. I was pointing out what would be the best way to do it. Who gave you the mesh? What tools/methods are you using to create the mesh? I'd wonder about the current state of the art for automatic meshing. I'm sure it's come a long way since I did FEA for a living. – duffymo Mar 03 '20 at 14:48
  • I created the mesh manually, and by running a script which pieced together all the coordinate data and element positions. Automatic meshing isn't readily available, AFAIK - but I will ask around. Thank you! – Cogicero Mar 03 '20 at 18:32
  • A better question: where did the original geometry come from? "Created from medical image data" using what software? You'd have to have something that could take a series of images and convert them into a 3D geometric representation. Do you feed that representation to your script? That's a challenging problem in itself. I've done a lot of 3D modeling. I know that scripting is not viable unless the geometry is regular and "simple". – duffymo Mar 03 '20 at 19:16