Commit f7de469d authored by Kenneth Loenbaek's avatar Kenneth Loenbaek
Browse files

Added Readme

Added pyvista as a requirement
parent 7be43133
# EllipSys2VTK
Python module for reading EllipSys files into python/VTK/PyVista.
## Installation
Before installing *EllipSys2VTK* it is recommended to install *PyVista* via conda install
as installing *PyVista/VTK* via pip can be difficult. Installing *PyVista*:
conda install -c conda-forge pyvista
After *PyVista* is installed the module can be installed via `pip`:
pip install git+
## Basic usages
The module can load data in multiple formats, with the easiest format to use being pyvista
the main methods `XXD2pyvista` and `sim2pyvista`:
>>> import ellipsys2vtk as e2v
>>> # Reading X3D file
>>> X3D = e2v.XXD2pyvista("grid.X3D")
>>> # Reading RST and X3D files (assuming same project name for both files)
>>> sim = e2v.sim2pyvista("grid.RST.01")
Both methods return `pyvista.MultiBlock` objects which is discribed further here:
The filters available in *PyVista* can be seen here:
The `XXD2pyvista` method will by default load all data (points/x-y-z and attr/boundary-conditions) in the `.X3D` but is is not loading the
the ghost cells. This can be further controlled by the arguments for `XXD2pyvista`.
The `sim2pyvista` method will by default only load pressure (`p`) and velocities (`Vel`)
as well as the grid. It will not load the ghost cells by default.
All the possible fields that can be loaded can be displayed by:
>>> print(e2v.sim2names("grid.RST.01"))
As an example loading viscosity (`vis`) and density (`den`) is done as:
>>> sim = e2v.sim2pyvista("grid.RST.01", {"vis", "den"})
Both `XXD2pyvista` and `sim2pyvista` can also only load a subset of the blocks by
simply passing a list of the blocks that needs to be loaded
(it starts from block 1 and not zero):
>>> sim = e2v.sim2pyvista("grid.RST.01", blocks=[1, 3, 5])
The module also has methods for loading the data as a python dictionary (`dict`)
which are simply named as `*2dict` (e.g. `XXD2dict`, `sim2dict`).
......@@ -9,6 +9,7 @@ setup(name='ellipsys2vtk',
install_requires = [
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment