Tet Mesh Error with Surface Meshes

I am trying to apply a tet mesh on a volume with 6 bounding surfaces. 5 out of 6 are at a common larger length scale than the 6th smaller circular face. 2 faces are paved, 2 are mapped, the face with the small length scale is paved, and the face surrounding it is meshed with a trimesh. Upon forming the surface mesh, the volume tet mesh fails with the following message:

ERROR: Volume 1 meshing unsuccessful using scheme: tetmesh

ERROR: 1 volume(s) did not mesh : 1

This geometry was put through the same meshing operations in Gambit, and it yielded a successful tet mesh. I am unable to attach the relevant files but am adding a few screenshots below.

I am wondering if someone can offer some insight about this error message and what measures may be taken within cubit to successfully mesh the body with the given surface meshes.

Hi @skv – I just wanted to let you know I’m looking into this!

Hi @skv – we’re having a little difficulty replicating your issue. See the below script which we think reflects your geometry and surface mesh. Can you run this in your Cubit and verify whether it works for you? Also, could you maybe verify that this does reflect your geometry / initial mesh accurately?

cylinder radius 1 height 2
webcut volume 1  with plane xplane offset 0 preview 
webcut volume 1  with plane xplane offset 0 
webcut volume 1  with plane yplane offset 0 preview 
webcut volume 1  with plane yplane offset 0 
delete Volume 3 2

create Cylinder height 4 radius .1 
rotate Volume 2 angle 90  about X include_merged 
rotate Volume 2 angle 45  about Z include_merged 
subtract vol 1 from vol 2 keep
delete vol 2
delete vol 3
split body 3
delete vol 3
imprint all
delete vol 4

surf 1 2 3 4 size .075
surface 3 1  scheme map
mesh surface 3 1 

surface 4 2 scheme pave
mesh surface 4 2

surface 6 size auto factor 2
surface 6 scheme pave
mesh surface 6

Trimesher surface gradation 1.3
Trimesher geometry sizing on
surface 5  scheme trimesh geometry approximation angle 15 
mesh surface 5 

vol 1 scheme tetmesh 
mesh vol 1

(Green = pyramid, Yellow = Tet)

@skv I just saw your files that you emailed to our support address. I’ve been able to replicate your issue and am investigating!

I’ve cracked the case @skv! The issue that you’ve run into is that the smallest surface elements are quite small. For a number of reasons, Cubit struggles with small (in the absolute sense) entities since it is based on the ACIS geometry kernel.

I opened your geometry and turned on the “Axis Grid” - which is how I saw your geometry was small (again, in the absolute sense). The measured distance in the image below is ~0.084

I then measured one of the small element edges in the middle surface and found its length to be 0.000222 or \mathcal{O}(10^{-4})

So why is this an issue? The geometry kernel (aka geometry engine) that Cubit is based on is the ACIS kernel from Dassault Systemes Spatial Corporation. ACIS, like many geometry kernels, uses an absolute tolerance for determining whether two neighboring surfaces are “connected” geometrically. See the first link below for more detail. Anyways, the tightest absolute tolerance that ACIS provides is 10^{-6} (see documentation). It appears that the MeshGems tet-meshing routine (which we also license from Dassault Systemes) has a similar tolerance limit, probably because it makes geometry queries, and since you’re so close to the absolute tolerance limit of ACIS that MeshGems runs into errors.

Here are some external links that discuss this issue in more depth:

This absolute tolerance is why we recommend users to scale your geometry so that the smallest features you care about in the model are \approx \mathcal{O}(1). We then have a function that will scale your mesh on export to recover the actual dimension of your model.

For example:


## Create a "small" geometry
bri x 0.000123 # Miles

## Scale geometry from Miles to Feet, 
## which gives us an "easy" conversion to remember
## *and* makes our smallest "important" edges a size ~ 1
volume 1 scale 5280

## Mesh the volume
mesh volume 1
block 1 vol 1

## Setup option to scale mesh on export
transform mesh output scale {1/5280}  # Uses APREPRO syntax to evaluate 1/5280

## Export the mesh, which will be scaled
export mesh "./transformed_mesh.e"  overwrite 

Note that transform mesh is multiplicative / additive depending on whether you’re doing a scale or translation. So doing transform mesh output scale 10 twice will scale by 100, not 10. Make sure to transform mesh output reset to reset.

Anyways, so if I scale your geometry even by just a factor of 100 I am able to successfully build a tetmesh (which will include pyramid transition elements from the quadrilateral surface meshes).

open "./tetmesh_fail.cub5"

vol 1 scale 100
mesh vol 1

transform mesh output scale 0.01
export mesh "./tetmesh_success.e"  overwrite 

And as we can see from loading this file into ParaView, the dimensions are correct and we have a mesh!


Hi @gvernon, thank you very much for looking into this and providing a detailed and helpful response. I tried scaling up my model appropriately and was able to mesh it as per your suggestion.

As a side note, I just wanted to mention that at the small scale O(10−4), I was able to generate a tet mesh when I did not constrain the surface meshes to be paved/mapped and instead allowed them to be trimeshed. It seems like constructing pyramids was trickier at that scale than forming tetrahedrons. I just thought of mentioning that in case any other users find themselves in a similar situation, or if you had any thoughts on that.

I’ve definitely learned something and really appreciate all the helpful links and explanation provided. Going forward, I’ll make sure that “the smallest features I care about in the model are ≈O(1)” and then rescale it to the intended size during export. Thanks again.

@gvernon, thank you for this explanation.

I have s geometry that is 60 km x 60 km x 15 km with a minimum feature of importance on the order of 10 m. In this case, how should I scale my model and how does this relate to the default absolute tolerance in Cubit? Thanks!


In your case, I would probably just use meters as the units. The smallest size of 10 units should be fine. Are you running into problems at that size?


Hi @karl,

Thank you for the reply. I scaled my domain by 1/60000 but then I am also reducing the merge and imprint tolerances by 100, compared with the standard value. This seems to be working with the model imprint and merging, but I am still working on the mesh.