Add one property, OutputFormat, based on Bernd's FemMeshGmsh and a new export_mesh() function in FemGmshTools.py
Potentially, boundary node groups can be export/convert for solvers like elmer, fenics, etc.
By fully controling `Mesh.Format` in gmsh input *.geo file, a few more mesh formats can be exported from FreeCAD:
```
Mesh output format (1=msh, 2=unv, 10=automatic, 19=vrml, 26=pos statistics,
27=stl, 30=mesh, 31=bdf, 32=cgns, 33=med, 39=inp, 40=ply2)
Mesh.Format Default value: 10
```
new mesh format export is controlled by file suffix, in `importGmshMesh.py`
Code: Select all
output_format_suffix = {'Gmsh MSH':'.msh', 'I-Deas universal':'.unv', 'Automatic':'.msh',
'STL surface':'.stl', 'INRIA medit':'.mesh', 'CGNS':'.cgns',
'Salome mesh':'med', 'Abaqus INP':'.inp', 'Ploy surface':'.ply2'}
## testing
For Fenics mesh support, only first order element triangle2D or tetra 3D element is supported, 2D and 3D mesh exporting is possible. However, boundary mesh is not supported yet, it is bit tricky but achievable. see http://www.iesensor.com/blog/2017/05/24 ... s_meshing/. This could be another route as Joha2's fenincs mesh import and export feature.
*. CGNS: gmsh is not compiled with CGNS support, hence not tested
*,msh, the GMSH native format, test passed for 2D and 3D mesh
*.ply2, tested passed for 2D mesh
the feature branch:
https://github.com/qingfengxia/FreeCAD/tree/fenicsmesh
testing FreeCAD file for 2D, 3D is too large to upload here.
## todo
I will try to export fenics itnerior mesh and boundary mesh, then send a PR soon.
Previously, I write a script to export only 3D mesh for OpenFOAM (CfdWorkbench), now it is possible to export 2D mesh for OpenFOAM
using gmshToFoam, see tutorial https://openfoamwiki.net/index.php/2D_M ... using_GMSH
If you hope some specific mesh format to be supprted and tested, please let me know.
Thanks