Python library that automates ParaView to produce high‑quality visuals from OpenFOAM and MESHFREE simulations.
Project description
VifPara
CAE Post-Processing Toolkit
VifPara is a Python library that automates ParaView to produce high‑quality visuals from CAE simulation results from different CAE (computer-aided engineering) frameworks. It helps you automate the generation of reproducible 2D/3D plots, animations, comparative layouts, and batch visualizations. VifPara is not here to replace manual GUI-based post-processing workflows, but to enable intuitive automation of commonly needed visualization procedures.
Key Features
- Cross-platform compatibility - Works on Linux and Windows
- Multiple file formats - Supports OpenFOAM and Ensight
- Flexible configuration - JSON-based configuration system
- Comprehensive visualization - 2D slices, 3D views, animations, and more
- Visualization Automation - Generate many different visualizations and animations with a single script
- Various Frameworks - Developed with OpenFoam & MESHFREE. Other frameworks can be implemented upon request
Example Code
The following code takes a finished OpenFoam simulation testcase and outputs an image of a slice of the case through the center with a view along the y-axis.
To make this code work, you need to install ParaView and download VifPara into a compatible Python environment (see below).
from vifpara import *
if __name__ == "__main__":
# Read config and load case
config = Config(custom_config = {"case_path": "tutorials/incompressible/simpleFoam/motorBike/case.foam",
"dir_plots": "plots/motorBike",
"dir_logs": "logs/motorBike"})
logger.set_log_path(config.get_log_path())
case = Case(config=config, case_type=CaseType.RECONSTRUCTED)
# Define single view layout
layout = Layout([1])
# Create color map
cmap = ColorMap(field="U")
# Create slice object
slice_obj = Slice(
case=case,
color_map=cmap,
normal=Vector3(0.0, 1.0, 0.0))
# Render slice in single view layout
slice_obj.render(layout)
layout.set_height(800)
exporter = Exporter(config=config, layout=layout)
# Save screenshot of slice
exporter.save_snapshot(filename="minimal_example")
Example output:
Info To test the example, you need to download the OpenFoam motorbike testcase and run it with OpenFoam. Afterwards, you point the case_path in the config to the case.foam of the testcase. If it does not exist, just create an empty file with this name in the cases root directory. Afterwards, do not run the script with
python,python3,etc.but withvifpara, which is a dedicated runner installed together with the package.
Software Concept & Supported ParaView Versions
VifPara is a library which adds itself on top of your installed ParaView Python environment (pvpython) via an external Python environment. Therefore, it is crucial, that the Python version you install and use VifPara in, is the same your ParaView installation uses internally.
Please make sure your installed ParaView version is between 5.11 and 5.13. ParaView version 6 is currently not supported.
Tested and working configurations are:
- ParaView 5.11 - Python 3.12
- ParaView 5.12 - Python 3.10
- ParaView 5.13 - Python 3.10
Installation & Use
For information of how to install and use VifPara consult the user documentation and API reference:
In the examples directory, you can find several example scripts of how to use VifPara, which can be used as templates to start from. The result of most example scripts can be found in the reference_exports directory in the examples directory.
Contact
Virtual Vehicle Research GmbH: https://www.v2c2.at
Team
- Group Lead - Alexander Kospach (alexander.kospach@v2c2.at)
- Project Lead - Cyril Marx (cyril.marx@v2c2.at)
- Developer - Juliana Madritsch
- Developer - Florian Michelic
Acknowledgments
Virtual Vehicle Research GmbH has received funding within COMET Competence Centers for Excellent Technologies from the Austrian Federal Ministry for Climate Action, the Austrian Federal Ministry for Labour and Economy, the Province of Styria (Dept. 12) and the Styrian Business Promotion Agency (SFG). The Austrian Research Promotion Agency (FFG) has been authorised for the programme management.
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
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 vifpara-1.3.4.tar.gz.
File metadata
- Download URL: vifpara-1.3.4.tar.gz
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
549467a259b7464e0fa47d4557183ed5ffcff06318dc625cb21f6c978f1b0914
|
|
| MD5 |
cb0a9149f75dc4db16155861253cb050
|
|
| BLAKE2b-256 |
1a6750fd57e36f4f0c50ba1358f2e60e1d23c6f6b31144c6d6f2afb580f4f81d
|
File details
Details for the file vifpara-1.3.4-py3-none-any.whl.
File metadata
- Download URL: vifpara-1.3.4-py3-none-any.whl
- Upload date:
- Size: 56.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39f2cabb67b8c413ff465bb2016dcb0e659c636dfe1409e4635c48ff6715efe0
|
|
| MD5 |
3767de2d86877ac5deca59c3285ecafd
|
|
| BLAKE2b-256 |
9447bbd4a84b284a7c349d13cd03aea7b769def35e6f519554363b5f15ce853b
|