From 125812c487da0e56a8bc6f0751462696404fcf4c Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 27 Feb 2019 18:09:59 -0600 Subject: [PATCH] Updating voxel version and using that for a check rather than the OpenMC version. --- include/openmc/constants.h | 2 +- scripts/openmc-voxel-to-vtk | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 916f7693b3..5a4c169111 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -33,7 +33,7 @@ constexpr std::array VERSION_PARTICLE_RESTART {2, 0}; constexpr std::array VERSION_TRACK {2, 0}; constexpr std::array VERSION_SUMMARY {6, 0}; constexpr std::array VERSION_VOLUME {1, 0}; -constexpr std::array VERSION_VOXEL {1, 0}; +constexpr std::array VERSION_VOXEL {1, 1}; constexpr std::array VERSION_MGXS_LIBRARY {1, 0}; constexpr char VERSION_MULTIPOLE[] {"v0.2"}; diff --git a/scripts/openmc-voxel-to-vtk b/scripts/openmc-voxel-to-vtk index afac8984f9..699f5a015c 100755 --- a/scripts/openmc-voxel-to-vtk +++ b/scripts/openmc-voxel-to-vtk @@ -8,7 +8,7 @@ import numpy as np import h5py import vtk -_min_version = (0,10,0) +_min_version = (1,1) def main(): @@ -23,13 +23,14 @@ def main(): fh = h5py.File(args.voxel_file, 'r') # check version - version = tuple(fh.attrs['openmc_version']) + version = tuple(fh.attrs['version']) if version < _min_version: old_version = ".".join(map(str,version)) min_version = ".".join(map(str,_min_version)) - err_msg = "This voxel file was generated using OpenMC " \ - "version {}. Please re-generate using "\ - "version {} or higher.".format(old_version, min_version) + err_msg = "This voxel file's version is {}. This script " \ + "only supports voxel files with version {} or " \ + "higher. Please generate a new voxel file using " \ + "a newer version of OpenMC.".format(old_version, min_version) raise ValueError(err_msg) dimension = fh.attrs['num_voxels']