Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with new pyvista and minor README changes. #27

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ Please refer to https://github.com/google/jax for the latest installation docume

Install dependencies:
```bash
pip install jmp pyvista numpy matplotlib Rtree trimesh jmp
pip install pyvista numpy matplotlib Rtree trimesh jmp orbax-checkpoint termcolor
```

Run an example:
```bash
git clone https://github.com/Autodesk/XLB
cd XLB
export PYTHONPATH=.
python3 examples/cavity2d.py
python3 examples/CFD/cavity2d.py
```
6 changes: 3 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def save_fields_vtk(timestep, fields, output_dir='.', prefix='fields'):
if value.ndim == 2:
dimensions = dimensions + (1,)

grid = pv.UniformGrid(dimensions=dimensions)
grid = pv.ImageData(dimensions=dimensions)

# Add the fields to the grid
for key, value in fields.items():
Expand Down Expand Up @@ -157,7 +157,7 @@ def live_volume_randering(timestep, field):
if field.ndim != 3:
raise ValueError("The input field must be 3D!")
dimensions = field.shape
grid = pv.UniformGrid(dimensions=dimensions)
grid = pv.ImageData(dimensions=dimensions)

# Add the field to the grid
grid['field'] = field.flatten(order='F')
Expand Down Expand Up @@ -207,7 +207,7 @@ def save_BCs_vtk(timestep, BCs, gridInfo, output_dir='.'):
gridDimensions = (gridInfo['nx'] + 1, gridInfo['ny'] + 1, gridInfo['nz'] + 1)
fieldDimensions = (gridInfo['nx'], gridInfo['ny'], gridInfo['nz'])

grid = pv.UniformGrid(dimensions=gridDimensions)
grid = pv.ImageData(dimensions=gridDimensions)

# Dictionary to keep track of encountered BC names
bcNamesCount = {}
Expand Down