meshlane 5.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. meshlane-5.4.0/CHANGELOG.md +93 -0
  2. meshlane-5.4.0/LICENSE.txt +22 -0
  3. meshlane-5.4.0/MANIFEST.in +6 -0
  4. meshlane-5.4.0/PKG-INFO +261 -0
  5. meshlane-5.4.0/README.md +204 -0
  6. meshlane-5.4.0/pyproject.toml +69 -0
  7. meshlane-5.4.0/setup.cfg +4 -0
  8. meshlane-5.4.0/src/meshlane/__about__.py +13 -0
  9. meshlane-5.4.0/src/meshlane/__init__.py +94 -0
  10. meshlane-5.4.0/src/meshlane/_cli/__init__.py +3 -0
  11. meshlane-5.4.0/src/meshlane/_cli/_ascii.py +62 -0
  12. meshlane-5.4.0/src/meshlane/_cli/_binary.py +60 -0
  13. meshlane-5.4.0/src/meshlane/_cli/_compress.py +81 -0
  14. meshlane-5.4.0/src/meshlane/_cli/_convert.py +75 -0
  15. meshlane-5.4.0/src/meshlane/_cli/_decompress.py +50 -0
  16. meshlane-5.4.0/src/meshlane/_cli/_info.py +40 -0
  17. meshlane-5.4.0/src/meshlane/_cli/_main.py +63 -0
  18. meshlane-5.4.0/src/meshlane/_common.py +169 -0
  19. meshlane-5.4.0/src/meshlane/_cxml/__init__.py +3 -0
  20. meshlane-5.4.0/src/meshlane/_cxml/etree.py +60 -0
  21. meshlane-5.4.0/src/meshlane/_exceptions.py +10 -0
  22. meshlane-5.4.0/src/meshlane/_files.py +16 -0
  23. meshlane-5.4.0/src/meshlane/_helpers.py +207 -0
  24. meshlane-5.4.0/src/meshlane/_mesh.py +441 -0
  25. meshlane-5.4.0/src/meshlane/_vtk_common.py +205 -0
  26. meshlane-5.4.0/src/meshlane/abaqus/__init__.py +3 -0
  27. meshlane-5.4.0/src/meshlane/abaqus/_abaqus.py +453 -0
  28. meshlane-5.4.0/src/meshlane/ansys/__init__.py +3 -0
  29. meshlane-5.4.0/src/meshlane/ansys/_ansys.py +465 -0
  30. meshlane-5.4.0/src/meshlane/ansysInp/__init__.py +3 -0
  31. meshlane-5.4.0/src/meshlane/ansysInp/_ansysInp.py +332 -0
  32. meshlane-5.4.0/src/meshlane/avsucd/__init__.py +3 -0
  33. meshlane-5.4.0/src/meshlane/avsucd/_avsucd.py +243 -0
  34. meshlane-5.4.0/src/meshlane/cgns/__init__.py +3 -0
  35. meshlane-5.4.0/src/meshlane/cgns/_cgns.py +101 -0
  36. meshlane-5.4.0/src/meshlane/dolfin/__init__.py +3 -0
  37. meshlane-5.4.0/src/meshlane/dolfin/_dolfin.py +239 -0
  38. meshlane-5.4.0/src/meshlane/exodus/__init__.py +3 -0
  39. meshlane-5.4.0/src/meshlane/exodus/_exodus.py +373 -0
  40. meshlane-5.4.0/src/meshlane/flac3d/__init__.py +3 -0
  41. meshlane-5.4.0/src/meshlane/flac3d/_flac3d.py +611 -0
  42. meshlane-5.4.0/src/meshlane/gmsh/__init__.py +5 -0
  43. meshlane-5.4.0/src/meshlane/gmsh/_gmsh22.py +411 -0
  44. meshlane-5.4.0/src/meshlane/gmsh/_gmsh40.py +400 -0
  45. meshlane-5.4.0/src/meshlane/gmsh/_gmsh41.py +768 -0
  46. meshlane-5.4.0/src/meshlane/gmsh/common.py +285 -0
  47. meshlane-5.4.0/src/meshlane/gmsh/main.py +250 -0
  48. meshlane-5.4.0/src/meshlane/h5m/__init__.py +3 -0
  49. meshlane-5.4.0/src/meshlane/h5m/_h5m.py +271 -0
  50. meshlane-5.4.0/src/meshlane/hmf/__init__.py +3 -0
  51. meshlane-5.4.0/src/meshlane/hmf/_hmf.py +155 -0
  52. meshlane-5.4.0/src/meshlane/mdpa/__init__.py +3 -0
  53. meshlane-5.4.0/src/meshlane/mdpa/_mdpa.py +525 -0
  54. meshlane-5.4.0/src/meshlane/med/__init__.py +4 -0
  55. meshlane-5.4.0/src/meshlane/med/_med.py +771 -0
  56. meshlane-5.4.0/src/meshlane/med/_med41.py +159 -0
  57. meshlane-5.4.0/src/meshlane/med/_medmulti.py +526 -0
  58. meshlane-5.4.0/src/meshlane/medit/__init__.py +3 -0
  59. meshlane-5.4.0/src/meshlane/medit/_medit.py +526 -0
  60. meshlane-5.4.0/src/meshlane/medit/_medit_internal.py +224 -0
  61. meshlane-5.4.0/src/meshlane/nastran/__init__.py +3 -0
  62. meshlane-5.4.0/src/meshlane/nastran/_nastran.py +540 -0
  63. meshlane-5.4.0/src/meshlane/netgen/__init__.py +3 -0
  64. meshlane-5.4.0/src/meshlane/netgen/_netgen.py +458 -0
  65. meshlane-5.4.0/src/meshlane/neuroglancer/__init__.py +3 -0
  66. meshlane-5.4.0/src/meshlane/neuroglancer/_neuroglancer.py +80 -0
  67. meshlane-5.4.0/src/meshlane/obj/__init__.py +3 -0
  68. meshlane-5.4.0/src/meshlane/obj/_obj.py +136 -0
  69. meshlane-5.4.0/src/meshlane/off/__init__.py +3 -0
  70. meshlane-5.4.0/src/meshlane/off/_off.py +95 -0
  71. meshlane-5.4.0/src/meshlane/openfoam/__init__.py +3 -0
  72. meshlane-5.4.0/src/meshlane/openfoam/_openfoam.py +712 -0
  73. meshlane-5.4.0/src/meshlane/permas/__init__.py +3 -0
  74. meshlane-5.4.0/src/meshlane/permas/_permas.py +290 -0
  75. meshlane-5.4.0/src/meshlane/ply/__init__.py +3 -0
  76. meshlane-5.4.0/src/meshlane/ply/_ply.py +531 -0
  77. meshlane-5.4.0/src/meshlane/stl/__init__.py +3 -0
  78. meshlane-5.4.0/src/meshlane/stl/_stl.py +258 -0
  79. meshlane-5.4.0/src/meshlane/su2/__init__.py +3 -0
  80. meshlane-5.4.0/src/meshlane/su2/_su2.py +373 -0
  81. meshlane-5.4.0/src/meshlane/svg/__init__.py +3 -0
  82. meshlane-5.4.0/src/meshlane/svg/_svg.py +107 -0
  83. meshlane-5.4.0/src/meshlane/tecplot/__init__.py +3 -0
  84. meshlane-5.4.0/src/meshlane/tecplot/_tecplot.py +508 -0
  85. meshlane-5.4.0/src/meshlane/tetgen/__init__.py +3 -0
  86. meshlane-5.4.0/src/meshlane/tetgen/_tetgen.py +168 -0
  87. meshlane-5.4.0/src/meshlane/ugrid/__init__.py +3 -0
  88. meshlane-5.4.0/src/meshlane/ugrid/_ugrid.py +279 -0
  89. meshlane-5.4.0/src/meshlane/vtk/__init__.py +3 -0
  90. meshlane-5.4.0/src/meshlane/vtk/_main.py +46 -0
  91. meshlane-5.4.0/src/meshlane/vtk/_vtk_42.py +764 -0
  92. meshlane-5.4.0/src/meshlane/vtk/_vtk_51.py +655 -0
  93. meshlane-5.4.0/src/meshlane/vtu/__init__.py +3 -0
  94. meshlane-5.4.0/src/meshlane/vtu/_vtu.py +912 -0
  95. meshlane-5.4.0/src/meshlane/wkt/__init__.py +3 -0
  96. meshlane-5.4.0/src/meshlane/wkt/_wkt.py +104 -0
  97. meshlane-5.4.0/src/meshlane/xdmf/__init__.py +9 -0
  98. meshlane-5.4.0/src/meshlane/xdmf/common.py +175 -0
  99. meshlane-5.4.0/src/meshlane/xdmf/main.py +556 -0
  100. meshlane-5.4.0/src/meshlane/xdmf/time_series.py +479 -0
  101. meshlane-5.4.0/src/meshlane.egg-info/PKG-INFO +261 -0
  102. meshlane-5.4.0/src/meshlane.egg-info/SOURCES.txt +145 -0
  103. meshlane-5.4.0/src/meshlane.egg-info/dependency_links.txt +1 -0
  104. meshlane-5.4.0/src/meshlane.egg-info/entry_points.txt +2 -0
  105. meshlane-5.4.0/src/meshlane.egg-info/requires.txt +9 -0
  106. meshlane-5.4.0/src/meshlane.egg-info/top_level.txt +1 -0
  107. meshlane-5.4.0/tests/__init__.py +0 -0
  108. meshlane-5.4.0/tests/helpers.py +765 -0
  109. meshlane-5.4.0/tests/legacy_reader.py +184 -0
  110. meshlane-5.4.0/tests/legacy_writer.py +226 -0
  111. meshlane-5.4.0/tests/performance.py +336 -0
  112. meshlane-5.4.0/tests/test_abaqus.py +78 -0
  113. meshlane-5.4.0/tests/test_ansys.py +27 -0
  114. meshlane-5.4.0/tests/test_ansysInp.py +459 -0
  115. meshlane-5.4.0/tests/test_avsucd.py +25 -0
  116. meshlane-5.4.0/tests/test_cgns.py +16 -0
  117. meshlane-5.4.0/tests/test_cli.py +80 -0
  118. meshlane-5.4.0/tests/test_dolfin.py +28 -0
  119. meshlane-5.4.0/tests/test_exodus.py +37 -0
  120. meshlane-5.4.0/tests/test_flac3d.py +67 -0
  121. meshlane-5.4.0/tests/test_gmsh.py +235 -0
  122. meshlane-5.4.0/tests/test_helpers.py +74 -0
  123. meshlane-5.4.0/tests/test_hmf.py +43 -0
  124. meshlane-5.4.0/tests/test_mdpa.py +40 -0
  125. meshlane-5.4.0/tests/test_med.py +1360 -0
  126. meshlane-5.4.0/tests/test_medit.py +137 -0
  127. meshlane-5.4.0/tests/test_mesh.py +108 -0
  128. meshlane-5.4.0/tests/test_moab.py +27 -0
  129. meshlane-5.4.0/tests/test_nastran.py +69 -0
  130. meshlane-5.4.0/tests/test_netgen.py +119 -0
  131. meshlane-5.4.0/tests/test_neuroglancer.py +35 -0
  132. meshlane-5.4.0/tests/test_obj.py +41 -0
  133. meshlane-5.4.0/tests/test_off.py +22 -0
  134. meshlane-5.4.0/tests/test_openfoam.py +1110 -0
  135. meshlane-5.4.0/tests/test_permas.py +33 -0
  136. meshlane-5.4.0/tests/test_ply.py +66 -0
  137. meshlane-5.4.0/tests/test_public.py +6 -0
  138. meshlane-5.4.0/tests/test_stl.py +24 -0
  139. meshlane-5.4.0/tests/test_su2.py +44 -0
  140. meshlane-5.4.0/tests/test_svg.py +19 -0
  141. meshlane-5.4.0/tests/test_tecplot.py +74 -0
  142. meshlane-5.4.0/tests/test_tetgen.py +36 -0
  143. meshlane-5.4.0/tests/test_ugrid.py +250 -0
  144. meshlane-5.4.0/tests/test_vtk.py +121 -0
  145. meshlane-5.4.0/tests/test_vtu.py +80 -0
  146. meshlane-5.4.0/tests/test_wkt.py +37 -0
  147. meshlane-5.4.0/tests/test_xdmf.py +123 -0
@@ -0,0 +1,93 @@
1
+ <!--pytest-codeblocks:skipfile-->
2
+ # Changelog
3
+
4
+ This document only describes _breaking_ changes in meshio. If you are interested in bug
5
+ fixes, enhancements etc., best follow [the meshio project on
6
+ GitHub](https://github.com/nschloe/meshio). meshlane-specific changes are listed at the
7
+ top; the meshio history follows below.
8
+
9
+ ## meshlane 5.4.0
10
+
11
+ meshlane is a fork of meshio, maintained by Simvia. Breaking changes relative to the
12
+ meshio base it forked from:
13
+
14
+ - The Python package and import name is now `meshlane` (was `meshio`), and the
15
+ command-line tool is `meshlane` (was `meshio`).
16
+ - `numpy` is temporarily pinned to `<2` pending a numpy 2.x migration.
17
+
18
+ Fork additions carried over (non-breaking): OpenFOAM polyMesh reader, Ansys/APDL `.inp`
19
+ reader, and MED/Salome improvements (multi-mesh, polygon support, more robust
20
+ Code_Aster round-trips).
21
+
22
+ ## v5.1.0 (Dec 11, 2021)
23
+
24
+ - CellBlocks are no longer tuples, but classes. You can no longer iterate over them like
25
+ ```python
26
+ for cell_type, cell_data in cells:
27
+ pass
28
+ ```
29
+ Instead, use
30
+ ```python
31
+ for cell_block in cells:
32
+ cell_block.type
33
+ cell_block.data
34
+ ```
35
+
36
+ ## v5.0.0 (Aug 06, 2021)
37
+
38
+ - meshio now only provides one command-line tool, `meshio`, with subcommands like
39
+ `info`, `convert`, etc. This replaces the former `meshio-info`, `meshio-convert` etc.
40
+
41
+ ## v4.4.0 (Apr 29, 2021)
42
+
43
+ - Polygons are now stored as `"polygon"` cell blocks, not `"polygonN"` (where `N` is the
44
+ number of nodes per polygon). One can simply retrieve the number of points via
45
+ `cellblock.data.shape[1]`.
46
+
47
+ ## v4.0.0 (Feb 18, 2020)
48
+
49
+ - `mesh.cells` used to be a dictionary of the form
50
+
51
+ ```python
52
+ {
53
+ "triangle": [[0, 1, 2], [0, 2, 3]],
54
+ "quad": [[0, 7, 1, 10], ...]
55
+ }
56
+ ```
57
+
58
+ From 4.0.0 on, `mesh.cells` is a list of tuples,
59
+
60
+ ```python
61
+ [
62
+ ("triangle", [[0, 1, 2], [0, 2, 3]]),
63
+ ("quad", [[0, 7, 1, 10], ...])
64
+ ]
65
+ ```
66
+
67
+ This has the advantage that multiple blocks of the same cell type can be accounted
68
+ for. Also, cell ordering can be preserved.
69
+
70
+ You can now use the method `mesh.get_cells_type("triangle")` to get all cells of
71
+ `"triangle"` type, or use `mesh.cells_dict` to build the old dictionary structure.
72
+
73
+ - `mesh.cell_data` used to be a dictionary of the form
74
+
75
+ ```python
76
+ {
77
+ "triangle": {"a": [0.5, 1.3], "b": [2.17, 41.3]},
78
+ "quad": {"a": [1.1, -0.3, ...], "b": [3.14, 1.61, ...]},
79
+ }
80
+ ```
81
+
82
+ From 4.0.0 on, `mesh.cell_data` is a dictionary of lists,
83
+
84
+ ```python
85
+ {
86
+ "a": [[0.5, 1.3], [1.1, -0.3, ...]],
87
+ "b": [[2.17, 41.3], [3.14, 1.61, ...]],
88
+ }
89
+ ```
90
+
91
+ Each data list, e.g., `mesh.cell_data["a"]`, can be `zip`ped with `mesh.cells`.
92
+
93
+ An old-style `cell_data` dictionary can be retrieved via `mesh.cell_data_dict`.
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2021 Nico Schlömer et al.
4
+ Copyright (c) 2026 Simvia and the meshlane contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include LICENSE.txt
2
+ include CHANGELOG.md
3
+ # Ship the test suite, but not the (heavy) test meshes — those stay in the
4
+ # git/LFS repo. Keeps the sdist small.
5
+ recursive-include tests *.py
6
+ prune tests/meshes
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshlane
3
+ Version: 5.4.0
4
+ Summary: I/O for many mesh formats
5
+ Author-email: Mariam Kesba <mariam.kesba@simvia.tech>, Fatima-Zahra Noussi <fatima-zahra.noussi@simvia.tech>, Lucas Sovre <lucas.sovre@simvia.tech>
6
+ License: The MIT License (MIT)
7
+
8
+ Copyright (c) 2015-2021 Nico Schlömer et al.
9
+ Copyright (c) 2026 Simvia and the meshlane contributors
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: homepage, https://github.com/simvia-tech/meshlane
30
+ Project-URL: code, https://github.com/simvia-tech/meshlane
31
+ Project-URL: issues, https://github.com/simvia-tech/meshlane/issues
32
+ Keywords: mesh,file formats,scientific,engineering,fem,finite elements
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Programming Language :: Python
35
+ Classifier: Intended Audience :: Science/Research
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python
39
+ Classifier: Programming Language :: Python :: 3
40
+ Classifier: Programming Language :: Python :: 3.8
41
+ Classifier: Programming Language :: Python :: 3.9
42
+ Classifier: Programming Language :: Python :: 3.10
43
+ Classifier: Programming Language :: Python :: 3.11
44
+ Classifier: Programming Language :: Python :: 3.12
45
+ Classifier: Topic :: Scientific/Engineering
46
+ Classifier: Topic :: Utilities
47
+ Requires-Python: >=3.8
48
+ Description-Content-Type: text/markdown
49
+ License-File: LICENSE.txt
50
+ Requires-Dist: importlib_metadata; python_version < "3.8"
51
+ Requires-Dist: numpy<2,>=1.20.0
52
+ Requires-Dist: rich
53
+ Provides-Extra: all
54
+ Requires-Dist: netCDF4; extra == "all"
55
+ Requires-Dist: h5py; extra == "all"
56
+ Dynamic: license-file
57
+
58
+ <h1 align="center">meshlane</h1>
59
+
60
+ <p align="center"><img src="https://raw.githubusercontent.com/simvia-tech/meshlane/main/logo/meshlane.svg" width="400" style="max-width: 100%;" /></p>
61
+
62
+ <p align="center">I/O for mesh files: convert smoothly between many formats.</p>
63
+
64
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/simvia-tech/meshlane/blob/main/LICENSE.txt)
65
+ [![PyPI version](https://img.shields.io/pypi/v/meshlane.svg?style=flat-square)](https://pypi.org/project/meshlane/)
66
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
67
+
68
+ > **meshlane** is an actively maintained descendant of
69
+ > [meshio](https://github.com/nschloe/meshio) by Nico Schlömer.
70
+ > It builds directly on meshio's codebase and history, and extends it with new
71
+ > format support and fixes geared toward FEA/CFD interoperability
72
+ > (code_aster, Ansys, OpenFOAM, Salome/MED). See [Relationship to meshio](#relationship-to-meshio).
73
+
74
+ There are many mesh formats for representing unstructured meshes. meshlane reads
75
+ and writes all of the following and converts smoothly between them:
76
+
77
+ > [Abaqus](http://abaqus.software.polimi.it/v6.14/index.html) (`.inp`),
78
+ > ANSYS msh (`.msh`),
79
+ > **Ansys/APDL input** (`.inp`, `.cdb`),
80
+ > [AVS-UCD](https://lanl.github.io/LaGriT/pages/docs/read_avs.html) (`.avs`),
81
+ > [CGNS](https://cgns.github.io/) (`.cgns`),
82
+ > [DOLFIN XML](https://manpages.ubuntu.com/manpages/jammy/en/man1/dolfin-convert.1.html) (`.xml`),
83
+ > [Exodus](https://nschloe.github.io/meshio/exodus.pdf) (`.e`, `.exo`),
84
+ > [FLAC3D](https://www.itascacg.com/software/flac3d) (`.f3grid`),
85
+ > [H5M](https://www.mcs.anl.gov/~fathom/moab-docs/h5mmain.html) (`.h5m`),
86
+ > [Kratos/MDPA](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data) (`.mdpa`),
87
+ > [Medit](https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html) (`.mesh`, `.meshb`),
88
+ > [MED/Salome](https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/med-file.html) (`.med`),
89
+ > [Nastran](https://help.autodesk.com/view/NSTRN/2019/ENU/?guid=GUID-42B54ACB-FBE3-47CA-B8FE-475E7AD91A00) (bulk data, `.bdf`, `.fem`, `.nas`),
90
+ > [Netgen](https://github.com/ngsolve/netgen) (`.vol`, `.vol.gz`),
91
+ > [Neuroglancer precomputed format](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed#mesh-representation-of-segmented-object-surfaces),
92
+ > [Gmsh](https://gmsh.info/doc/texinfo/gmsh.html#File-formats) (formats 2.2, 4.0, 4.1, `.msh`),
93
+ > [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) (`.obj`),
94
+ > [OFF](https://segeval.cs.princeton.edu/public/off_format.html) (`.off`),
95
+ > **OpenFOAM polyMesh** (.foam, read only),
96
+ > [PERMAS](https://www.intes.de) (`.post`, `.post.gz`, `.dato`, `.dato.gz`),
97
+ > [PLY](<https://en.wikipedia.org/wiki/PLY_(file_format)>) (`.ply`),
98
+ > [STL](<https://en.wikipedia.org/wiki/STL_(file_format)>) (`.stl`),
99
+ > [Tecplot .dat](http://paulbourke.net/dataformats/tp/),
100
+ > [TetGen .node/.ele](https://wias-berlin.de/software/tetgen/fformats.html),
101
+ > [SVG](https://www.w3.org/TR/SVG/) (2D output only) (`.svg`),
102
+ > [SU2](https://su2code.github.io/docs_v7/Mesh-File/) (`.su2`),
103
+ > [UGRID](https://www.simcenter.msstate.edu/software/documentation/ug_io/3d_grid_file_type_ugrid.html) (`.ugrid`),
104
+ > [VTK](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf) (`.vtk`),
105
+ > [VTU](https://vtk.org/Wiki/VTK_XML_Formats) (`.vtu`),
106
+ > [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) ([TIN](https://en.wikipedia.org/wiki/Triangulated_irregular_network)) (`.wkt`),
107
+ > [XDMF](https://xdmf.org/index.php/XDMF_Model_and_Format) (`.xdmf`, `.xmf`).
108
+
109
+ ## What meshlane adds over meshio
110
+
111
+ - **OpenFOAM polyMesh reader**: ASCII and binary, arbitrary cell types (tri / quad / polyhedra).
112
+ - **Ansys/APDL** `.inp` / `.cdb` reader & writer for FEA interoperability.
113
+ - **MED/Salome improvements:**
114
+ - multi-mesh files (several meshes in one `.med`)
115
+ - polygon cell support, including ragged/Voronoi meshes
116
+ - multi-timestep result fields, with `NDT`/`NOR`/`PDT` preserved
117
+ - round-trip of mesh metadata, field units and component names
118
+ - MED 4.1 bitmask metadata and HDF5 link-creation-order, so files stay
119
+ readable by Salome / medfile / mdump
120
+ - extended field data types (float32/64, int32/64)
121
+ - robust handling of missing `FAS` / `NOEUD` / `GRO` sections and merged cell blocks
122
+ - Encoding and parsing robustness fixes (Latin-1 metadata, group name parsing).
123
+
124
+ ## Installation
125
+
126
+ meshlane is available [on PyPI](https://pypi.org/project/meshlane/):
127
+
128
+ <!--pytest-codeblocks:skip-->
129
+
130
+ ```sh
131
+ pip install meshlane[all]
132
+ ```
133
+
134
+ (`[all]` pulls in the optional dependencies `netCDF4` and `h5py`, required for the
135
+ CGNS, H5M, MED and XDMF formats. By default only numpy is needed.)
136
+
137
+ To install from source instead:
138
+
139
+ <!--pytest-codeblocks:skip-->
140
+
141
+ ```sh
142
+ git clone https://github.com/simvia-tech/meshlane.git
143
+ cd meshlane
144
+ pip install -e .[all]
145
+ ```
146
+
147
+ ## Usage
148
+
149
+ Command line:
150
+
151
+ <!--pytest-codeblocks:skip-->
152
+
153
+ ```sh
154
+ meshlane convert input.msh output.vtk # convert between two formats
155
+ meshlane info input.xdmf # show some info about the mesh
156
+ meshlane compress input.vtu # compress the mesh file
157
+ meshlane decompress input.vtu # decompress the mesh file
158
+ meshlane binary input.msh # convert to binary format
159
+ meshlane ascii input.msh # convert to ASCII format
160
+ ```
161
+
162
+ In Python, read a mesh:
163
+
164
+ <!--pytest-codeblocks:skip-->
165
+
166
+ ```python
167
+ import meshlane
168
+
169
+ mesh = meshlane.read(
170
+ filename, # path, os.PathLike, or a buffer/open file
171
+ # file_format="stl", # optional; inferred from the extension
172
+ )
173
+ # mesh.points, mesh.cells, mesh.cells_dict, ...
174
+ ```
175
+
176
+ Write a mesh:
177
+
178
+ ```python
179
+ import meshlane
180
+
181
+ points = [
182
+ [0.0, 0.0], [1.0, 0.0], [0.0, 1.0],
183
+ [1.0, 1.0], [2.0, 0.0], [2.0, 1.0],
184
+ ]
185
+ cells = [
186
+ ("triangle", [[0, 1, 2], [1, 3, 2]]),
187
+ ("quad", [[1, 4, 5, 3]]),
188
+ ]
189
+
190
+ mesh = meshlane.Mesh(
191
+ points,
192
+ cells,
193
+ point_data={"T": [0.3, -1.2, 0.5, 0.7, 0.0, -3.0]},
194
+ cell_data={"a": [[0.1, 0.2], [0.4]]},
195
+ )
196
+ mesh.write("foo.vtk")
197
+
198
+ # Or, equivalently:
199
+ meshlane.write_points_cells("foo.vtk", points, cells)
200
+ ```
201
+
202
+ For both reading and writing you may pass `file_format=` explicitly (e.g. to force
203
+ ASCII over binary VTK).
204
+
205
+ ### Time series
206
+
207
+ The [XDMF format](https://xdmf.org/index.php/XDMF_Model_and_Format) supports time
208
+ series sharing one mesh:
209
+
210
+ <!--pytest-codeblocks:skip-->
211
+
212
+ ```python
213
+ with meshlane.xdmf.TimeSeriesWriter(filename) as writer:
214
+ writer.write_points_cells(points, cells)
215
+ for t in [0.0, 0.1, 0.21]:
216
+ writer.write_data(t, point_data={"phi": data})
217
+ ```
218
+
219
+ <!--pytest-codeblocks:skip-->
220
+
221
+ ```python
222
+ with meshlane.xdmf.TimeSeriesReader(filename) as reader:
223
+ points, cells = reader.read_points_cells()
224
+ for k in range(reader.num_steps):
225
+ t, point_data, cell_data = reader.read_data(k)
226
+ ```
227
+
228
+ ## Testing
229
+
230
+ <!--pytest-codeblocks:skip-->
231
+
232
+ ```sh
233
+ tox
234
+ ```
235
+
236
+ (Some test meshes are stored with Git LFS; run `git lfs pull` after cloning.)
237
+
238
+ ## Relationship to meshio
239
+
240
+ meshlane is a fork of [meshio](https://github.com/nschloe/meshio). We kept the full
241
+ git history and authorship so the original work remains properly attributed. We
242
+ started a separate project, rather than only contributing upstream, to move faster
243
+ on the FEA/CFD interoperability features we need (code_aster, Ansys, code_saturne, OpenFOAM,
244
+ Salome, etc.) and to maintain them under active development.
245
+
246
+ meshio is no longer actively maintained. [Simvia](https://simvia.tech) is a company
247
+ willing to commit time and people to keep this project alive and moving forward.
248
+
249
+ ## Contributing
250
+
251
+ Everyone is welcome, individuals and companies alike. If you want to help us keep
252
+ meshlane maintained, we would be glad to have you on board. We will do our best to
253
+ triage issues quickly and to give timely, constructive feedback on pull requests.
254
+
255
+ Huge thanks to Nico Schlömer and all meshio contributors for the foundation this
256
+ project is built on.
257
+
258
+ ## License
259
+
260
+ meshlane is published under the [MIT license](https://github.com/simvia-tech/meshlane/blob/main/LICENSE.txt), the same as meshio.
261
+ Copyright is retained by the original meshio authors and the meshlane contributors.
@@ -0,0 +1,204 @@
1
+ <h1 align="center">meshlane</h1>
2
+
3
+ <p align="center"><img src="https://raw.githubusercontent.com/simvia-tech/meshlane/main/logo/meshlane.svg" width="400" style="max-width: 100%;" /></p>
4
+
5
+ <p align="center">I/O for mesh files: convert smoothly between many formats.</p>
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/simvia-tech/meshlane/blob/main/LICENSE.txt)
8
+ [![PyPI version](https://img.shields.io/pypi/v/meshlane.svg?style=flat-square)](https://pypi.org/project/meshlane/)
9
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
10
+
11
+ > **meshlane** is an actively maintained descendant of
12
+ > [meshio](https://github.com/nschloe/meshio) by Nico Schlömer.
13
+ > It builds directly on meshio's codebase and history, and extends it with new
14
+ > format support and fixes geared toward FEA/CFD interoperability
15
+ > (code_aster, Ansys, OpenFOAM, Salome/MED). See [Relationship to meshio](#relationship-to-meshio).
16
+
17
+ There are many mesh formats for representing unstructured meshes. meshlane reads
18
+ and writes all of the following and converts smoothly between them:
19
+
20
+ > [Abaqus](http://abaqus.software.polimi.it/v6.14/index.html) (`.inp`),
21
+ > ANSYS msh (`.msh`),
22
+ > **Ansys/APDL input** (`.inp`, `.cdb`),
23
+ > [AVS-UCD](https://lanl.github.io/LaGriT/pages/docs/read_avs.html) (`.avs`),
24
+ > [CGNS](https://cgns.github.io/) (`.cgns`),
25
+ > [DOLFIN XML](https://manpages.ubuntu.com/manpages/jammy/en/man1/dolfin-convert.1.html) (`.xml`),
26
+ > [Exodus](https://nschloe.github.io/meshio/exodus.pdf) (`.e`, `.exo`),
27
+ > [FLAC3D](https://www.itascacg.com/software/flac3d) (`.f3grid`),
28
+ > [H5M](https://www.mcs.anl.gov/~fathom/moab-docs/h5mmain.html) (`.h5m`),
29
+ > [Kratos/MDPA](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data) (`.mdpa`),
30
+ > [Medit](https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html) (`.mesh`, `.meshb`),
31
+ > [MED/Salome](https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/med-file.html) (`.med`),
32
+ > [Nastran](https://help.autodesk.com/view/NSTRN/2019/ENU/?guid=GUID-42B54ACB-FBE3-47CA-B8FE-475E7AD91A00) (bulk data, `.bdf`, `.fem`, `.nas`),
33
+ > [Netgen](https://github.com/ngsolve/netgen) (`.vol`, `.vol.gz`),
34
+ > [Neuroglancer precomputed format](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed#mesh-representation-of-segmented-object-surfaces),
35
+ > [Gmsh](https://gmsh.info/doc/texinfo/gmsh.html#File-formats) (formats 2.2, 4.0, 4.1, `.msh`),
36
+ > [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) (`.obj`),
37
+ > [OFF](https://segeval.cs.princeton.edu/public/off_format.html) (`.off`),
38
+ > **OpenFOAM polyMesh** (.foam, read only),
39
+ > [PERMAS](https://www.intes.de) (`.post`, `.post.gz`, `.dato`, `.dato.gz`),
40
+ > [PLY](<https://en.wikipedia.org/wiki/PLY_(file_format)>) (`.ply`),
41
+ > [STL](<https://en.wikipedia.org/wiki/STL_(file_format)>) (`.stl`),
42
+ > [Tecplot .dat](http://paulbourke.net/dataformats/tp/),
43
+ > [TetGen .node/.ele](https://wias-berlin.de/software/tetgen/fformats.html),
44
+ > [SVG](https://www.w3.org/TR/SVG/) (2D output only) (`.svg`),
45
+ > [SU2](https://su2code.github.io/docs_v7/Mesh-File/) (`.su2`),
46
+ > [UGRID](https://www.simcenter.msstate.edu/software/documentation/ug_io/3d_grid_file_type_ugrid.html) (`.ugrid`),
47
+ > [VTK](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf) (`.vtk`),
48
+ > [VTU](https://vtk.org/Wiki/VTK_XML_Formats) (`.vtu`),
49
+ > [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) ([TIN](https://en.wikipedia.org/wiki/Triangulated_irregular_network)) (`.wkt`),
50
+ > [XDMF](https://xdmf.org/index.php/XDMF_Model_and_Format) (`.xdmf`, `.xmf`).
51
+
52
+ ## What meshlane adds over meshio
53
+
54
+ - **OpenFOAM polyMesh reader**: ASCII and binary, arbitrary cell types (tri / quad / polyhedra).
55
+ - **Ansys/APDL** `.inp` / `.cdb` reader & writer for FEA interoperability.
56
+ - **MED/Salome improvements:**
57
+ - multi-mesh files (several meshes in one `.med`)
58
+ - polygon cell support, including ragged/Voronoi meshes
59
+ - multi-timestep result fields, with `NDT`/`NOR`/`PDT` preserved
60
+ - round-trip of mesh metadata, field units and component names
61
+ - MED 4.1 bitmask metadata and HDF5 link-creation-order, so files stay
62
+ readable by Salome / medfile / mdump
63
+ - extended field data types (float32/64, int32/64)
64
+ - robust handling of missing `FAS` / `NOEUD` / `GRO` sections and merged cell blocks
65
+ - Encoding and parsing robustness fixes (Latin-1 metadata, group name parsing).
66
+
67
+ ## Installation
68
+
69
+ meshlane is available [on PyPI](https://pypi.org/project/meshlane/):
70
+
71
+ <!--pytest-codeblocks:skip-->
72
+
73
+ ```sh
74
+ pip install meshlane[all]
75
+ ```
76
+
77
+ (`[all]` pulls in the optional dependencies `netCDF4` and `h5py`, required for the
78
+ CGNS, H5M, MED and XDMF formats. By default only numpy is needed.)
79
+
80
+ To install from source instead:
81
+
82
+ <!--pytest-codeblocks:skip-->
83
+
84
+ ```sh
85
+ git clone https://github.com/simvia-tech/meshlane.git
86
+ cd meshlane
87
+ pip install -e .[all]
88
+ ```
89
+
90
+ ## Usage
91
+
92
+ Command line:
93
+
94
+ <!--pytest-codeblocks:skip-->
95
+
96
+ ```sh
97
+ meshlane convert input.msh output.vtk # convert between two formats
98
+ meshlane info input.xdmf # show some info about the mesh
99
+ meshlane compress input.vtu # compress the mesh file
100
+ meshlane decompress input.vtu # decompress the mesh file
101
+ meshlane binary input.msh # convert to binary format
102
+ meshlane ascii input.msh # convert to ASCII format
103
+ ```
104
+
105
+ In Python, read a mesh:
106
+
107
+ <!--pytest-codeblocks:skip-->
108
+
109
+ ```python
110
+ import meshlane
111
+
112
+ mesh = meshlane.read(
113
+ filename, # path, os.PathLike, or a buffer/open file
114
+ # file_format="stl", # optional; inferred from the extension
115
+ )
116
+ # mesh.points, mesh.cells, mesh.cells_dict, ...
117
+ ```
118
+
119
+ Write a mesh:
120
+
121
+ ```python
122
+ import meshlane
123
+
124
+ points = [
125
+ [0.0, 0.0], [1.0, 0.0], [0.0, 1.0],
126
+ [1.0, 1.0], [2.0, 0.0], [2.0, 1.0],
127
+ ]
128
+ cells = [
129
+ ("triangle", [[0, 1, 2], [1, 3, 2]]),
130
+ ("quad", [[1, 4, 5, 3]]),
131
+ ]
132
+
133
+ mesh = meshlane.Mesh(
134
+ points,
135
+ cells,
136
+ point_data={"T": [0.3, -1.2, 0.5, 0.7, 0.0, -3.0]},
137
+ cell_data={"a": [[0.1, 0.2], [0.4]]},
138
+ )
139
+ mesh.write("foo.vtk")
140
+
141
+ # Or, equivalently:
142
+ meshlane.write_points_cells("foo.vtk", points, cells)
143
+ ```
144
+
145
+ For both reading and writing you may pass `file_format=` explicitly (e.g. to force
146
+ ASCII over binary VTK).
147
+
148
+ ### Time series
149
+
150
+ The [XDMF format](https://xdmf.org/index.php/XDMF_Model_and_Format) supports time
151
+ series sharing one mesh:
152
+
153
+ <!--pytest-codeblocks:skip-->
154
+
155
+ ```python
156
+ with meshlane.xdmf.TimeSeriesWriter(filename) as writer:
157
+ writer.write_points_cells(points, cells)
158
+ for t in [0.0, 0.1, 0.21]:
159
+ writer.write_data(t, point_data={"phi": data})
160
+ ```
161
+
162
+ <!--pytest-codeblocks:skip-->
163
+
164
+ ```python
165
+ with meshlane.xdmf.TimeSeriesReader(filename) as reader:
166
+ points, cells = reader.read_points_cells()
167
+ for k in range(reader.num_steps):
168
+ t, point_data, cell_data = reader.read_data(k)
169
+ ```
170
+
171
+ ## Testing
172
+
173
+ <!--pytest-codeblocks:skip-->
174
+
175
+ ```sh
176
+ tox
177
+ ```
178
+
179
+ (Some test meshes are stored with Git LFS; run `git lfs pull` after cloning.)
180
+
181
+ ## Relationship to meshio
182
+
183
+ meshlane is a fork of [meshio](https://github.com/nschloe/meshio). We kept the full
184
+ git history and authorship so the original work remains properly attributed. We
185
+ started a separate project, rather than only contributing upstream, to move faster
186
+ on the FEA/CFD interoperability features we need (code_aster, Ansys, code_saturne, OpenFOAM,
187
+ Salome, etc.) and to maintain them under active development.
188
+
189
+ meshio is no longer actively maintained. [Simvia](https://simvia.tech) is a company
190
+ willing to commit time and people to keep this project alive and moving forward.
191
+
192
+ ## Contributing
193
+
194
+ Everyone is welcome, individuals and companies alike. If you want to help us keep
195
+ meshlane maintained, we would be glad to have you on board. We will do our best to
196
+ triage issues quickly and to give timely, constructive feedback on pull requests.
197
+
198
+ Huge thanks to Nico Schlömer and all meshio contributors for the foundation this
199
+ project is built on.
200
+
201
+ ## License
202
+
203
+ meshlane is published under the [MIT license](https://github.com/simvia-tech/meshlane/blob/main/LICENSE.txt), the same as meshio.
204
+ Copyright is retained by the original meshio authors and the meshlane contributors.
@@ -0,0 +1,69 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "meshlane"
7
+ version = "5.4.0"
8
+ description = "I/O for many mesh formats"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {file = "LICENSE.txt"}
12
+ keywords = [
13
+ "mesh",
14
+ "file formats",
15
+ "scientific",
16
+ "engineering",
17
+ "fem",
18
+ "finite elements"
19
+ ]
20
+ authors = [
21
+ {name = "Mariam Kesba", email = "mariam.kesba@simvia.tech"},
22
+ {name = "Fatima-Zahra Noussi", email = "fatima-zahra.noussi@simvia.tech"},
23
+ {name = "Lucas Sovre", email = "lucas.sovre@simvia.tech"},
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 5 - Production/Stable",
27
+ "Programming Language :: Python",
28
+ "Intended Audience :: Science/Research",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Programming Language :: Python",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.8",
34
+ "Programming Language :: Python :: 3.9",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Topic :: Scientific/Engineering",
39
+ "Topic :: Utilities",
40
+ ]
41
+ dependencies = [
42
+ "importlib_metadata; python_version<'3.8'",
43
+ "numpy>=1.20.0,<2",
44
+ "rich",
45
+ ]
46
+
47
+ [project.optional-dependencies]
48
+ all = [
49
+ "netCDF4",
50
+ "h5py" # CGNS, H5M, MED, XDMF formats
51
+ ]
52
+
53
+ [project.urls]
54
+ homepage = "https://github.com/simvia-tech/meshlane"
55
+ code = "https://github.com/simvia-tech/meshlane"
56
+ issues = "https://github.com/simvia-tech/meshlane/issues"
57
+
58
+ [project.entry-points.console_scripts]
59
+ meshlane = "meshlane._cli:main"
60
+
61
+ [tool.setuptools.packages.find]
62
+ where = ["src"]
63
+
64
+ [tool.isort]
65
+ profile = "black"
66
+
67
+ # [options.data_files]
68
+ # share/paraview-5.9/plugins =
69
+ # tools/paraview-meshlane-plugin.py
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,13 @@
1
+ try:
2
+ # Python 3.8+
3
+ from importlib import metadata
4
+ except ImportError:
5
+ try:
6
+ import importlib_metadata as metadata
7
+ except ImportError:
8
+ __version__ = "unknown"
9
+
10
+ try:
11
+ __version__ = metadata.version("meshlane")
12
+ except Exception:
13
+ __version__ = "unknown"