OpenMC/scripts/openmc-voxel-to-vtk
Jonathan Shimwell 15890538a6
Apply suggestions from code review by @paulromano
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2023-04-26 20:08:34 +01:00

22 lines
613 B
Python
Executable file

#!/usr/bin/env python3
from argparse import ArgumentParser
import openmc
if __name__ == "__main__":
# Process command line arguments
parser = ArgumentParser('Converts a voxel HDF5 file to a VTK file')
parser.add_argument("voxel_file", help="Path to voxel h5 file")
parser.add_argument(
"-o",
"--output",
action="store",
default="plot",
help="Path to output VTK file.",
)
args = parser.parse_args()
print("Reading and translating data...")
openmc.voxel_to_vtk(args.voxel_file, args.output)
print(f"Written VTK file {args.output}...")