bos #42618: unavailable meshio formats removed from GUI; Gmsh 2 format added to tested formats

This commit is contained in:
Guytri KASTANE 2024-07-25 17:04:56 +02:00
parent 446795b1c1
commit 84843d54ca
2 changed files with 19 additions and 14 deletions

View File

@ -133,35 +133,37 @@ const QStringList& SMESHGUI_Meshio::GetExportFileFilter()
{
static const QStringList filter = {
"Abaqus (*.inp)",
"ANSYS msh (*.msh)",
//"ANSYS msh (*.msh)",
"AVS-UCD (*.avs)",
"CGNS (*.cgns)",
//"CGNS (*.cgns)",
"DOLFIN XML (*.xml)",
#if !defined(WIN32)
"Exodus (*.e *.exo)",
#endif
"FLAC3D (*.f3grid)",
"Gmsh 2.2 (*.msh)",
"Gmsh 4.0, and 4.1 (*.msh)",
"H5M (*.h5m)",
//"Gmsh 4.0, and 4.1 (*.msh)",
//"H5M (*.h5m)",
"Kratos/MDPA (*.mdpa)",
"MED/Salome (*.med)",
"Medit (*.mesh *.meshb)",
"Nastran (*.bdf *fem *.nas)",
"Netgen(*.vol *.vol.gz)",
"OBJ (*.obj)",
#if !defined(WIN32)
"OFF (*.off)",
#endif
"PERMAS (*.post *.post.gz *.dato *.dato.gz)",
"PLY (*.ply)",
//"PLY (*.ply)",
"STL (*.stl)",
"SU2 (*.su2)",
"SVG, 2D output only (*.svg)",
"Tecplot (*.dat)",
"TetGen (*.node *.ele)",
"UGRID (*.ugrid)",
//"SU2 (*.su2)",
//"SVG, 2D output only (*.svg)",
//"Tecplot (*.dat)",
//"TetGen (*.node *.ele)",
//"UGRID (*.ugrid)",
"VTK (*.vtk)",
"VTU (*.vtu)",
"WKT, TIN (*.wkt)",
//"WKT, TIN (*.wkt)",
"XDMF (*.xdmf *.xmf)"
};

View File

@ -112,7 +112,7 @@ def file_extensions():
'.med',
'.mesh',
'.meshb',
# '.msh', # meshio KeyError: "Illegal ANSYS cell type 'line'
'.msh', # meshio KeyError: "Illegal ANSYS cell type 'line'
'.nas',
# '.node', # never returns from meshio convert command
# '.obj', # meshio._exceptions.WriteError: Wavefront .obj files can only contain triangle or quad cells
@ -159,8 +159,11 @@ def export_mesh(mesh, file_name, errors):
try:
print('Export to file: ', file_name)
# Here we use an empty selected filter to make things simpler
mesh.ExportMESHIO(file_name, '', mesh)
# Here we use an empty selected filter to make things simpler. Excepted .msh extension
selected_filter = ""
if ".msh" in file_name:
selected_filter="Gmsh 2"
mesh.ExportMESHIO(file_name, selected_filter, mesh)
return True
except SALOME.SALOME_Exception as ex: