Export FBPIC simulation data onto cylindrical meshes for visualization in Paraview
Clone repository
git clone git@github.com:hixps/fbpic_to_vtk.gitInstall
pip install fbpic_to_vtk-
Define input and output filenames, simulation timestep
timestep = 40000 source_filename = f'fbpic_simulation_output.h5' output_filename = 'fbpic_data_on_vtk_grid.vtu'
-
Define the names of the diagnostics to be exported, they need to be the same as the diagnostics in the fbpic input deck
scalar_diag_names = ('rho_electron', 'rho_inner', 'rho_ion') vector_diag_names = ('E',)
-
Settings for the vtk mesh
- Define numer of points along theta
Ntheta = 32 - Define slices along z and r directions for downsampling
downsample_r = slice(None, -2, 2) downsample_z = slice(None, None, 5)
- Define numer of points along theta
-
Run the exporter
from fbpic_to_vtk import fbpicToVTK fbpicToVTK( source_filename, timestep, scalar_diag_names, vector_diag_names, downsample_r = downsample_r, downsample_z = downsample_z, Ntheta = Ntheta, output_filename = output_filename )
