diff --git a/openmc/lattice.py b/openmc/lattice.py index 3bb6e825e1..be5f22db93 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -56,11 +56,11 @@ class Lattice(object): return False elif self.name != other.name: return False - elif self.pitch != other.pitch: + elif np.any(self.pitch != other.pitch): return False elif self.outer != other.outer: return False - elif self.universes != other.universes: + elif np.any(self.universes != other.universes): return False else: return True @@ -533,7 +533,7 @@ class RectLattice(Lattice): return False elif self.shape != other.shape: return False - elif self.lower_left != other.lower_left: + elif np.any(self.lower_left != other.lower_left): return False else: return True diff --git a/openmc/openmoc_compatible.py b/openmc/openmoc_compatible.py index 98012fae96..21dc4b6a69 100644 --- a/openmc/openmoc_compatible.py +++ b/openmc/openmoc_compatible.py @@ -172,7 +172,9 @@ def get_openmoc_surface(openmc_surface): B = openmc_surface.b C = openmc_surface.c D = openmc_surface.d - openmoc_surface = openmoc.Plane(A, B, C, D, surface_id, name) + + # OpenMOC uses the opposite sign on D + openmoc_surface = openmoc.Plane(A, B, C, -D, surface_id, name) elif openmc_surface.type == 'x-plane': x0 = openmc_surface.x0 @@ -253,7 +255,9 @@ def get_openmc_surface(openmoc_surface): B = openmoc_surface.getB() C = openmoc_surface.getC() D = openmoc_surface.getD() - openmc_surface = openmc.Plane(surface_id, boundary, A, B, C, D, name) + + # OpenMOC uses the opposite sign on D + openmc_surface = openmc.Plane(surface_id, boundary, A, B, C, -D, name) elif openmoc_surface.getSurfaceType() == openmoc.XPLANE: openmoc_surface = openmoc.castSurfaceToXPlane(openmoc_surface) @@ -708,8 +712,7 @@ def get_openmc_lattice(openmoc_lattice): universe_array[x][y][z] = \ unique_universes[universe_id] - universe_array = np.swapaxes(universe_array, 0, 1) - universe_array = universe_array[::-1, :, :] + universe_array = np.swapaxes(universe_array, 0, 2) # Convert axially infinite 3D OpenMOC lattice to a 2D OpenMC lattice if width[2] == np.finfo(np.float64).max: diff --git a/openmc/universe.py b/openmc/universe.py index c955934f2a..d36b167a51 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -76,7 +76,7 @@ class Universe(object): return False elif self.name != other.name: return False - elif self.cells != other.cells: + elif dict.__ne__(self.cells, other.cells): return False else: return True