CYCLUS
Loading...
Searching...
No Matches
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;
An immutable object responsible for holding a nuclide composition.
Definition composition.h:38
static Ptr CreateFromAtom(CompMap v)
Creates a new composition from v with its components having appropriate atom-based ratios.
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
Definition composition.h:17
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters

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

◆ Chain

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.

◆ ChainPtr

typedef boost::shared_ptr<Chain> cyclus::Composition::ChainPtr
protected

Definition at line 86 of file composition.h.

◆ Ptr

Definition at line 43 of file composition.h.

Constructor & Destructor Documentation

◆ Composition()

cyclus::Composition::Composition ( )
protected

Definition at line 105 of file composition.cc.

Member Function Documentation

◆ atom()

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

Returns the unnormalized atom composition.

Definition at line 45 of file composition.cc.

◆ CreateFromAtom()

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 17 of file composition.cc.

◆ CreateFromMass()

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 29 of file composition.cc.

◆ Decay() [1/2]

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.

◆ Decay() [2/2]

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.

◆ id()

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.

◆ mass()

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

Returns the unnormalized mass composition.

Definition at line 56 of file composition.cc.

◆ Record()

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

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

Definition at line 87 of file composition.cc.

Member Data Documentation

◆ decay_line_

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: