CYCLUS
|
An immutable object responsible for holding a nuclide composition.
It tracks decay lineages to prevent duplicate calculations and output recording and is able to record its composition data to output when told. Each composition keeps a pointer to references to every other composition that is a result of decaying this or a previously decayed-from composition.
Compositions are immutable and thus their state must be created/defined entirely at their creation. Compositions are created by passing in a CompMap (a map of nuclides to quantities). In general CompMaps are not assumed to be normalized to any particular value. A Uranium dioxide composition can be created as follows:
Definition at line 38 of file composition.h.
#include <composition.h>
Public Types | |
typedef boost::shared_ptr< Composition > | Ptr |
Public Member Functions | |
const CompMap & | atom () |
Ptr | Decay (int delta) |
Ptr | Decay (int delta, uint64_t secs_per_timestep) |
int | id () |
const CompMap & | mass () |
void | Record (Context *ctx) |
Static Public Member Functions | |
static Ptr | CreateFromAtom (CompMap v) |
static Ptr | CreateFromMass (CompMap v) |
Protected Types | |
typedef std::map< int, Composition::Ptr > | Chain |
typedef boost::shared_ptr< Chain > | ChainPtr |
Protected Member Functions | |
Composition () | |
Protected Attributes | |
ChainPtr | decay_line_ |
|
protected |
a chain containing compositions that are a result of decay from a common ancestor composition.
The key is the total amount of time a composition has been decayed from its root parent.
Definition at line 84 of file composition.h.
|
protected |
Definition at line 86 of file composition.h.
typedef boost::shared_ptr<Composition> cyclus::Composition::Ptr |
Definition at line 43 of file composition.h.
|
protected |
Definition at line 105 of file composition.cc.
Returns the unnormalized atom composition.
Definition at line 45 of file composition.cc.
|
static |
Creates a new composition from v with its components having appropriate atom-based ratios.
v does not need to be normalized to any particular value.
Definition at line 17 of file composition.cc.
|
static |
Creates a new composition from v with its components having appropriate mass-based ratios.
v does not need to be normalized to any particular value.
Definition at line 29 of file composition.cc.
Composition::Ptr cyclus::Composition::Decay | ( | int | delta | ) |
Returns a decayed version of this composition (decayed delta timesteps) assuming a time step is 1/12 of one year in duration.
This composition remains unchanged.
Definition at line 83 of file composition.cc.
Composition::Ptr cyclus::Composition::Decay | ( | int | delta, |
uint64_t | secs_per_timestep ) |
Returns a decayed version of this composition (decayed delta timesteps) using the seconds to timestep conversion specified.
Definition at line 67 of file composition.cc.
int cyclus::Composition::id | ( | ) |
Returns a unique id associated with this composition.
Note that multiple material objects can share the same composition. Also Note that the id is not the same for two compositions that were separately created from the same CompMap.
Definition at line 41 of file composition.cc.
Returns the unnormalized mass composition.
Definition at line 56 of file composition.cc.
Records the composition in output database Compositions table (if not done previously).
Definition at line 87 of file composition.cc.
|
protected |
Definition at line 90 of file composition.h.