Skip to main content

Python High-Order Preprocessing Environment

Project description

PyHOPE (Python High-Order Preprocessing Environment) is an open-source Python framework for the generation of three-dimensional unstructured high-order meshes. These meshes are needed by high-order numerical methods like Discontinuous Galerkin, Spectral Element Methods, or pFEM, in order to retain their accuracy if the computational domain includes curved boundaries.

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.

PyHOPE is heavily inspired by HOPR (High Order Preprocessor) and shares the same input/output format. For more information and tutorials, please visit the HOPR documentation. Furthermore, PyHOPE utilizes Gmsh for the initial mesh generation and conversion before converting it to its internal representation.

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.

Installation

PyHOPE is built using standard Python packages. You can install PyHOPE by following these steps.

  1. Optional: Create and activate a virtual environment
    Creating a virtual environment is a recommended practice to manage project dependencies. It isolates the packages required for PyHOPE and prevents potential conflicts between different package versions. To create and activate a virtual environment named venv, use the following commands.

    python -m venv venv
    source venv/bin/activate
    

    If you choose not to use a virtual environment, skip this step and proceed directly to the installation of PyHOPE.

  2. Install PyHOPE
    PyHOPE is installed using pip, the Python package installer. This command fetches the PyHOPE package and its dependencies from PyPI (Python Package Index) and installs them.

    python -m pip install pyhope
    
  3. Run PyHOPE PyHOPE is available as a command-line tool. After installation, its functionalities can be accessed directly from the terminal.

    pyhope --help
    

    ๐Ÿ›ˆ Remark: For new shell sessions, the virtual environment must be re-sourced using source venv/bin/activate before using pyhope commands.

Usage

PyHOPE is invoked from the command line. Run parameters are read from a configuration file. The following output is obtained when running the example configuration file tutorials/1-01-cartbox/parameter.ini.

$ pyhope tutorials/1-01-cartbox/parameter.ini
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ P y H O P E โ€” Python High-Order Preprocessing Environment
โ”ƒ PyHOPE version x.x.x
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”‚ INIT PROGRAM...
โ”‚                        nThreads โ”‚ 10                              โ”‚ DEFAULT โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ INIT OUTPUT...
โ”‚                     ProjectName โ”‚ 1-01-cartbox                    โ”‚ *CUSTOM โ”‚
โ”‚                    OutputFormat โ”‚ 0 [HDF5]                        โ”‚ *CUSTOM โ”‚
โ”‚                       DebugVisu โ”‚ F                               โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ INIT MESH...
โ”‚                            Mode โ”‚ 1 [Internal]                    โ”‚ *CUSTOM โ”‚
โ”‚                            NGeo โ”‚ 9                               โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ GENERATE MESH...
โ”œโ”€โ”€โ”€โ”€
โ”‚                          nZones โ”‚ 1                               โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€ Generating zone 1
โ”‚                          Corner โ”‚ (/0.,0.,0. ,,1.,0.,0. ,,1.,1... โ”‚ *CUSTOM โ”‚
โ”‚                          nElems โ”‚ (/8,8,8/)                       โ”‚ *CUSTOM โ”‚
โ”‚                        ElemType โ”‚ 108 [hexahedron]                โ”‚ *CUSTOM โ”‚
โ”‚                     StretchType โ”‚ (/0,0,0/)                       โ”‚ DEFAULT โ”‚
โ”‚                         BCIndex โ”‚ (/1,2,3,4,5,6/)                 โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Setting boundary conditions
โ”œโ”€โ”€โ”€โ”€
โ”‚                    BoundaryName โ”‚ BC_zminus                       โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/4,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryName โ”‚ BC_yminus                       โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/2,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryName โ”‚ BC_xplus                        โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/2,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryName โ”‚ BC_yplus                        โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/2,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryName โ”‚ BC_xminus                       โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/2,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryName โ”‚ BC_zplus                        โ”‚ *CUSTOM โ”‚
โ”‚                    BoundaryType โ”‚ (/9,0,0,0/)                     โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€โ”€โ”€
โ”‚                              vv โ”‚ (/1., 0., 0./)                  โ”‚ *CUSTOM โ”‚
โ”‚                              vv โ”‚ (/0., 1., 0./)                  โ”‚ *CUSTOM โ”‚
โ”‚                              vv โ”‚ (/0., 0., 1./)                  โ”‚ *CUSTOM โ”‚
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Generated mesh with 512 cells
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”œโ”€โ”€ BUILD DATA STRUCTURE...
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Removing duplicate points
โ”œโ”€โ”€ Ensuring normals point outward
โ”œโ”€โ”€โ”€โ”€
โ”‚             CheckSurfaceNormals โ”‚ True                            โ”‚ DEFAULT โ”‚
โ”‚             Processing Elements |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 512/512 [100%] in 0.0s (24000.00/s)
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Generating sides
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ SORT MESH...
โ”œโ”€โ”€โ”€โ”€
โ”‚                       doSortIJK โ”‚ False                           โ”‚ DEFAULT โ”‚
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Sorting elements along space-filling curve
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ CONNECT MESH...
โ”œโ”€โ”€โ”€โ”€
โ”‚               doPeriodicCorrect โ”‚ False                           โ”‚ DEFAULT โ”‚
โ”‚                       doMortars โ”‚ True                            โ”‚ DEFAULT โ”‚
โ”œโ”€โ”€โ”€โ”€
โ”‚  Number of sides                :         3072
โ”‚  Number of inner sides          :         2688
โ”‚  Number of mortar sides (big)   :            0
โ”‚  Number of mortar sides (small) :            0
โ”‚  Number of boundary sides       :          384
โ”‚  Number of periodic sides       :            0
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ CHECK CONNECTIVITY...
โ”œโ”€โ”€โ”€โ”€
โ”‚               CheckConnectivity โ”‚ True                            โ”‚ DEFAULT โ”‚
โ”‚             Processing Elements |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 512/512 [100%] in 0.0s (24000.00/s)
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ CHECK WATERTIGHTNESS...
โ”œโ”€โ”€โ”€โ”€
โ”‚             CheckWatertightness โ”‚ True                            โ”‚ DEFAULT โ”‚
โ”‚             Processing Elements |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 512/512 [100%] in 0.0s (24000.00/s)
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ CHECK JACOBIANS...
โ”œโ”€โ”€โ”€โ”€
โ”‚              CheckElemJacobians โ”‚ True                            โ”‚ DEFAULT โ”‚
โ”‚             Processing Elements |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 512/512 [100%] in 0.0s (24000.00/s)
โ”œโ”€โ”€โ”€โ”€
โ”‚ Scaled Jacobians
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚<0.0      โ”‚  0.00
โ”‚ 0.0-0.1  โ”‚  0.00
โ”‚ 0.1-0.2  โ”‚  0.00
โ”‚ 0.2-0.3  โ”‚  0.00
โ”‚ 0.3-0.4  โ”‚  0.00
โ”‚ 0.4-0.5  โ”‚  0.00
โ”‚ 0.5-0.6  โ”‚  0.00
โ”‚ 0.6-0.7  โ”‚  0.00
โ”‚ 0.7-0.8  โ”‚  0.00
โ”‚ 0.8-0.9  โ”‚  0.00
โ”‚>0.9-1.0  โ”‚ โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡ 512.00
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚ OUTPUT MESH...
โ”œโ”€โ”€โ”€โ”€
โ”‚         Curved Hexahedra  :          512
โ”œโ”€โ”€โ”€โ”€
โ”œโ”€โ”€ Writing HDF5 mesh to "1-01-cartbox_mesh.h5"
โ”ขโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
โ”ƒ PyHOPE completed in [0.25 sec]
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhope-0.1.0.tar.gz (126.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyhope-0.1.0-py3-none-any.whl (180.0 kB view details)

Uploaded Python 3

File details

Details for the file pyhope-0.1.0.tar.gz.

File metadata

  • Download URL: pyhope-0.1.0.tar.gz
  • Upload date:
  • Size: 126.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyhope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac05b6ac7ecf223100e840c2a00234b19ff583ad7a36db1757f413c29e5de1ee
MD5 21380871d99a1e882351748f1fb9209c
BLAKE2b-256 f69a6a6a31f3efb4ac7ec39622c18c9a1fa81d326d524cf53d6e7fb829429185

See more details on using hashes here.

File details

Details for the file pyhope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyhope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 180.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyhope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cdf0e1d2c0052a7df254b5f60dca9b02cba0eddf753785ca4cc905f4312318b
MD5 29a7843927ffaa41aaf1a177732b8b55
BLAKE2b-256 5378a21a7f4c951d16fae3627a6e4a8c1d779bd63386f4e34db1cf23772f723e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page