address reviewers' comment on deepcopy and tests input

This commit is contained in:
rockfool 2019-11-07 10:31:57 -05:00
parent bd6a479370
commit f75db76c70
2 changed files with 394 additions and 394 deletions

View file

@ -54,10 +54,6 @@ class TRISO(openmc.Cell):
self._surface = openmc.Sphere(r=outer_radius)
super().__init__(fill=fill, region=-self._surface)
self.center = np.asarray(center)
self._outer_radius = outer_radius
def deepcopy(self):
return TRISO(outer_radius=self._outer_radius, fill=self.fill, center=self.center)
@property
def center(self):
@ -836,10 +832,14 @@ def create_triso_lattice(trisos, lower_left, pitch, shape, background):
if idx in triso_locations:
# Create copy of TRISO particle with materials preserved and
# different cell/surface IDs
t_copy = t.deepcopy()
t_copy = copy.copy(t)
t_copy.id = None
t_copy.fill = t.fill
t_copy._surface.id = None
t_copy._surface = openmc.Sphere(r=t._surface.r,
x0=t._surface.x0,
y0=t._surface.y0,
z0=t._surface.z0)
t_copy.region = -t_copy._surface
triso_locations[idx].append(t_copy)
else:
warnings.warn('TRISO particle is partially or completely '