Open shimwell opened 2 weeks ago
I accidentally stumbled on this today while trying to view a vtk from within a container and thought the workshop could benefit from this.
Currently we ask users to install paraview locally. However we could view the vtk files directly in julyter lab.
We could include pyvista with pip install 'pyvista[jupyter]' in the docker image and then plot mesh tally results like this one from task 8
pip install 'pyvista[jupyter]'
import pyvista as pv mesh = pv.read('heating_tally_on_reg_mesh.vtk') mesh.set_active_scalars(name='mean') clipped = mesh.clip(normal='y') # clipped_and_thresholded = clipped.threshold(0.1e-21) clipped_and_thresholded = clipped.threshold_percent(0.01) clipped_and_thresholded.plot()
:video_camera: vtk-openmc-pyvist-jupyter.webm :video_camera:
I accidentally stumbled on this today while trying to view a vtk from within a container and thought the workshop could benefit from this.
Currently we ask users to install paraview locally. However we could view the vtk files directly in julyter lab.
We could include pyvista with
pip install 'pyvista[jupyter]'
in the docker image and then plot mesh tally results like this one from task 8:video_camera: vtk-openmc-pyvist-jupyter.webm :video_camera: