ensight-reader
This library provides a pure Python reader (with some writing capability) for the EnSight Gold data format,
a common format for results of computational fluid dynamics (CFD) simulations.
It also comes with a few CLI tools, notably ensight_transform which
allows you to perform in-place scaling/translation/etc. of the geometry in your case.
The library designed for efficient, selective, memory-mapped access to data from EnSight Gold case –
something that would be useful when importing the data into other systems. If you're looking for a more "batteries included" solution, look at
vtkEnSightGoldBinaryReader
from the VTK library (see docs for comparison).
Requirements
- Python 3.9+
- NumPy 1.22+
Installation
pip install ensight-reader
Example – Python API
import ensightreader
import numpy as np
case = ensightreader.read_case("example.case")
geofile = case.get_geometry_model()
part_names = geofile.get_part_names() # ["internalMesh", ...]
part = geofile.get_part_by_name(part_names[0])
N = part.number_of_nodes
with geofile.open() as fp_geo:
node_coordinates = part.read_nodes(fp_geo) # np.ndarray((N, 3), dtype=np.float32)
variable = case.get_variable("UMean")
with variable.mmap_writable() as mm_var:
data = variable.read_node_data(mm_var, part.part_id)
data[:] = np.sqrt(data) # transform variable data in-place
Example – CLI
# increment X coordinate
ensight_transform --translate 1 0 0 sphere.case
# scale by 1000 (eg. m -> mm conversion)
ensight_transform --scale 1e3 1e3 1e3 sphere.case
# rotation matrix
ensight_transform --matrix \
0 -1 0 0 \
1 0 0 0 \
0 0 1 0 \
0 0 0 1 \
sphere.case
# transform only "internalMesh" part
ensight_transform --translate 1 0 0 --only-parts internalMesh motorbike.case
To learn more, please see the documentation.
Metadata
Release files for ensight-reader 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ensight_reader-0.13.1.tar.gz | 37.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ensight_reader-0.13.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.9 kB
Release files / ensight_reader-0.13.1.tar.gz
| Download URL | ensight_reader-0.13.1.tar.gz |
|---|---|
| Size | 37.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d4b3c0040345d1f78dc7209a6669e68e8a77c763c7c7c2b7e07678dea41920a
|
|
BLAKE2b-256 checksum How to use checksums |
b19e0ea8e1a20d956253fb0a2b30e08a845df19ef5afa6a5c53874ecb5f6d2c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / ensight_reader-0.13.1-py3-none-any.whl
| Download URL | ensight_reader-0.13.1-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d04aa3ac12c6b458b955a1af17843b1b21d7402b3272ae2f543c6badaa59151
|
|
BLAKE2b-256 checksum How to use checksums |
424add927eb1f8d68a85cac0f659bdefb8fdde7be23a95281cad31aa049c3015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|