I am trying to create a Tet mesh of a simple unit cube, with the added twist that one of the cube's face has a straight edge embedded into it. This edge must appear in the surface triangulation and in the tetrahedralization (possibly split into multiple subedges). Also, the edge does not share a vertex with the face's outer wire.
I create the geometry in a brep file using OpenCascade. However, I have so far been unable to get Netgen to produce the desired mesh. I tried many topological variations to correctly embed the edge, without success.
Here is what I have tried:
1. Build the solid (cube) and leave the edge as a free edge. Not surprisingly, the edge is not taken into account by the surface mesher and does not appear in the final mesh.
2. For the face subject to the embedding operation, define an inner wire made of just the edge we want to embed. Define a shell using this face and the five other faces. Finally, build the solid from that shell. When fed this geometry, Netgen crashes during the surface meshing stage. Also, the Topology Explorer qualifies the embedded edge as a "bad allocation".
3. Same as case 2, but this time, the inner wire is "closed" using the embedded edge twice (once with forward orientation, once with reversed orientation). The good news: the surface mesher works and the edge is correctly included in the mesh produced. The bad news: I get the dreaded "Edge multiple times in surface mesh" error and the volume mesh does not get built.
*4. A topologically-consistent approach would be to create the inner wire as in 3. However, this wire should also be the outer wire of a zero-area face. If one thinks about it, an inner wire should define a hole in a face, and if this hole is not occupied by a face, Netgen probably thinks there is actually a hole in one of the cube's face (open shell). This is what I think is the source of my problems. Unfortunately, OpenCascade does not let me build a shell including a zero-area face… So I have been unable to try this variation.
Ideally, I would like to be able to create a mesh from case 2, not only because this is how OpenCascade's boolean operations output the topology, but also because it would be easily extendable to cases where the edge is a curve intersecting a curved surface.
If anyone could give me any hint as to how to do what I am trying to do, or point me to the general part of the source I would need to modifiy to accomplish my goal, I would be really grateful. I can also provide my brep files if anyone wants to reproduce my attempts.
Thanks in advance.
I can sometimes get this effect using STEP files. Cylindrical surfaces sometimes have a straight line along the direction of the axis. It shows up in CAD and is retained by the mesher, but I'm not sure what it really is.
The situation is different than that of a cylinder. In the case of the cylinder, the edge you see is the result of the extrusion of the circle along the cylinder's axis. This edge ends up on the outer boundary of the surface patch in parametric space (i.e. it is part of the outer wire of the axial surface).
In the case I am trying to mesh, the edge is inside the surface. It does not touch its boundary.
I finally had time to go into the source code and fix the issue.
I have a patch. Where do I post it?
i have a very similar error you had.
My error is:
ERROR: Edge 4 - 63 multiple times in surface mesh
surface mesh not consistent, trying orientation
inconsistent layers in triangle
This error comes out after the generation of a prismatic boundary layer, or better when , after the generation of the boundary layer, i do a check of the surface mesh.
May i try your patch?
Thank you in advance
My patch likely will not fix your problem (unless you are trying to embed an edge into a surface using an OCC geometry). The error you get is caused by one (or more) incorrectly oriented surface triangle. That is, if you look from the top at two neighboring triangles, one of them will have its vertices oriented clockwise, and the neighbor counterclockwise. Your triangles need to be oriented consistently for the volume mesh to be built on the correct side of the surface.
Anyhow, I will post the patch if someone indicates to me the proper channel through which I should do so.
Log in to post a comment.