MIXD format mesh handler
Project description
mixdpy
Package for handling mixd meshes and associated dataThis package provides read and write routines for big-endian binary files. It was mainly developed for the MIXD mesh format developed at CATS.
The package also provides a class for reading the MIXD mesh format and associated data.
Installation
In your python environment run:
pip install git+ssh://git@git.rwth-aachen.de/cats-gitolite/private/tools/mixdpy.git
Examples
Some examples:
Write and read binaries
import mixdpy
import numpy as np
arr = np.arange(24, dtype=np.int32).reshape(2, 3, 4)
filename = "somebinarray"
mixdpy.write_int(filename, arr, shift=False)
out = mixdpy.read_int(filename, shape=(3, 4), shift=False)
Reading a mesh
import mixdpy
path_to_mesh = "mesh"
mesh = mixdpy.Mixd(path_to_mesh, minf_name="minf.space") # Infers dpst flag from mien entries
# Read associated data
ndf = mesh.nsd + 1
ins_data_out = mesh.read_node_float("data.out",entry_shape=(ndf,))
ins_data_all = mesh.read_node_float("data.all",entry_shape=(ndf,),nts=-1)
print(mesh.get_bounds())
Export mesh using meshio
import mixdpy
import meshio
path_to_mesh = "mesh"
mesh = mixdpy.Mixd(path_to_mesh)
ndf = mesh.nsd + 1
ins_data_out = mesh.read_node_float("data.out",entry_shape=(ndf,))
export_mesh = meshio.Mesh(
mesh.mxyz,
{"tetra":mesh.mien}
point_data = {
"velocity" : ins_data_out[0,:,:mesh.nsd],
"pressure" : ins_data_out[0,:,mesh.nsd]
}
)
export_mesh.write("ins.vtk")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mixdpy-0.2.2.tar.gz
(5.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mixdpy-0.2.2.tar.gz.
File metadata
- Download URL: mixdpy-0.2.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b57eadd8e2e89aece5a79c353be78c76e9c31040c2af04995392961ba47e489
|
|
| MD5 |
e77cbdd6eb0bf02ba035d5e28421209b
|
|
| BLAKE2b-256 |
01a7b3fa5c683b81c7d8f00f561c7a10e653609b6fc6a82b78e6a9d26f5ce821
|
File details
Details for the file mixdpy-0.2.2-py3-none-any.whl.
File metadata
- Download URL: mixdpy-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10737b780b6904cfe96c9b84eac8f0a705e6ecd9c9f8c5388623c6d40f9534bd
|
|
| MD5 |
4259f73c9bd6aa02d738daa080337a15
|
|
| BLAKE2b-256 |
9a2b7ed91270758075cb9db788a66b09e7e6ded8950de6522f52348be6fa82fd
|