Closed MicahGale closed 1 month ago
duplicate of #123.
This will be useful.
Some questions on the mechanics to consider:
Material
should copy the material_components
, and it shouldn't copy the _problem
. Materials
instance and to an MCNP_Problem
? append_renumber()
, request_number(*args)
, etc.?I think generally:
_problem
should be cloned.MCNP_Object
instances should automatically be linked to the same problem I think.MCNP_Problem
all of its children should be linked to it.
Is your feature request related to a problem? Please describe.
It's quite common to use an existing object as a "template" for a new one. For instance, when discretizing a cell into smaller ones for zone depletions it would be helpful to make copies of the cell, its surfaces, and material.
Describe the solution you'd like Add a
clone
method to all objects.So you can do:
instead of:
Describe alternatives you've considered Currently the recommended method is
copy.deepcopy
Additional context See
openmc.Cell.clone