From 542223f5b6df20bf2dd8657f553178f7f2c3fc81 Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Tue, 13 Jun 2023 07:12:00 -0600 Subject: [PATCH] FEM: let gmsh infer format from file name I sometimes use the FEM workbench to create meshes for a problem that I'll solve with an external FE solver that doesn't yet have workbench integration, or to prepare a Gmsh file for tweaks from directly running Gmsh. The .unv format is pretty limited on technical grounds so I rename the file to .msh (can express everything Gmsh can) or a parallel-friendly format. Explicitly setting Mesh.Format = 2 is confusing because this line also needs to be fixed (or deleted) when renaming the output file name. --- src/Mod/Fem/femmesh/gmshtools.py | 1 - src/Mod/Fem/femtest/data/elmer/group_mesh.geo | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Mod/Fem/femmesh/gmshtools.py b/src/Mod/Fem/femmesh/gmshtools.py index 3252efaccf..a8de810248 100644 --- a/src/Mod/Fem/femmesh/gmshtools.py +++ b/src/Mod/Fem/femmesh/gmshtools.py @@ -869,7 +869,6 @@ class GmshTools(): # save mesh geo.write("// save\n") - geo.write("Mesh.Format = 2;\n") # unv if self.group_elements and self.group_nodes_export: geo.write("// For each group save not only the elements but the nodes too.;\n") geo.write("Mesh.SaveGroupsOfNodes = 1;\n") diff --git a/src/Mod/Fem/femtest/data/elmer/group_mesh.geo b/src/Mod/Fem/femtest/data/elmer/group_mesh.geo index ee2e3e0c5f..f379e9e6ff 100644 --- a/src/Mod/Fem/femtest/data/elmer/group_mesh.geo +++ b/src/Mod/Fem/femtest/data/elmer/group_mesh.geo @@ -41,7 +41,6 @@ Mesh 3; Coherence Mesh; // Remove duplicate vertices // save -Mesh.Format = 2; // Ignore Physical definitions and save all elements; Mesh.SaveAll = 1; Save "/tmp/tmpjVhNNb.unv";