From e8d2004c191e8069438ea886e673f1ff99ee4b83 Mon Sep 17 00:00:00 2001 From: Harry Braviner Date: Thu, 7 Dec 2023 21:44:52 -0500 Subject: [PATCH 1/3] Examples path and dependencies --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e2c4fa9..1d2c3e2 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ 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 termcolor ``` Run an example: @@ -152,5 +152,5 @@ Run an example: git clone https://github.com/Autodesk/XLB cd XLB export PYTHONPATH=. -python3 examples/cavity2d.py +python3 examples/CFD/cavity2d.py ``` From d7b3b746532f03a3925c1b2eb5179f0263deeb9b Mon Sep 17 00:00:00 2001 From: Harry Braviner Date: Thu, 7 Dec 2023 21:53:39 -0500 Subject: [PATCH 2/3] pyvista UniformGrid -> ImageData pyvists 0.43.0 renames UniformGrid to ImageData. See https://github.com/pyvista/pyvista/pull/4518 for details. Renamed all instances of this for compatability with pyvista 0.43. Works with pyvista back to and including 0.40. --- src/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.py b/src/utils.py index 61c11fb..1720ca6 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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(): @@ -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') @@ -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 = {} From f04790b774356ee1911e5954d72e8a418be0edf6 Mon Sep 17 00:00:00 2001 From: Harry Braviner Date: Fri, 8 Dec 2023 13:41:56 -0500 Subject: [PATCH 3/3] Dependency orbax->orbax-checkpoint Installing orbax installed orbax-checkpoint, but doing this is deprecated according to docs. Changed dependency and confirmed this still works. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d2c3e2..8d662b5 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ Please refer to https://github.com/google/jax for the latest installation docume Install dependencies: ```bash -pip install pyvista numpy matplotlib Rtree trimesh jmp orbax termcolor +pip install pyvista numpy matplotlib Rtree trimesh jmp orbax-checkpoint termcolor ``` Run an example: