How I got rid of negative Jacobian elements (cgx workaround)

Hi all,

While working with PrePoMax I ran into meshes with negative Jacobian elements. Since I couldn’t find a built-in fix in the GUI, I put together the workflow below using cgx as a workaround. Maybe this is useful to others running into the same issue, or maybe it’s something that could eventually be integrated into the GUI directly.

Thanks a lot for developing PrePoMax — it’s an amazing tool!

Protocol for eliminating negative elements

  1. Generate the mesh in PrePoMax. This is where the negative elements were created.
  2. Export the .inp file and open it in cgx.
  3. In cgx, the set -NJBY is automatically created, containing all negative elements.
  4. Repeatedly running mids -NJBY lin force unfortunately did not eliminate the negative elements in my case, so I took a different approach.
  5. Running merg n all 0.01 merges all nodes that lie closer together than the specified tolerance (0.01 in this case). This removed all the negative elements.
  6. Running send all abq generates a file all.msh containing the corrected mesh.
  7. Manually rename the file extension from .msh to .inp. PrePoMax then recognizes the file and can import it.
  8. Continue working with the new mesh in PrePoMax and start the job. With this corrected mesh, the calculation ran through successfully.

Best regards,
Bastian

3 Likes

Did you try to don´t use the midsize nodes in the geometry? In my models this option very often cause non jaobian elements or other deformations on elements in curved faces.

1 Like

The most common cause of negative jacobians in PrePoMax is adjustment in tie constraints or contact. Sometimes they are also generated when meshing problematic geometries.

PrePoMax creates a set for negative jacobians when submitting an analysis (or just the Check Model procedure), but you can also use the built-in mesh quality check tool to find them.

1 Like

The “Midside nodes on geometry” option is disabled by default and when it’s enabled, it may indeed lead to negative jacobians for some geometries.

1 Like

Yes, I used that option. Disabling “Mid-side nodes on geometry” would definitely be one approach. I think there are advantages to having the option enabled, since the elements naturally represent the geometry better that way. I was just looking for a process to get rid of the few problematic elements that might arise during mesh generation with “Mid-side nodes on geometry” enabled. Thanks for the help!

Midside nodes on geometry are disabled by default because, with Netgen and Gmsh, they far too often lead to negative jacobians. Of course, careful preparation of the geometry before importing it to PrePoMax may help reduce those issues. And if more accurate representation of curvatures is needed, they can be always enabled manually in a given case. I wouldn’t do it by default, though (there is a setting in Tools —> Settings to have it always enabled initially).

1 Like

Maybe there is a good threshold/evaluation value at which projected nodes cause problems and can later be detected by PrePoMax and moved back to the midside position?

Perhaps PrePoMax could check the jacobian (e.g., using the built-in Gmsh quality metrics) of the initially generated mesh before returning it.

Regarding other criteria, maybe normal/tangential offset could be used for midside nodes, like in Patran:

Here’s also a ref from Coreform Cubit: Metrics for Tetrahedral Elements — Coreform Cubit Help

1 Like

Hi,

If I increase the mesh optimization steps (mainly for 2D) in the meshing parameters and/or picking a second order optimization from the tetrahedral menu, would it help with eliminating the problematic non-jacobian elements?

I also would like to use second order hex elements as much as possible, based on what I have learnt about FEM simulation elements.

To avoid negative jacobians, you should try this:

  1. Disable any adjustments in contact pairs and tie constraints.
  2. Make sure that the “Midside nodes on geometry” setting in advanced Meshing parameters is disabled (it should be by default).
  3. Try meshing with Netgen instead of Gmsh.
  4. Locate these elements (using the built-in Element quality tool or automatically created elsets) and try refining the mesh or simplifying the geometry there.
  5. Make sure that there are no issues with the geometry and look for small edges and faces, as well as other flaws (some of them can be found with the Analyze geometry tool).

Overall, apart from disabling those risky settings, you should ensure the correctness of your CAD model and simplify it as much as possible.

Only adjusting meshing settings rarely helps, but you can try reducing the maximum element size.

And yes, hexahedral elements should be used whenever possible, but they can be applied only to relatively simple geometries and you may need to prepare them properly first.

1 Like