diff --git a/gustaf/io/meshio.py b/gustaf/io/meshio.py index ad66e6eb..c2706ae4 100644 --- a/gustaf/io/meshio.py +++ b/gustaf/io/meshio.py @@ -84,7 +84,7 @@ def load(fname): return meshes[0] if len(meshes) == 1 else meshes -def export(mesh, fname, submeshes=None, **kwargs): +def export(fname, mesh, submeshes=None, **kwargs): """Export mesh elements and vertex data into meshio and use its write function. The definition of submeshes with identical vertex coordinates is possible. In that case vertex numbering and data from the main mesh @@ -132,10 +132,10 @@ def export(mesh, fname, submeshes=None, **kwargs): Parameters ------------ - mesh: Edges, Faces or Volumes - Input mesh fname: Union[str, pathlib.Path] File to save the mesh in. + mesh: Edges, Faces or Volumes + Input mesh submeshes: Iterable Submeshes where the vertices are identical to the main mesh. The element type can be identical to mesh.elements or lower-dimensional (e.g. @@ -164,7 +164,8 @@ def export(mesh, fname, submeshes=None, **kwargs): cells = [] # Merge main mesh and submeshes in one list - meshes = [mesh] + meshes = mesh if isinstance(mesh, list) else [mesh] + if submeshes is not None: meshes.extend(submeshes) diff --git a/gustaf/io/mfem.py b/gustaf/io/mfem.py index 1b38ac71..c4ca9e89 100644 --- a/gustaf/io/mfem.py +++ b/gustaf/io/mfem.py @@ -107,15 +107,15 @@ def extract_values(fname, start_index, n_lines, total_lines, dtype): return mesh -def export(mesh, fname): +def export(fname, mesh): """Export mesh in MFEM format. Supports 2D triangle and quadrilateral meshes. Does not support different element attributes or difference in vertex dimension and mesh dimension. Parameters ------------ - mesh: Faces fname: str + mesh: Faces Returns ------------ diff --git a/gustaf/io/mixd.py b/gustaf/io/mixd.py index 60025d8d..e873e54c 100644 --- a/gustaf/io/mixd.py +++ b/gustaf/io/mixd.py @@ -116,8 +116,8 @@ def load( def export( - mesh, fname, + mesh, space_time=False, dual=False, ): diff --git a/gustaf/io/nutils.py b/gustaf/io/nutils.py index b5915c46..f12d359e 100644 --- a/gustaf/io/nutils.py +++ b/gustaf/io/nutils.py @@ -61,14 +61,14 @@ def load(fname): return mesh -def export(mesh, fname): +def export(fname, mesh): """Export in Nutils format. Files are saved as np.savez(). Supports triangle,and tetrahedron Meshes. Parameters ----------- - mesh: Faces or Volumes fname: str + mesh: Faces or Volumes Returns --------