Bad Quality Shear Hex Generated

Coreform Cubit Version: 2025.8
Platform: Linux debian 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 GNU/Linux

IssueHello.

I am executing the following commands:

#!cubit
reset
create sphere radius 5
create torus major radius 1.5 minor radius 0.4
create torus major radius 1.5 minor radius 0.4
rotate volume 2 angle 90 about y include_merged
move volume 2 x 0 y 1.5 z 0 include_merged
subtract volume 2 from volume 1 
subtract volume 3 from volume 4 
webcut volume all with plane xplane offset 0
webcut volume all with plane yplane offset 0
webcut volume all with plane zplane offset 0
imprint surface all 
merge surface all 
volume all size 0.2
volume all scheme polyhedron 
mesh volume all

The mesh is generated but there are errors:

ERROR: /tmp/CBT.ACsJUD, line 17. >>>>Bad Quality Shear Hex Generated!<<<< on Volume 7
    (For example, the Shear metric for Hex 2692 is 0 .)
    The threshold for a Hex is 0.2

ERROR: /tmp/CBT.ACsJUD, line 17. >>>>Bad Quality Shear Hex Generated!<<<< on Volume 8
    (For example, the Shear metric for Hex 3891 is 0 .)
    The threshold for a Hex is 0.2

ERROR: /tmp/CBT.ACsJUD, line 17. >>>>Bad Quality Shear Hex Generated!<<<< on Volume 11
    (For example, the Shear metric for Hex 7747 is 0 .)
    The threshold for a Hex is 0.2

ERROR: /tmp/CBT.ACsJUD, line 17. >>>>Bad Quality Shear Hex Generated!<<<< on Volume 12
    (For example, the Shear metric for Hex 9399 is 0 .)
    The threshold for a Hex is 0.2

These cells look a bit twisted and the Jacobian is negative. The attached screenshot illustrates such a cell.

What can we help with?

Could you please help me to straighten these cells?

Kind regards,
Siarhei

A very common practice in Coreform Cubit is to apply smoothing operations after meshing to improve mesh quality. When I encounter cases where I have inverted (negative Jacobian) elements I like to use the Condition Number smoothing scheme:

volume all smooth scheme condition number beta 2.0 cpu 0.5
smooth volume all

Your full script, with some commentary, is then:

#!cubit
reset
# Create geometry
create sphere radius 5
create torus major radius 1.5 minor radius 0.4
create torus major radius 1.5 minor radius 0.4
rotate volume 2 angle 90 about y include_merged
move volume 2 x 0 y 1.5 z 0 include_merged
subtract volume 2 from volume 1 
subtract volume 3 from volume 4 

# Partition for meshing
webcut volume all with plane xplane offset 0
webcut volume all with plane yplane offset 0
webcut volume all with plane zplane offset 0

# Enforce contiguous mesh
imprint surface all 
merge surface all 

# Mesh the geometry
volume all size 0.2
volume all scheme polyhedron 
mesh volume all

# Visualize initial mesh quality
quality volume with x_coord<0 shear global draw mesh
quality volume with x_coord<0 scaled jacobian global draw mesh

# Smooth the mesh to improve quality
volume all smooth scheme condition number beta 2.0 cpu 0.5
smooth volume all

# Visualize final mesh quality
quality volume with x_coord<0 shear global draw mesh
quality volume with x_coord<0 scaled jacobian global draw mesh

Here’s the quality (shear) of the initial mesh:

And after smoothing:

Thanks! Looks like it is working now!