as well known, neg. jacobians occur very often and most of them appears near part's surface while using elements of 2nd order.
Gmsh offers a parameter to suppress some of them.
Mesh.SecondOrderLinear = 1; // Second order nodes are created by linear interpolation instead curvilinear
Usually Gmsh tries to follow part's surface as close as possible. Therefore midpoints of surface 2nd order elements are curvilinear moved to match
desired curvature of part.
Sometimes bad shaped tetrahedrons (high edge ratio) hit limit, resulting in neg. jacobians.
Above mentioned parameter stops element distortion and ensures straight elements at surface with linear interpolated midpoints.
Therefore I introduced a new property to FEMmeshGmsh
to get above shown shape2mesh.geo layout
Code: Select all
diff U C:/Users/aio/FreeCADcode/src/Mod/Fem/femobjects/_FemMeshGmsh.py C:/Users/aio/Miniconda3/envs/freecad/Library/Mod/Fem/femobjects/_FemMeshGmsh.py --- C:/Users/aio/FreeCADcode/src/Mod/Fem/femobjects/_FemMeshGmsh.py Mon Dec 16 18:45:08 2019 +++ C:/Users/aio/Miniconda3/envs/freecad/Library/Mod/Fem/femobjects/_FemMeshGmsh.py Mon Dec 16 14:09:13 2019 @@ -177,0 +178,8 @@ + "App::PropertyBool", + "SecondOrderLinear", + "FEM Gmsh Mesh Params", + "Second order nodes are created by linear interpolation" + ) + obj.SecondOrderLinear = True + + obj.addProperty(
Code: Select all
diff U C:/Users/aio/FreeCADcode/src/Mod/Fem/femmesh/gmshtools.py C:/Users/aio/Miniconda3/envs/freecad/Library/Mod/Fem/femmesh/gmshtools.py --- C:/Users/aio/FreeCADcode/src/Mod/Fem/femmesh/gmshtools.py Mon Dec 16 18:48:20 2019 +++ C:/Users/aio/Miniconda3/envs/freecad/Library/Mod/Fem/femmesh/gmshtools.py Mon Dec 16 18:42:53 2019 @@ -759,0 +760,5 @@ + + if hasattr(self.mesh_obj, "SecondOrderLinear") and self.mesh_obj.SecondOrderLinear is True: + geo.write("Mesh.SecondOrderLinear = 1; // Second order nodes are created by linear interpolation instead by curvilinear\n") + else: + geo.write("Mesh.SecondOrderLinear = 0; // Second order nodes are created by linear interpolation instead by curvilinear\n") @@ -761 +766 @@ - +
What do you think?