From e7cba5b22c39834869290e1c88da8c0e085485be Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 3 Oct 2015 14:54:46 -0400 Subject: [PATCH 1/3] Fixed minor issues with OpenCG surface coefficient properties in compatibility module --- openmc/opencg_compatible.py | 2 +- openmc/surface.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/opencg_compatible.py b/openmc/opencg_compatible.py index a6f90818f9..1cdf8e8756 100644 --- a/openmc/opencg_compatible.py +++ b/openmc/opencg_compatible.py @@ -220,7 +220,7 @@ def get_opencg_surface(openmc_surface): opencg_surface = opencg.Plane(surface_id, name, boundary, A, B, C, D) elif openmc_surface.type == 'x-plane': - x0 = openmc_surface.y0 + x0 = openmc_surface.x0 opencg_surface = opencg.XPlane(surface_id, name, boundary, x0) elif openmc_surface.type == 'y-plane': diff --git a/openmc/surface.py b/openmc/surface.py index 164bbd09bf..063787ce34 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -275,7 +275,7 @@ class XPlane(Plane): @property def x0(self): - return self.coeff['x0'] + return self.coeffs['x0'] @x0.setter def x0(self, x0): From e02a9114897532abd2e247f740719caac4a94cfa Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sat, 3 Oct 2015 16:01:37 -0400 Subject: [PATCH 2/3] Fix PyAPI summary S(alpha,beta) bug Material needs to be instantiated before trying to add sab to it --- openmc/summary.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openmc/summary.py b/openmc/summary.py index 2ae7464846..f3952f9b41 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -72,6 +72,9 @@ class Summary(object): nuc_densities = self._f['materials'][key]['nuclide_densities'][...] nuclides = self._f['materials'][key]['nuclides'].value + # Create the Material + material = openmc.Material(material_id=material_id, name=name) + # Read the names of the S(a,b) tables for this Material and add them if 'sab_names' in self._f['materials'][key]: sab_tables = self._f['materials'][key]['sab_names'].value @@ -79,10 +82,8 @@ class Summary(object): name, xs = sab_table.decode().split('.') material.add_s_alpha_beta(name, xs) - # Create the Material - material = openmc.Material(material_id=material_id, name=name) - - # Set the Material's density to g/cm3 - this is what is used in OpenMC + # Set the Material's density to g/cm3 - this is what is used in + # OpenMC material.set_density(density=density, units='g/cm3') # Add all nuclides to the Material From b4a92883f246d0588f9b08fa443108ee8745dc2b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 4 Oct 2015 10:32:15 +0700 Subject: [PATCH 3/3] Allow run_tests.py to work even without MPI installed --- tests/run_tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 70ea4c3dc9..338732c142 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -128,10 +128,8 @@ class Test(object): if self.mpi: if os.path.exists(os.path.join(MPI_DIR, 'bin', 'mpifort')): self.fc = os.path.join(MPI_DIR, 'bin', 'mpifort') - elif os.path.exists(os.path.join(MPI_DIR, 'bin', 'mpif90')): - self.fc = os.path.join(MPI_DIR, 'bin', 'mpif90') else: - raise RuntimeError('Cannot find an MPI Fortran compiler') + self.fc = os.path.join(MPI_DIR, 'bin', 'mpif90') else: self.fc = FC