Hello,

I am creating polycrystalline microstructures for crystal plasticity FEM simulations. I use the DREAM.3D software to export .stl files that are then meshed using gmsh. This works well and I have previously used the "Threshold" field as explained in tutorial "t10.geo" to control the mesh size locally. However, I need to create models with a mesh size gradient without reducing the quality of the tetrahedral elements.

These models contain annealing twins that are very thin "pancake" shaped grains and require small tetrahedral elements to be represented adequately. However, to create models with reasonable run times, the total number of elements cannot be excessively large. Therefore it would be ideal to create meshes where the element size gradually increases toward the center of the grains. Aside from the thin annealing twins, the other grains in the model are spherical.

A major constraint is that I cannot alter the triangles at the boundaries of the .stl file since these triangles are in contact with other grains that must be similarly meshed. I attached here the .stl file for a representative grain in my microstructure model and the .geo files used to generate two .msh files that mesh the .stl file. In one of these, I do not specify mesh size and end with 398,426 tetrahedral elements. In the other, I specify a "background" mesh size using the additional two lines below and end with 84,322 tetrahedral elements:

Mesh.CharacteristicLengthExtendFromBoundary = 0; Mesh.CharacteristicLengthMax = 10;

Here (from my understanding), the "background" element size is specified as 10.

This greatly reduces the total number of elements which is great, but the problem is that tetrahedral elements at the boundary of the .stl file contain one small triangle face but are elongated towards the interior of the grain to meet the desired element size as specified above, which reduces their quality. Ideally, I would be able to 1) keep the fine triangle faces and small tetrahedral elements at the boundary of the .stl files and 2) specify a gradually larger mesh size farther from the boundaries of the .stl. The "Threshold" field as demonstrated in t10.geo requires a point at which the finer mesh should be specified, so theoretically this could work because I can specify the center of each grain... but this quickly gets complicated because some grains can be concave and have quite complex morphology, so I don't think it is feasible to do this using a "Threshold" field.

Is there a way to specify mesh size as a function of distance from .stl boundary? Or perhaps specify a maximum element size BUT include something to break larger but strongly distorted elements into smaller elements of higher quality?

I also attached images of mesh quality for the two meshes mentioned above. The distributions of Gamma and SICN (signed inverse condition number) are shifted to the left for the mesh with "Mesh.CharacteristicLengthMax = 10;".

Thank you in advance for your help and please let me know if I can further clarify my problem.

Best regards, Kris

This question was also posted at: https://gitlab.onelab.info/gmsh/gmsh/-/issues/1678.

More Krzysztof S Stopka's questions See All
Similar questions and discussions