mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Added clone method to Geometry class
This commit is contained in:
parent
45af8a2937
commit
c4fe563395
1 changed files with 9 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from collections import OrderedDict, Iterable
|
||||
from copy import deepcopy
|
||||
from xml.etree import ElementTree as ET
|
||||
|
||||
from six import string_types
|
||||
|
|
@ -497,3 +498,11 @@ class Geometry(object):
|
|||
|
||||
# Recursively traverse the CSG tree to count all cell instances
|
||||
self.root_universe._determine_paths()
|
||||
|
||||
def clone(self):
|
||||
"""Create a copy of this geometry with new unique IDs for all of its
|
||||
enclosed materials, surfaces, cells, universes and lattices."""
|
||||
|
||||
clone = deepcopy(self)
|
||||
clone.root_universe = deepcopy(self.root_universe)
|
||||
return clone
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue