Remeshing workflow for deformed FEM meshes.
As suggested in the mailing list, i open this issue on here, even though it is probably an issue I have rather than one gmsh has.
What i want to do:
I perform 2d and 3d mechanical simulations using Abaqus (although i think most other FEM software will probably behave similarly). At some point (when the mesh degrades too much) i would like to stop the simulation, export the "final" shape of the body to gmsh, remesh the body, and continue with a new simulation.
What i tried:
I explicitly created points, lines and surfaces for every element on the boundary of the body. I then compounded boundary segments (depending on boundary conditions or geometrical features i would like to retain) and created physical groups accordingly.
-
When the surface of a 3d body is split into multiple subsurfaces, this means having to track segments of the lines separating these subsurfaces, since the compounded lines can not extend past te surfaces enclosed by them.
-
Compounding is necessary to allow for mesh coarsening (which i need).
-
I read about discrete entities, but i am unsure how i would incorporate them into my workflow (especially w.r.t. compounding).
Key problems
Mesh Definitions Gmsh vs Abaqus
One problem the i consistently run into is the different meshes used by gmsh (including line- and surface elements even in 3d meshes) and abaqus (using only volume elements for 3d). For example, to apply boundary conditions i have to search the 3d elements containing the 2d elements in a physical group as faces. Is there a way to get this information in gmsh directly, i.e. build a new physical group with all 3d elements which have at least one of the 2d elements as a face?
In Abaqus, on the mesh level the equivalent of a physical group is called a set. Sets contain elements and/or nodes - for a surface of a 3d body, the set would contain all nodes on that surface as well as all elements that have at least one face on it.
If the original mesh was created in gmsh, i could load/keep the information about that mesh and only change the node coordinates (instead of reconstructing the complete mesh from the abaqus output). However, i would prefer to have a workflow that is independent from this if it is possible without high additional runtimes and/or coding effort.
2nd order elements
I would love to use gmsh's functionality for 2nd order elements. I would really appreciate it if there was a possibility to incorporate those (maybe at least quadratic triangles/tets for now?) into the workflow without a lot of extra work (like breaking up element faces into triangles manually). I am not sure if there is an easy way to create e.g. the surface given by the 6 nodes of a quadratic triangle element in gmsh (ideally using the actual parametrization).
Reconstruction of CAD model or new CAD from mesh?
I think reconstruction and remeshing of the original geometry (or a changed version of that) is infeasible for most of the problems i am trying to solve. I am fine with accepting that i lose some information about the shape of the domain when accepting a converged FEM solution as the new shape. As described above, quadratic elements would be an advantage in that regard. To keep certain geometric features intact, compounds can be used (and maybe embedded entities, although i did not try that yet).
Example Problem
To demonstrate the workflow i have in mind, i created a simple cube in gmsh and meshed it with quadratic tet elements. I created 3 physical surfaces (front, back, and all sides). The output contains triangle elements for the surface and tets for the volume - i think the first step for me would be to know if there is an easy way to tag the tets including one of the triangles as a face. I attached the python script i used to create the example as well as the resulting .msh file.
Geometry of the example problem:
Python script: example_cube.py
Resulting .mesh file: zonedCube.msh
In a second step, i would then change the coordinates of the nodes and re-import a mesh that only contains the tets (without any information about the underlying geometry).
Kind regard and thank you in advance for any help on the matter
Tim