Some improvements on Scaled Jacobian:

- add math to sphinx to generate the formulas
- change the icon to deformed hexahedrons
- add a test on deformed hexahedrons
- update the example use case on the doc to deformed hexahedrons
This commit is contained in:
Christophe Bourcier 2023-08-08 12:42:44 +02:00
parent 9ac965c0e3
commit 0dbcca5093
8 changed files with 54 additions and 7 deletions

View File

@ -186,6 +186,7 @@ html_use_index = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'smeshdoc'
extensions += ['sphinx.ext.mathjax']
# Options for LaTeX output
# ------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -4,12 +4,19 @@
Scaled Jacobian
***************
The **Scaled Jacobian** mesh quality criteria, is a scalar measure of the deviation from the perfect element in the geometrical sense, this measure normalize the range of reported values
between [0,1] for a normal element, the value of 1 is considered a perfect element and 0 a element with a collapsed side. Negative values are also accepted for invalid elements.
The **Scaled Jacobian** mesh quality criteria is a scalar measure of the deviation from the perfect element in the geometrical sense. This measure normalizes the range of reported values between [0,1] for a normal element, the value of 1 is considered a perfect element and 0 a element with a collapsed side. Negative values are also accepted for invalid elements.
The **Scaled Jacobian** is implemented for volumetric elements returning 0 for polyhedrons. For tetrahedron and hexahedron the close form
is defined in `[1] <https://gitlab.kitware.com/third-party/verdict/-/blob/master/SAND2007-2853p.pdf>`_, for pyramids the minimum scaled jacobian of the four tetrahedrons formed
in the four vertices of the pyramid base is reported, for pentahedrons a decomposition into tetrahedron is also done and finally for hexahedron prisms the minimum scaled jacobian between two pentahedrons and one hexahedron is reported.
The **Scaled Jacobian** is implemented for all volumetric elements (except for polyhedrons, returning 0).
For tetrahedrons and hexahedrons, the formulas are
defined in `The Verdict Library Reference Manual [1] <https://gitlab.kitware.com/third-party/verdict/-/blob/master/SAND2007-2853p.pdf>`_.
For pyramid, the minimum scaled jacobian of the four tetrahedrons formed
in the four vertices of the pyramid base is reported.
For pentahedron, a decomposition into tetrahedron is also done.
For hexahedron prisms, the minimum scaled jacobian between two pentahedrons and one hexahedron is reported.
* Geometrically the Scaled Jacobian of a **tetrahedron** can be understood by the follow figure:
@ -35,7 +42,7 @@ in the four vertices of the pyramid base is reported, for pentahedrons a decompo
Your mesh will be displayed in the viewer with its elements colored according to the applied mesh quality control criterion:
.. image:: ../images/scaled_jacobian_mesh_tetra.png
.. image:: ../images/scaled_jacobian_mesh_hexa.png
:align: center

View File

@ -168,6 +168,7 @@ SET(SMESH_RESOURCES_FILES
mesh_renumbering_nodes.png
mesh_revolution.png
mesh_rotation.png
mesh_scaled_jacobian.png
mesh_sew_bordertoside.png
mesh_sew_conform_freeborders.png
mesh_sew_freeborders.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -136,9 +136,47 @@ if not Done:
pentahedrons = 0.6
pentasAndPolys = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ScaledJacobian, SMESH.FT_LessThan, pentahedrons )
#Distorted hexas
polysIds = Mesh_4.GetIdsFromFilter(polysElements)
pentasAndPolysIds = Mesh_4.GetIdsFromFilter(pentasAndPolys)
assert( len(pentasAndPolysIds) - len(polysIds) == 10 )
#Test distorded hexahedrons scaled jacobian values
Mesh_5 = smesh.Mesh(Box_1,'Mesh_5')
Regular_1D = Mesh_5.Segment()
Number_of_Segments_1 = Regular_1D.NumberOfSegments(2)
Quadrangle_2D = Mesh_5.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_5.Hexahedron(algo=smeshBuilder.Hexa)
isDone = Mesh_5.Compute()
if not Done:
raise Exception("Error when computing hexaedrons Mesh for quality control test")
#move some nodes to make scaled jacobian lesser than 1
node_id_1 = Mesh_5.FindNodeClosestTo(0, 0, 10)
node_id_5 = Mesh_5.FindNodeClosestTo(10, 0, 10)
node_id_14 = Mesh_5.FindNodeClosestTo(10, 5, 10)
node_id_13 = Mesh_5.FindNodeClosestTo(10, 0, 5)
node_id_6 = Mesh_5.FindNodeClosestTo(10, 0, 0)
Mesh_5.MoveNode( node_id_1, 1, 1, 9 )
Mesh_5.MoveNode( node_id_5, 9, 1, 9 )
Mesh_5.MoveNode( node_id_14, 10, 5, 9 )
Mesh_5.MoveNode( node_id_13, 9, 0, 5 )
Mesh_5.MoveNode( node_id_6, 8, 0, 0 )
yellow_element = Mesh_5.FindElementsByPoint(7.5, 2.5, 2.5)[0]
green_element = Mesh_5.FindElementsByPoint(7.5, 2.5, 7.5)[0]
blue_element = Mesh_5.FindElementsByPoint(2.5, 2.5, 7.5)[0]
yellow_SJ = Mesh_5.GetScaledJacobian(yellow_element)
green_SJ = Mesh_5.GetScaledJacobian(green_element)
blue_SJ = Mesh_5.GetScaledJacobian(blue_element)
yellow_SJ_ref = 0.910446300912
green_SJ_ref = 0.818025491961
blue_SJ_ref = 0.654728501099
assert assertWithDelta( yellow_SJ_ref, yellow_SJ, 1e-10 )
assert assertWithDelta( green_SJ_ref, green_SJ, 1e-10 )
assert assertWithDelta( blue_SJ_ref, blue_SJ, 1e-10 )