PyHOPE 0.1.1__tar.gz → 0.9.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.
- {pyhope-0.1.1 → pyhope-0.9.0}/PKG-INFO +50 -15
- {pyhope-0.1.1 → pyhope-0.9.0}/README.md +46 -14
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/__init__.py +6 -6
- pyhope-0.9.0/pyhope/basis/basis_basis.py +707 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/basis/basis_connect.py +62 -19
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/basis/basis_jacobian.py +92 -35
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/basis/basis_watertight.py +124 -42
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/check/check_health.py +22 -20
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/check/check_install.py +4 -4
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/common.py +11 -7
- pyhope-0.9.0/pyhope/common/common_numba.py +90 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/common_parallel.py +40 -25
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/common_progress.py +35 -8
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/common_tools.py +11 -0
- pyhope-0.9.0/pyhope/common/common_unique.py +83 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/common_vars.py +2 -2
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/formats/meshio.py +97 -71
- pyhope-0.9.0/pyhope/io/formats/vtk.py +152 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/io.py +87 -68
- pyhope-0.9.0/pyhope/io/io_debug.py +345 -0
- pyhope-0.9.0/pyhope/io/io_gmsh.py +70 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/io_vars.py +15 -14
- pyhope-0.9.0/pyhope/io/io_xdmf.py +249 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/connect/connect.py +34 -20
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/connect/connect_mortar.py +9 -3
- pyhope-0.9.0/pyhope/mesh/fem/fem.py +450 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh.py +16 -8
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_builtin.py +59 -24
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_common.py +73 -11
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_duplicates.py +117 -31
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_external.py +14 -5
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_orient.py +58 -30
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_sides.py +15 -11
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_sort.py +201 -86
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/mesh_vars.py +31 -9
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/reader/reader_gmsh.py +113 -118
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/reader/reader_hopr.py +1 -1
- pyhope-0.9.0/pyhope/mesh/sort/sort_hilbert.py +170 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/topology/mesh_topology.py +28 -7
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/mesh_transform.py +29 -9
- pyhope-0.9.0/pyhope/mesh/transform/templates/sphere_box.py +135 -0
- pyhope-0.9.0/pyhope/meshio/meshio_convert.py +306 -0
- pyhope-0.9.0/pyhope/meshio/meshio_nodes.py +134 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/meshio/meshio_ordering.py +167 -42
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/readintools/readintools.py +68 -42
- {pyhope-0.1.1 → pyhope-0.9.0}/pyproject.toml +30 -6
- pyhope-0.1.1/pyhope/basis/basis_basis.py +0 -241
- pyhope-0.1.1/pyhope/io/formats/vtk.py +0 -267
- pyhope-0.1.1/pyhope/io/io_xdmf.py +0 -190
- pyhope-0.1.1/pyhope/mesh/fem/fem.py +0 -324
- pyhope-0.1.1/pyhope/meshio/meshio_convert.py +0 -104
- {pyhope-0.1.1 → pyhope-0.9.0}/AUTHORS.md +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/LICENSE.md +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/__main__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/basis/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/check/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/check/check.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/common/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/config/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/config/config.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/gmsh/gmsh_install.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/gmsh/gmsh_override.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/formats/cgns.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/io/formats/gmsh.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/connect/connect_rbtree.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/elements/elements_ordering.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/elements/elements_shapefunctions.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/reader/reader_gambit.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/topology/mesh_serendipity.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/topology/mesh_splittohex.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/templates/convtest.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/templates/cylinder.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/templates/default.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/templates/phill.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/mesh/transform/templates/sphere.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/output/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/output/output.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/readintools/__init__.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/readintools/commandline.py +0 -0
- {pyhope-0.1.1 → pyhope-0.9.0}/pyhope/script/pyhope_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyHOPE
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Python High-Order Preprocessing Environment
|
|
5
5
|
License: GPL-3.0-only
|
|
6
6
|
License-File: AUTHORS.md
|
|
@@ -17,11 +17,14 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Provides-Extra: numba
|
|
20
22
|
Requires-Dist: alive-progress
|
|
21
23
|
Requires-Dist: gmsh
|
|
22
24
|
Requires-Dist: h5py
|
|
23
25
|
Requires-Dist: hilbertcurve
|
|
24
26
|
Requires-Dist: meshio
|
|
27
|
+
Requires-Dist: numba ; extra == "numba"
|
|
25
28
|
Requires-Dist: numpy (>=2.0.0)
|
|
26
29
|
Requires-Dist: packaging
|
|
27
30
|
Requires-Dist: plotext
|
|
@@ -36,9 +39,7 @@ PyHOPE (Python High-Order Preprocessing Environment) is an open-source Python fr
|
|
|
36
39
|
|
|
37
40
|
PyHOPE has been developed by the Numerics Research Group (NRG) lead by Prof. Andrea Beck at the Institute of Aerodynamics and Gas Dynamics at the University of Stuttgart, Germany.
|
|
38
41
|
|
|
39
|
-
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format.
|
|
40
|
-
|
|
41
|
-
This is a scientific project. If you use PyHOPE for publications or presentations in science, please support the project by citing our publications given at [numericsresearchgroup.org](https://numericsresearchgroup.org/publications.html).
|
|
42
|
+
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. Furthermore, PyHOPE utilizes [Gmsh](https://gmsh.info) for the initial mesh generation and conversion before converting it to its internal representation. The internal representation is loosely based on [meshio](https://github.com/nschloe/meshio) but augmented with additional information required for high-order meshes.
|
|
42
43
|
|
|
43
44
|
# Installation
|
|
44
45
|
PyHOPE is built using standard Python packages. You can install PyHOPE by following these steps.
|
|
@@ -60,6 +61,12 @@ PyHOPE is built using standard Python packages. You can install PyHOPE by follow
|
|
|
60
61
|
python -m pip install pyhope
|
|
61
62
|
```
|
|
62
63
|
|
|
64
|
+
> [!NOTE]
|
|
65
|
+
> PyHOPE can optionally use [Numba](https://numba.pydata.org) to accelerate some compute-heavy routines. If Numba is not available in your environment, PyHOPE will fall back to pure NumPy implementations.
|
|
66
|
+
> ```bash
|
|
67
|
+
> python -m pip install pyhope[numba]
|
|
68
|
+
> ```
|
|
69
|
+
|
|
63
70
|
# Testing
|
|
64
71
|
PyHOPE features internal health checks to verify that everything works as expected. The checks can be invoked directly from the terminal.
|
|
65
72
|
```bash
|
|
@@ -71,14 +78,17 @@ pyhope --verify-install [tutorials] # Run PyHOPE mesh generation checks
|
|
|
71
78
|
> [!NOTE]
|
|
72
79
|
> By default, PyHOPE looks for the `tutorials` directory relative to the current working directory or the git root. If neither exists, PyHOPE downloads the tests from GitHub while using available authentication methods.
|
|
73
80
|
|
|
81
|
+
> [!IMPORTANT]
|
|
82
|
+
> Be aware that the PyHOPE repository uses [Git Large File Storage (LFS)](https://git-lfs.com) for some of its larger mesh files.
|
|
83
|
+
|
|
74
84
|
# Getting Help
|
|
75
|
-
PyHOPE help output is formatted to serve as self-hosting INI format. A list of all options and the default values can be accessed by running the following command.
|
|
85
|
+
PyHOPE help output is formatted to serve as self-hosting [INI format](https://hopr-framework.github.io/PyHOPE/user-guide/parameter-file). A list of all options and the default values can be accessed by running the following command.
|
|
76
86
|
```bash
|
|
77
87
|
pyhope --help
|
|
78
88
|
```
|
|
79
89
|
|
|
80
90
|
# Documentation
|
|
81
|
-
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. For
|
|
91
|
+
Refer to the [PyHOPE documentation](https://hopr-framework.github.io/PyHOPE) for the getting started guide, examples, and usage instructions. PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. For technical details and the reference mesh format specification, see the [HOPR documentation](https://hopr.readthedocs.io).
|
|
82
92
|
|
|
83
93
|
# Usage
|
|
84
94
|
PyHOPE can either be invoked directly from the command line or used as a Python library.
|
|
@@ -96,11 +106,12 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
96
106
|
┃ PyHOPE version x.x.x
|
|
97
107
|
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
98
108
|
│ INIT PROGRAM...
|
|
99
|
-
│ nThreads │
|
|
109
|
+
│ nThreads │ nProcs-2 │ DEFAULT │
|
|
100
110
|
├─────────────────────────────────────────────
|
|
101
111
|
│ INIT OUTPUT...
|
|
102
112
|
│ ProjectName │ 1-01-cartbox │ *CUSTOM │
|
|
103
113
|
│ OutputFormat │ 0 [HDF5] │ *CUSTOM │
|
|
114
|
+
│ DebugMesh │ T │ *CUSTOM │
|
|
104
115
|
│ DebugVisu │ F │ *CUSTOM │
|
|
105
116
|
├─────────────────────────────────────────────
|
|
106
117
|
│ INIT MESH...
|
|
@@ -111,7 +122,7 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
111
122
|
├────
|
|
112
123
|
│ nZones │ 1 │ *CUSTOM │
|
|
113
124
|
├── Generating zone 1
|
|
114
|
-
│ Corner │ (/0.,0.,0
|
|
125
|
+
│ Corner │ (/0.,0.,0.,,1.,0.,0.,,1.,1.,... │ *CUSTOM │
|
|
115
126
|
│ nElems │ (/8,8,8/) │ *CUSTOM │
|
|
116
127
|
│ ElemType │ 108 [hexahedron] │ *CUSTOM │
|
|
117
128
|
│ StretchType │ (/0,0,0/) │ DEFAULT │
|
|
@@ -132,9 +143,9 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
132
143
|
│ BoundaryName │ BC_zplus │ *CUSTOM │
|
|
133
144
|
│ BoundaryType │ (/9,0,0,0/) │ *CUSTOM │
|
|
134
145
|
├────
|
|
135
|
-
│ vv │ (/1.,
|
|
136
|
-
│ vv │ (/0.,
|
|
137
|
-
│ vv │ (/0.,
|
|
146
|
+
│ vv │ (/1.,0.,0./) │ *CUSTOM │
|
|
147
|
+
│ vv │ (/0.,1.,0./) │ *CUSTOM │
|
|
148
|
+
│ vv │ (/0.,0.,1./) │ *CUSTOM │
|
|
138
149
|
├────
|
|
139
150
|
├── Generated mesh with 512 cells
|
|
140
151
|
├─────────────────────────────────────────────
|
|
@@ -150,7 +161,7 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
150
161
|
├─────────────────────────────────────────────
|
|
151
162
|
│ SORT MESH...
|
|
152
163
|
├────
|
|
153
|
-
│
|
|
164
|
+
│ MeshSorting │ 1 [SFC] │ DEFAULT │
|
|
154
165
|
├────
|
|
155
166
|
├── Sorting elements along space-filling curve
|
|
156
167
|
├─────────────────────────────────────────────
|
|
@@ -201,13 +212,14 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
201
212
|
│ Curved Hexahedra : 512
|
|
202
213
|
├────
|
|
203
214
|
├── Writing HDF5 mesh to "1-01-cartbox_mesh.h5"
|
|
215
|
+
├── Writing XDMF mesh to "1-01-cartbox_DebugMesh.xdmf"
|
|
204
216
|
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
205
217
|
┃ PyHOPE completed in [0.25 sec]
|
|
206
218
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
219
|
```
|
|
208
220
|
|
|
209
221
|
## Python Library Usage
|
|
210
|
-
PyHOPE can be included in other Python libraries. PyHOPE exposes its functionally via runtime contexts defined by [Context Managers](https://docs.python.org/3/library/stdtypes.html#typecontextmanager). The following Python code loads a HOPR HDF5 mesh and derived quantities. For a complete list of currently implemented functions, see the [source code](pyhope/__init__.py).
|
|
222
|
+
PyHOPE can be included in other Python libraries. PyHOPE exposes its functionally via runtime contexts defined by [Context Managers](https://docs.python.org/3/library/stdtypes.html#typecontextmanager). The following Python code loads a HOPR HDF5 mesh and derived quantities. For a complete list of currently implemented functions, see the [source code](https://github.com/hopr-framework/PyHOPE/blob/main/pyhope/__init__.py).
|
|
211
223
|
```python
|
|
212
224
|
from pyhope import Basis, Mesh
|
|
213
225
|
with Mesh('1-01-cartbox_mesh.h5') as m:
|
|
@@ -215,6 +227,29 @@ with Mesh('1-01-cartbox_mesh.h5') as m:
|
|
|
215
227
|
lobatto_nodes = Basis.legendre_gauss_lobatto_nodes(order=m.nGeo)
|
|
216
228
|
```
|
|
217
229
|
|
|
218
|
-
#
|
|
219
|
-
|
|
230
|
+
# Cite
|
|
231
|
+
This is a scientific project. If you use PyHOPE for publications or presentations in science, please support the project by citing the following article.
|
|
232
|
+
```bibtex
|
|
233
|
+
@article{kopper2025pyhope:joss,
|
|
234
|
+
title = {{PyHOPE}: A Python Toolkit for Three-Dimensional Unstructured High-Order Meshes},
|
|
235
|
+
author = {Kopper, Patrick and Blind, Marcel P. and Schwarz, Anna and Kurz, Marius and Rodach, Felix and Copplestone, Stephen M. and Beck, Andrea D.},
|
|
236
|
+
journal = {Journal of Open Source Software},
|
|
237
|
+
year = {2025},
|
|
238
|
+
volume = {10},
|
|
239
|
+
number = {115},
|
|
240
|
+
pages = {8769},
|
|
241
|
+
publisher = {The Open Journal},
|
|
242
|
+
doi = {10.21105/joss.08769}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
In addition, you can also directly refer to this repository as
|
|
246
|
+
```bibtex
|
|
247
|
+
@misc{kopper2025pyhope:repo,
|
|
248
|
+
title = {{PyHOPE}: A Python Toolkit for Three-Dimensional Unstructured High-Order Meshes},
|
|
249
|
+
author = {Kopper, Patrick and Blind, Marcel P. and Schwarz, Anna and Kurz, Marius and Rodach, Felix and Copplestone, Stephen M. and Beck, Andrea D.},
|
|
250
|
+
year = {2025},
|
|
251
|
+
howpublished = {\url{https://github.com/hopr-framework/PyHOPE}},
|
|
252
|
+
doi = {10.5281/zenodo.17414843}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
220
255
|
|
|
@@ -2,9 +2,7 @@ PyHOPE (Python High-Order Preprocessing Environment) is an open-source Python fr
|
|
|
2
2
|
|
|
3
3
|
PyHOPE has been developed by the Numerics Research Group (NRG) lead by Prof. Andrea Beck at the Institute of Aerodynamics and Gas Dynamics at the University of Stuttgart, Germany.
|
|
4
4
|
|
|
5
|
-
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format.
|
|
6
|
-
|
|
7
|
-
This is a scientific project. If you use PyHOPE for publications or presentations in science, please support the project by citing our publications given at [numericsresearchgroup.org](https://numericsresearchgroup.org/publications.html).
|
|
5
|
+
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. Furthermore, PyHOPE utilizes [Gmsh](https://gmsh.info) for the initial mesh generation and conversion before converting it to its internal representation. The internal representation is loosely based on [meshio](https://github.com/nschloe/meshio) but augmented with additional information required for high-order meshes.
|
|
8
6
|
|
|
9
7
|
# Installation
|
|
10
8
|
PyHOPE is built using standard Python packages. You can install PyHOPE by following these steps.
|
|
@@ -26,6 +24,12 @@ PyHOPE is built using standard Python packages. You can install PyHOPE by follow
|
|
|
26
24
|
python -m pip install pyhope
|
|
27
25
|
```
|
|
28
26
|
|
|
27
|
+
> [!NOTE]
|
|
28
|
+
> PyHOPE can optionally use [Numba](https://numba.pydata.org) to accelerate some compute-heavy routines. If Numba is not available in your environment, PyHOPE will fall back to pure NumPy implementations.
|
|
29
|
+
> ```bash
|
|
30
|
+
> python -m pip install pyhope[numba]
|
|
31
|
+
> ```
|
|
32
|
+
|
|
29
33
|
# Testing
|
|
30
34
|
PyHOPE features internal health checks to verify that everything works as expected. The checks can be invoked directly from the terminal.
|
|
31
35
|
```bash
|
|
@@ -37,14 +41,17 @@ pyhope --verify-install [tutorials] # Run PyHOPE mesh generation checks
|
|
|
37
41
|
> [!NOTE]
|
|
38
42
|
> By default, PyHOPE looks for the `tutorials` directory relative to the current working directory or the git root. If neither exists, PyHOPE downloads the tests from GitHub while using available authentication methods.
|
|
39
43
|
|
|
44
|
+
> [!IMPORTANT]
|
|
45
|
+
> Be aware that the PyHOPE repository uses [Git Large File Storage (LFS)](https://git-lfs.com) for some of its larger mesh files.
|
|
46
|
+
|
|
40
47
|
# Getting Help
|
|
41
|
-
PyHOPE help output is formatted to serve as self-hosting INI format. A list of all options and the default values can be accessed by running the following command.
|
|
48
|
+
PyHOPE help output is formatted to serve as self-hosting [INI format](https://hopr-framework.github.io/PyHOPE/user-guide/parameter-file). A list of all options and the default values can be accessed by running the following command.
|
|
42
49
|
```bash
|
|
43
50
|
pyhope --help
|
|
44
51
|
```
|
|
45
52
|
|
|
46
53
|
# Documentation
|
|
47
|
-
PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. For
|
|
54
|
+
Refer to the [PyHOPE documentation](https://hopr-framework.github.io/PyHOPE) for the getting started guide, examples, and usage instructions. PyHOPE is heavily inspired by [HOPR (High Order Preprocessor)](https://github.com/hopr-framework/hopr) and shares the same input/output format. For technical details and the reference mesh format specification, see the [HOPR documentation](https://hopr.readthedocs.io).
|
|
48
55
|
|
|
49
56
|
# Usage
|
|
50
57
|
PyHOPE can either be invoked directly from the command line or used as a Python library.
|
|
@@ -62,11 +69,12 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
62
69
|
┃ PyHOPE version x.x.x
|
|
63
70
|
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
64
71
|
│ INIT PROGRAM...
|
|
65
|
-
│ nThreads │
|
|
72
|
+
│ nThreads │ nProcs-2 │ DEFAULT │
|
|
66
73
|
├─────────────────────────────────────────────
|
|
67
74
|
│ INIT OUTPUT...
|
|
68
75
|
│ ProjectName │ 1-01-cartbox │ *CUSTOM │
|
|
69
76
|
│ OutputFormat │ 0 [HDF5] │ *CUSTOM │
|
|
77
|
+
│ DebugMesh │ T │ *CUSTOM │
|
|
70
78
|
│ DebugVisu │ F │ *CUSTOM │
|
|
71
79
|
├─────────────────────────────────────────────
|
|
72
80
|
│ INIT MESH...
|
|
@@ -77,7 +85,7 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
77
85
|
├────
|
|
78
86
|
│ nZones │ 1 │ *CUSTOM │
|
|
79
87
|
├── Generating zone 1
|
|
80
|
-
│ Corner │ (/0.,0.,0
|
|
88
|
+
│ Corner │ (/0.,0.,0.,,1.,0.,0.,,1.,1.,... │ *CUSTOM │
|
|
81
89
|
│ nElems │ (/8,8,8/) │ *CUSTOM │
|
|
82
90
|
│ ElemType │ 108 [hexahedron] │ *CUSTOM │
|
|
83
91
|
│ StretchType │ (/0,0,0/) │ DEFAULT │
|
|
@@ -98,9 +106,9 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
98
106
|
│ BoundaryName │ BC_zplus │ *CUSTOM │
|
|
99
107
|
│ BoundaryType │ (/9,0,0,0/) │ *CUSTOM │
|
|
100
108
|
├────
|
|
101
|
-
│ vv │ (/1.,
|
|
102
|
-
│ vv │ (/0.,
|
|
103
|
-
│ vv │ (/0.,
|
|
109
|
+
│ vv │ (/1.,0.,0./) │ *CUSTOM │
|
|
110
|
+
│ vv │ (/0.,1.,0./) │ *CUSTOM │
|
|
111
|
+
│ vv │ (/0.,0.,1./) │ *CUSTOM │
|
|
104
112
|
├────
|
|
105
113
|
├── Generated mesh with 512 cells
|
|
106
114
|
├─────────────────────────────────────────────
|
|
@@ -116,7 +124,7 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
116
124
|
├─────────────────────────────────────────────
|
|
117
125
|
│ SORT MESH...
|
|
118
126
|
├────
|
|
119
|
-
│
|
|
127
|
+
│ MeshSorting │ 1 [SFC] │ DEFAULT │
|
|
120
128
|
├────
|
|
121
129
|
├── Sorting elements along space-filling curve
|
|
122
130
|
├─────────────────────────────────────────────
|
|
@@ -167,13 +175,14 @@ $ pyhope tutorials/1-01-cartbox/parameter.ini
|
|
|
167
175
|
│ Curved Hexahedra : 512
|
|
168
176
|
├────
|
|
169
177
|
├── Writing HDF5 mesh to "1-01-cartbox_mesh.h5"
|
|
178
|
+
├── Writing XDMF mesh to "1-01-cartbox_DebugMesh.xdmf"
|
|
170
179
|
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
171
180
|
┃ PyHOPE completed in [0.25 sec]
|
|
172
181
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
173
182
|
```
|
|
174
183
|
|
|
175
184
|
## Python Library Usage
|
|
176
|
-
PyHOPE can be included in other Python libraries. PyHOPE exposes its functionally via runtime contexts defined by [Context Managers](https://docs.python.org/3/library/stdtypes.html#typecontextmanager). The following Python code loads a HOPR HDF5 mesh and derived quantities. For a complete list of currently implemented functions, see the [source code](pyhope/__init__.py).
|
|
185
|
+
PyHOPE can be included in other Python libraries. PyHOPE exposes its functionally via runtime contexts defined by [Context Managers](https://docs.python.org/3/library/stdtypes.html#typecontextmanager). The following Python code loads a HOPR HDF5 mesh and derived quantities. For a complete list of currently implemented functions, see the [source code](https://github.com/hopr-framework/PyHOPE/blob/main/pyhope/__init__.py).
|
|
177
186
|
```python
|
|
178
187
|
from pyhope import Basis, Mesh
|
|
179
188
|
with Mesh('1-01-cartbox_mesh.h5') as m:
|
|
@@ -181,5 +190,28 @@ with Mesh('1-01-cartbox_mesh.h5') as m:
|
|
|
181
190
|
lobatto_nodes = Basis.legendre_gauss_lobatto_nodes(order=m.nGeo)
|
|
182
191
|
```
|
|
183
192
|
|
|
184
|
-
#
|
|
185
|
-
|
|
193
|
+
# Cite
|
|
194
|
+
This is a scientific project. If you use PyHOPE for publications or presentations in science, please support the project by citing the following article.
|
|
195
|
+
```bibtex
|
|
196
|
+
@article{kopper2025pyhope:joss,
|
|
197
|
+
title = {{PyHOPE}: A Python Toolkit for Three-Dimensional Unstructured High-Order Meshes},
|
|
198
|
+
author = {Kopper, Patrick and Blind, Marcel P. and Schwarz, Anna and Kurz, Marius and Rodach, Felix and Copplestone, Stephen M. and Beck, Andrea D.},
|
|
199
|
+
journal = {Journal of Open Source Software},
|
|
200
|
+
year = {2025},
|
|
201
|
+
volume = {10},
|
|
202
|
+
number = {115},
|
|
203
|
+
pages = {8769},
|
|
204
|
+
publisher = {The Open Journal},
|
|
205
|
+
doi = {10.21105/joss.08769}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
In addition, you can also directly refer to this repository as
|
|
209
|
+
```bibtex
|
|
210
|
+
@misc{kopper2025pyhope:repo,
|
|
211
|
+
title = {{PyHOPE}: A Python Toolkit for Three-Dimensional Unstructured High-Order Meshes},
|
|
212
|
+
author = {Kopper, Patrick and Blind, Marcel P. and Schwarz, Anna and Kurz, Marius and Rodach, Felix and Copplestone, Stephen M. and Beck, Andrea D.},
|
|
213
|
+
year = {2025},
|
|
214
|
+
howpublished = {\url{https://github.com/hopr-framework/PyHOPE}},
|
|
215
|
+
doi = {10.5281/zenodo.17414843}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
@@ -67,7 +67,7 @@ MeshContainer = namedtuple('Mesh',
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
@contextmanager # pragma: no cover
|
|
70
|
-
def Mesh(*args, stdout=False, stderr=True):
|
|
70
|
+
def Mesh(*args: str, stdout: bool = False, stderr: bool = True):
|
|
71
71
|
""" Mesh context manager to generate a mesh from a given file
|
|
72
72
|
|
|
73
73
|
Args:
|
|
@@ -156,8 +156,8 @@ def Mesh(*args, stdout=False, stderr=True):
|
|
|
156
156
|
|
|
157
157
|
finally:
|
|
158
158
|
# Cleanup resources after exiting the context
|
|
159
|
-
mesh_vars.mesh
|
|
160
|
-
mesh_vars.nGeo
|
|
161
|
-
mesh_vars.bcs
|
|
162
|
-
mesh_vars.elems
|
|
163
|
-
mesh_vars.sides
|
|
159
|
+
del mesh_vars.mesh
|
|
160
|
+
del mesh_vars.nGeo
|
|
161
|
+
del mesh_vars.bcs
|
|
162
|
+
del mesh_vars.elems
|
|
163
|
+
del mesh_vars.sides
|