Negative Jacobians


I am trying to mesh a geometry using auto sizing (tetmesh) and then trying to convert it into hex using thex. The simple tet mesh doesn’t have any negative jacobian elements and the lowest shape quality is 0.017. But I always run into negative jacobian errors after converting the mesh using thex. I also tried using untangle to remove such nodes but it doesn’t remove all of them. I have also tried to smoothen the tet mesh before converting it to hex but using Laplacian and Condition Number leads to creating negative jacobain tets. Could you please help me with this issue?

I have the trial version running on my laptop and can’t use a really fine geometry adaptive mesh without the program crashing hence I am using the lowest size factor on auto sizing.



Welcome @nkulkar2!

First, as you are likely aware, converting tetrahedral elements to hexahedral elements is not a widely recommended hex-meshing technique - but that doesn’t mean that you shouldn’t use it! Rather, the reason it isn’t widely recommended is that often produces (very) poor hexahedral elements – especially on low-quality tetrahedra. Thus to talk about creating a quality thex mesh, we really need to talk about how to create a high-quality tet mesh.

Consider the following “knuckle” geometry:

If we use the default tetmesh settings we will get a pretty poor quality tetmesh (at least for nonlinear structural mechanics - where your quality is only as good as your worst element):

And as expected, thex results in a poorer quality mesh, with some negative hexes:
![image|690x467, 50%]upload://xrIvougyuFcTLEfIkKxJoLPJcCW.png)

The hex element in this geometry that inverts is built from one of the holes on the arms. Looking at the tetrahedra, we see that it’s an “overconstrained” tetrahedra - one that has all of its nodes on a surface.

Notice how the resulting hex-layout adds new nodes at the curve and face centers. Cubit then associates this node with the underlying geometry, snapping it to the curve, and this is what results in the inverted hex element.

There are two ways to work around this issue.

  1. Export the initial tet-mesh to an Exodus mesh format, after you’ve made all block / sideset / nodeset assignments (essentially, that you’ve completed any setup operations and now just need to mesh and export). You will create a new Cubit file (reset) and then import the Exodus file. Then you’ll run thex tet all and then export your hex mesh. There shouldn’t me any inverted elements.

  2. Make a better tet mesh. Here’s how:

First, recognize that we don’t need to exactly capture every CAD curve with elements, so let’s use surface compositing to make virtual topology, letting the tetmesher know that there are certain “features” that don’t need to be strictly captured:

Also, while not strictly required, it’s a good idea to remove small features that will create small elements:

Then in the TetMesh dialog, select the Advanced options:

  1. Minimize Over-Constrained Tets
  2. Minimize Overconstrained Edges
  3. Minimize Sliver Tets

And go with the highest Optimization Level setting that you can afford.

The resulting tetmesh:

And what we can see is that troublesome tet element from before has been “split”:

And now we have no inverted hexes:

Let me know if this was helpful!

Thank you for the reply! I will try to implement this.

I had a question about creating sidesets too. For my geometry I am making an offset of a complex solid geometry and then deleting the solid part which basically creates a hollow/void inside the offset volume (something like creating an annular geometry by creating an offset around a solid cylinder). But since the geometry is so complex it has about 4000 surfaces and it is tedious process trying to select all the surfaces. Is there an easier way to go about it?

Try something like:

create sheet offset from surface all in volume <volume_id> offset <distance>
subtract volume <offset_volume_id> from volume <volume_id>

Hi Greg,

That is how I have created my offset body. It’s just taking me a long time to make sidesets out of the inner surfaces of that offset. Right now, I’m hiding the outer surfaces and then plan to select all the inner ones for my sideset. I was wondering if there is a better way to go about it?

Thank you


There is a better way. Here’s what I recommend:

  1. Turn on transparency so that it’s easier to distinguish interior and exterior surfaces.
  2. Click on an outer surface that’s in front of one of the interior surfaces you want to select.
  3. Push ‘Tab’ on your keyboard to cycle through potential surfaces to select, stop once you have an interior surface selected.
  4. ‘Right-click’ on your mouse to bring up a context menu
  5. Choose the option ‘Select Cavity’ - If that option doesn’t appear, iterate on steps 2-5 until it does.

Hi Greg,

This way is much quicker and hassle free.

I also tried meshing by applying the advance settings for the tetmesh but it still gave me a few thousand elements with negative jacobians. But the exporting and re-importing the mesh and then using thex volume all worked (it has lowest scaled jacobian of 0.0008 but at least it’s positive).