We start with a mesh of a unit cube. It has 8,007 cells. The edges of the tetrahedra have lengths close to 0.1. (Each of the figures below show the modified condition number of the elements.)
cp ../../../data/geom/mesh/33/cube_1_1_1_0.1.txt mesh.txt
The initial mesh of the cube. The minimum modified condition number is 0.58; the mean is 0.86.
python.exe ../../../data/geom/mesh/utilities/vertices_map.py stretch mesh.txt distorted.txt python.exe ../../../data/geom/mesh/utilities/vertices_map.py twist distorted.txt distorted.txt
The distorted mesh. The minimum modified condition number is 0.16; the mean is 0.59.
First we apply topological optimization. We use a dihedral angle deviation of 0.5 to define edge features. Intersecting edge features are corner features.
utility/boundary33.exe distorted.txt boundary.txt optimization/topologicalOptimize3.exe -manifold=boundary.txt -angle=0.5 r1.txt r1t1.txt
The mesh after topological optimization. The minimum modified condition number is 0.19; the mean is 0.68.
optimization/geometricOptimize3.exe -boundary=boundary.txt -dihedralAngle=0.5 r1t1.txt r1t1g1.txt
The mesh after geometric optimization. The minimum modified condition number is 0.28; the mean is 0.73.
optimization/topologicalOptimize3.exe -manifold=boundary.txt -angle=0.5 r1t1g1.txt r1t2g1.txt optimization/geometricOptimize3.exe -boundary=boundary.txt -dihedralAngle=0.5 r1t2g1.txt r1t2g2.txt
The mesh after two cycles of topological and geometric optimization. The minimum modified condition number is 0.41; the mean is 0.78.
We refine the mesh to deal with the stretching. We split any edges that are longer than 0.2. This results in a mesh with 20,867 cells.
optimization/refine33.exe -length=0.2 -manifold=boundary.txt -angle=0.5 distorted.txt r1.txt
The mesh after refinement based on edge length. The minimum modified condition number is 0.18; the mean is 0.63.
The mesh after refinement based on edge length and two cycles of topological and geometric optimization. The minimum modified condition number is 0.40; the mean is 0.80.
A different strategy is to refine the mesh based on cell quality. We refine cells that have have been significantly distorted. To do this, we select the cells with modified condition number less than 0.5. This approach results in fewer edge splits than in the above section. The refined mesh has 13,034 cells.
utility/cellAttributes33.exe -mcn distorted.txt mcn.txt utility/selectCells.exe -upper=0.5 mcn.txt indices.txt optimization/refineCells33.exe indices.txt distorted.txt rq1.txt
The mesh after refinement based on cell quality. The minimum modified condition number is 0.19; the mean is 0.60.
The mesh after refinement based on cell quality and two cycles of topological and geometric optimization. The minimum modified condition number is 0.41; the mean is 0.80.