mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
22 lines
613 B
Python
Executable file
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}...")
|