From 3175a3be1d7d7a2f9c2400916cdb34ebffb5f709 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 26 Feb 2019 18:48:29 -0600 Subject: [PATCH] Resetting plots.xml. Adding some output to new script. --- scripts/openmc-voxel-to-vtk | 10 ++++++---- tests/regression_tests/plot_voxel/plots.xml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/openmc-voxel-to-vtk b/scripts/openmc-voxel-to-vtk index 88172bb4c..c7d60258a 100755 --- a/scripts/openmc-voxel-to-vtk +++ b/scripts/openmc-voxel-to-vtk @@ -8,8 +8,6 @@ import numpy as np import h5py import vtk -from vtk.util import numpy_support - def main(): # Process command line arguments parser = ArgumentParser() @@ -34,11 +32,14 @@ def main(): # transpose data from OpenMC ordering (zyx) to VTK ordering (xyz) # and flatten to 1-D array - h5data = fh['data'].value.T.flatten() + print("Reading and translating data...") + h5data = fh['data'][...] + h5data = h5data.T.copy() + data = vtk.vtkIntArray() data.SetName("id") # pass h5data as a "hint" that no copy/allocation is necessary - data.SetArray(h5data, h5dara.size, True) + data.SetArray(h5data, h5data.size, True) # set the data array data.array = h5data # add data to image grid @@ -52,6 +53,7 @@ def main(): if not args.output.endswith(".vti"): args.output += ".vti" writer.SetFileName(args.output) + print("Writing VTK file {}...".format(args.output)) writer.Write() if __name__ == '__main__': diff --git a/tests/regression_tests/plot_voxel/plots.xml b/tests/regression_tests/plot_voxel/plots.xml index e57992c2a..833329b42 100644 --- a/tests/regression_tests/plot_voxel/plots.xml +++ b/tests/regression_tests/plot_voxel/plots.xml @@ -2,7 +2,7 @@ - 500 500 100 + 50 50 10 0. 0. 0. 20 20 10