test result: it is fine to use this feature in GUI and nonGUI mode, except for 3 formats, see result report below
There is some bugs I fixed, it is on my FreeCAD repo, just one commit top on Bernd's
To
https://github.com/qingfengxia/FreeCAD.git
* [new branch] femgmshexport -> femgmshexport
https://github.com/qingfengxia/FreeCAD/ ... gmshexport
Code: Select all
#to run this test script in console
#mo=
#get the meshobj in FreeCAD python console, then paste the lines into the console
import femmesh.gmshtools as gmshtools
gmsh = gmshtools.GmshTools(mo)
from importGmshMesh import _run_command
for k in gmshtools.GmshTools.output_format_suffix:
fileString = "/tmp/test" + gmshtools.GmshTools.output_format_suffix[k]
ret = gmsh.export_mesh(k, fileString)
_run_command(["gmsh", "-open", fileString])
######### result ############
I have warning during UNV mesh write
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
but gmsh can read back this mesh properly
tested on gmsh 4.3 ubuntu 18.04 64bit, 3 formats failed
I have no domain knowledge to solve these errors.
1. error inp.
Error : '/tmp/test.inp', line 1 : syntax error (*)
cat this inp file, first 3 lines
'''
*Heading
/tmp/test.inp
*NODE
'''
2. error ply2
Error : Wrong vertex index 97
3. error su2
Error : '/tmp/test.su2', line 2 : syntax error (NELEM)
'''
NDIME= 3
NELEM= 217
10 71 90 100 63 0
10 90 73 81 100 1
'''