#include <Nuclide_Gen.h>

Inheritance diagram for Nuclide_Gen:
Nuclide Checkable

General-purpose implementation of the Nuclide interface. More...

Public Types

typedef SP_Nuclide SP
 strong pointer More...
 
typedef WP_Nuclide WP
 weak pointer More...
 
typedef CWP_Nuclide CWP
 const weak pointer More...
 

INTERFACE<<Origen::Checkable>>

See Origen::Checkable for details.

std::string name () const
 
void get_name (std::string &name) const
 
void set_name (std::string name)
 
int id () const
 
void get_id (int &id) const
 
void set_id (int id)
 
bool has_initialized_id () const
 
std::string to_string () const
 
bool good () const
 
bool good (Vec_Str &errors) const
 
bool is_initialized () const
 
Scale::Json::Value to_json () const
 

INTERFACE<<Origen::Nuclide>>

See Origen::Nuclide for details.

std::vector< WP_Transitiongains () const
 Return a vector of gains producing the nuclide. More...
 
void get_gains (std::vector< WP_Transition > &gains) const
 Get a vector of gains producing the nuclide. More...
 
void set_gains (std::vector< WP_Transition > gains)
 Set the gains producing the nuclide. More...
 
void append_gain (WP_Transition gain)
 Append gain to list of gains. More...
 
void clear_gains ()
 
WP_Transition gain (int channel_id, int parent_id) const
 retrieve a gain More...
 
int num_gains () const
 Get the number of gains producing the nuclide. More...
 
std::vector< SP_Channellosses () const
 Return a vector of losses destroying the nuclide. More...
 
void get_losses (std::vector< SP_Channel > &losses) const
 Get a vector of losses destroying the nuclide. More...
 
void set_losses (std::vector< SP_Channel > losses)
 Set the losses destroying the nuclide. More...
 
SP_Channel loss (int channel_id) const
 return loss channel More...
 
void get_loss (int channel_id, SP_Channel &loss) const
 retrieve loss channel More...
 
void set_loss (SP_Channel loss)
 
SP_Channel add_loss (SP_ChannelType channel_type)
 add a new loss channel to the nuclide by specifying ChannelType More...
 
SP_Channel add_loss (int field_id, int reaction_mt, int decay_mode=0)
 add a new loss channel by specifying raw ids More...
 
SP_Channel add_loss (SP_Field field, int reaction_mt, int decay_mode=0)
 add a new loss channel with Field and raw ids More...
 
SP_Channel add_loss (int decay_mode)
 add a decay loss More...
 
int num_losses () const
 Get the number of losses destroying the nuclide. More...
 
CWP_TransitionSystem system () const
 
void get_system (WP_TransitionSystem &system) const
 
void set_system (WP_TransitionSystem system)
 
bool has_initialized_system () const
 
int isomeric_state () const
 
void get_isomeric_state (int &isomeric_state) const
 
void set_isomeric_state (int isomeric_state)
 
SP_Species species () const
 
void get_species (SP_Species &species) const
 
void set_species (SP_Species species)
 
bool has_initialized_species () const
 
double num () const
 
void get_num (double &num) const
 
void set_num (double num)
 
double decay_constant () const
 Return the decay constant. More...
 
double loss_xs () const
 

Public Member Functions

 Nuclide_Gen ()
 
 Nuclide_Gen (int isomeric_state, Species::SP species)
 
 Nuclide_Gen (int isomeric_state, Species::SP species, double num)
 
virtual ~Nuclide_Gen ()
 

Private Types

typedef std::map< int, Channel::SPChannelRegistry
 

Private Member Functions

virtual std::vector< WP_Transitiongains_impl () const
 
virtual void get_gains_impl (std::vector< WP_Transition > &gains) const
 
virtual void set_gains_impl (std::vector< WP_Transition > gains)
 
virtual int num_gains_impl () const
 
virtual void append_gain_impl (WP_Transition gain)
 
virtual WP_Transition gain_impl (int channel_id, int parent_id) const
 
virtual void clear_gains_impl ()
 
virtual std::vector< Channel::SPlosses_impl () const
 
virtual void get_losses_impl (std::vector< Channel::SP > &losses) const
 
virtual void set_losses_impl (std::vector< Channel::SP > losses)
 
virtual Channel::SP loss_impl (int channel_id) const
 
virtual void get_loss_impl (int channel_id, Channel::SP &loss) const
 
virtual void set_loss_impl (Channel::SP loss)
 
virtual SP_Channel add_loss_impl (SP_ChannelType channel_type)
 
virtual int num_losses_impl () const
 
virtual double decay_constant_impl () const
 
virtual double num_impl () const
 
virtual void get_num_impl (double &num) const
 
virtual void set_num_impl (double num)
 
virtual int isomeric_state_impl () const
 
virtual void get_isomeric_state_impl (int &isomeric_state) const
 
virtual void set_isomeric_state_impl (int isomeric_state)
 
virtual double loss_xs_impl () const
 
virtual Species::SP species_impl () const
 
virtual void get_species_impl (Species::SP &species) const
 
virtual void set_species_impl (Species::SP species)
 
virtual bool has_initialized_species_impl () const
 
virtual CWP_TransitionSystem system_impl () const
 
virtual void get_system_impl (WP_TransitionSystem &system) const
 
virtual void set_system_impl (WP_TransitionSystem system)
 
virtual bool has_initialized_system_impl () const
 

Private Attributes

TransitionSystem::WP b_system
 
int b_isomeric_state
 
Species::SP b_species
 
double b_num
 
std::vector< WP_Transitionb_gains
 
ChannelRegistry b_loss_map
 

Detailed Description

General-purpose implementation of the Nuclide interface.

The general-purpose implementation of INTERFACE<<Origen::Nuclide>> that will be good when the use case is:

  1. an initial intense setup operation adding loss channels followed by
  2. repeated access losses without changing structure and
  3. extraction of all gains in a group.

The gains are stored in a vector so the gain lookup is linear, whereas the losses are stored in a map.

Sometimes the best approach is to store the smart pointers to what you need in a structure that you can easily/quickly traverse.

See also
Origen::Transition_Gen, Origen::Channel_Gen
Examples:
tstTransitionSystem_Gen.cpp.

Member Typedef Documentation

typedef std::map<int, Channel::SP> ChannelRegistry
private
typedef SP_Nuclide SP
inherited

strong pointer

typedef WP_Nuclide WP
inherited

weak pointer

typedef CWP_Nuclide CWP
inherited

const weak pointer

Constructor & Destructor Documentation

Nuclide_Gen ( int  isomeric_state,
Species::SP  species 
)
Nuclide_Gen ( int  isomeric_state,
Species::SP  species,
double  num 
)
~Nuclide_Gen ( )
virtual

Member Function Documentation

std::vector< WP_Transition > gains_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_gains.

void get_gains_impl ( std::vector< WP_Transition > &  gains) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_gains.

void set_gains_impl ( std::vector< WP_Transition gains)
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_gains, and Nuclide::gains().

int num_gains_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_gains.

void append_gain_impl ( WP_Transition  gain)
privatevirtual
Transition::WP gain_impl ( int  channel_id,
int  parent_id 
) const
privatevirtual
void clear_gains_impl ( )
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_gains, and Nuclide::num_gains().

std::vector< Channel::SP > losses_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map, and Nuclide::losses().

void get_losses_impl ( std::vector< Channel::SP > &  losses) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map.

void set_losses_impl ( std::vector< Channel::SP losses)
privatevirtual
Channel::SP loss_impl ( int  channel_id) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map.

void get_loss_impl ( int  channel_id,
Channel::SP loss 
) const
privatevirtual

Implements Nuclide.

References Nuclide::loss().

void set_loss_impl ( Channel::SP  loss)
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map, and Nuclide::loss().

SP_Channel add_loss_impl ( SP_ChannelType  channel_type)
privatevirtual

Implements Nuclide.

References Nuclide::loss(), and Nuclide::set_loss().

int num_losses_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map.

double decay_constant_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map.

double num_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_num.

void get_num_impl ( double &  num) const
privatevirtual

Implements Nuclide.

References Nuclide::num().

void set_num_impl ( double  num)
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_num, and Nuclide::num().

int isomeric_state_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_isomeric_state.

void get_isomeric_state_impl ( int &  isomeric_state) const
privatevirtual

Implements Nuclide.

References Nuclide::isomeric_state().

void set_isomeric_state_impl ( int  isomeric_state)
privatevirtual
double loss_xs_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_loss_map.

Species::SP species_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_species.

void get_species_impl ( Species::SP species) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_species.

void set_species_impl ( Species::SP  species)
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_species, and Nuclide::species().

bool has_initialized_species_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide::species().

CWP_TransitionSystem system_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_system.

void get_system_impl ( WP_TransitionSystem system) const
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_system.

void set_system_impl ( WP_TransitionSystem  system)
privatevirtual

Implements Nuclide.

References Nuclide_Gen::b_system, and Nuclide::system().

bool has_initialized_system_impl ( ) const
privatevirtual

Implements Nuclide.

References Nuclide::system().

std::vector< WP_Transition > gains ( ) const
inherited

Return a vector of gains producing the nuclide.

Returns
std::vector<WP_Transition> vector of gains.

Referenced by Nuclide_Gen::set_gains_impl().

void get_gains ( std::vector< WP_Transition > &  gains) const
inherited

Get a vector of gains producing the nuclide.

The user vector is overwritten with the contents.

Returns
std::vector<WP_Transition> vector of gains.
void set_gains ( std::vector< WP_Transition gains)
inherited

Set the gains producing the nuclide.

The internal gains are overwritten with the contents.

Parameters
std::vector<WP_Transition>vector of gains.
void append_gain ( WP_Transition  gain)
inherited

Append gain to list of gains.

Parameters
gainto append.
void clear_gains ( )
inherited
Transition::WP gain ( int  channel_id,
int  parent_id 
) const
inherited

retrieve a gain

int num_gains ( ) const
inherited

Get the number of gains producing the nuclide.

Returns
int number of gains.

Referenced by Nuclide_Gen::clear_gains_impl().

std::vector< Channel::SP > losses ( ) const
inherited

Return a vector of losses destroying the nuclide.

Returns
std::vector<Channel::SP> vector of losses.

Referenced by Nuclide_Gen::losses_impl().

void get_losses ( std::vector< SP_Channel > &  losses) const
inherited

Get a vector of losses destroying the nuclide.

The user vector is overwritten with the contents.

Returns
std::vector<Channel::SP> vector of losses.
void set_losses ( std::vector< SP_Channel losses)
inherited

Set the losses destroying the nuclide.

The internal losses are overwritten with the contents.

Returns
std::vector<Channel::SP> vector of losses.
Channel::SP loss ( int  channel_id) const
inherited
void get_loss ( int  channel_id,
SP_Channel loss 
) const
inherited

retrieve loss channel

void set_loss ( SP_Channel  loss)
inherited
Channel::SP add_loss ( SP_ChannelType  channel_type)
inherited

add a new loss channel to the nuclide by specifying ChannelType

Channel::SP add_loss ( int  field_id,
int  reaction_mt,
int  decay_mode = 0 
)
inherited

add a new loss channel by specifying raw ids

Channel::SP add_loss ( SP_Field  field,
int  reaction_mt,
int  decay_mode = 0 
)
inherited

add a new loss channel with Field and raw ids

Channel::SP add_loss ( int  decay_mode)
inherited

add a decay loss

int num_losses ( ) const
inherited

Get the number of losses destroying the nuclide.

Returns
int number of losses.
void get_system ( WP_TransitionSystem system) const
inherited
void set_system ( WP_TransitionSystem  system)
inherited
bool has_initialized_system ( ) const
inherited
int isomeric_state ( ) const
inherited
void get_isomeric_state ( int &  isomeric_state) const
inherited
void set_isomeric_state ( int  isomeric_state)
inherited
void get_species ( SP_Species species) const
inherited
void set_species ( SP_Species  species)
inherited
bool has_initialized_species ( ) const
inherited
double num ( ) const
inherited
void get_num ( double &  num) const
inherited
void set_num ( double  num)
inherited
double decay_constant ( ) const
inherited

Return the decay constant.

This total decay constant is a sum of all channel decay constants.

Returns
double decay constant (1/s)
double loss_xs ( ) const
inherited
void get_name ( std::string &  name) const
inherited
Examples:
tstTransitionSystem_Gen.cpp.

Referenced by TEST().

void set_name ( std::string  name)
inherited
Examples:
tstTransitionSystem_Gen.cpp.

Referenced by TEST().

void get_id ( int &  id) const
inherited
Examples:
tstTransitionSystem_Gen.cpp.

Referenced by TEST().

void set_id ( int  id)
inherited
Examples:
tstTransitionSystem_Gen.cpp.

Referenced by TEST().

std::string to_string ( ) const
inherited
bool good ( ) const
inherited
bool good ( Vec_Str errors) const
inherited
bool is_initialized ( ) const
inherited
Scale::Json::Value to_json ( ) const
inherited

Member Data Documentation

int b_isomeric_state
private
double b_num
private

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