CYCLUS
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
cyclus::Composition Class Reference

Detailed Description

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:

v[922350000] = 2.4;
v[80160000] = 4.8;

Definition at line 38 of file composition.h.

#include <composition.h>

Public Types

typedef boost::shared_ptr< CompositionPtr
 

Public Member Functions

const CompMapatom ()
 
Ptr Decay (int delta)
 
Ptr Decay (int delta, uint64_t secs_per_timestep)
 
int id ()
 
const CompMapmass ()
 
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::PtrChain
 
typedef boost::shared_ptr< ChainChainPtr
 

Protected Member Functions

 Composition ()
 

Protected Attributes

ChainPtr decay_line_
 

Member Typedef Documentation

typedef std::map<int, Composition::Ptr> cyclus::Composition::Chain
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.

typedef boost::shared_ptr<Chain> cyclus::Composition::ChainPtr
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.

Constructor & Destructor Documentation

cyclus::Composition::Composition ( )
protected

Definition at line 102 of file composition.cc.

Member Function Documentation

const CompMap & cyclus::Composition::atom ( )

Returns the unnormalized atom composition.

Definition at line 42 of file composition.cc.

Composition::Ptr cyclus::Composition::CreateFromAtom ( CompMap  v)
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 14 of file composition.cc.

Composition::Ptr cyclus::Composition::CreateFromMass ( CompMap  v)
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 26 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 80 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 64 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 38 of file composition.cc.

const CompMap & cyclus::Composition::mass ( )

Returns the unnormalized mass composition.

Definition at line 53 of file composition.cc.

void cyclus::Composition::Record ( Context ctx)

Records the composition in output database Compositions table (if not done previously).

Definition at line 84 of file composition.cc.

Member Data Documentation

ChainPtr cyclus::Composition::decay_line_
protected

Definition at line 90 of file composition.h.


The documentation for this class was generated from the following files: