#include <StateSet.h>

Public Types

typedef std::shared_ptr< StateSetSP
 StateSet smart pointer typedef. More...
 
typedef std::shared_ptr< const StateSetSCP
 StateSet constant smart pointer typedef. More...
 

Public Member Functions

 StateSet ()
 Default constructor. More...
 
bool operator== (const StateSet &a) const
 Test for equality. More...
 
bool has_states () const
 Get whether the StateSet has states. More...
 
size_t states_size () const
 Get number of states. More...
 
const Statestates_at (size_t) const
 Create a shallow copy of a State at a given index. More...
 
SCP_State scp_states_at (size_t) const
 Get a shared pointer to a State at a given index. More...
 
bool has_states_at (size_t) const
 Get whether the StateSet has a particular state. More...
 
void getptr_states_at (const State *&, size_t) const
 Get a raw pointer to a state. More...
 
void resize_states (size_t)
 Resize the states list. More...
 
void get_states_at (State &, size_t) const
 Get a state at an index. More...
 
void set_states_at (const State &, size_t)
 Set a state at an index. More...
 
void add_states (const State &)
 Add a state to the end. More...
 
void delete_states_at (size_t)
 Delete a state and shift elements. More...
 
void manageptr_states_at (State *&, size_t)
 Manage a new raw pointer as a shared pointer. More...
 
const Statestates_back () const
 Return the last/back element. More...
 
const Statestates_front () const
 Return the first/front element. More...
 
SCP_DecayResource decay_resource () const
 return shared (read-only) decay_resource resource \ More...
 
bool has_decay_resource () const
 whether this instantiation of class has the decay_resource resource \ More...
 
void set_decay_resource (SCP_DecayResource)
 set a new shared (read-only) decay_resource resource (non-const version) \ More...
 
Vec_Pair_NSpectra neutron_spectra () const
 Return the neutron spectra. More...
 
Vec_Pair_ASpectra alpha_spectra () const
 Return the alpha spectra. More...
 
Vec_Pair_BSpectra beta_spectra () const
 Return the beta spectra. More...
 
Vec_Pair_GSpectra gamma_spectra () const
 Return the gamma spectra. More...
 
Vec_Pair_Concs concs () const
 Return all concentrations. More...
 
Vec_Pair_Concs concs (const Concentrations &filter) const
 Return all concentrations for a set of nuclide. More...
 
Vec_Dbl burnups () const
 Return each burnup on the StateSet. More...
 
Vec_Dbl energies () const
 Return each energy-released on the StateSet. More...
 
Vec_Dbl times () const
 Return each time on the StateSet. More...
 
Vec_Dbl powers () const
 Return each power on the StateSet. More...
 
Vec_Dbl fluxes () const
 Return each flux on the StateSet. More...
 
SP_StateInfo interpolate_info (float time, int case_number) const
 Interpolate headers to a given time (cheap) More...
 
SP_State interpolate (float time, int case_number) const
 Interpolate States to a given time (expensive) More...
 
std::vector< size_t > matching_states (int case_number) const
 Find all States matching a case number. More...
 
size_t nearest_time (float time, const std::vector< size_t > &matches) const
 Find State closest to the given time. More...
 
int guessNumSteps () const
 
std::string to_string () const
 
Scale::Json::Value to_json () const
 
template<>
std::vector< GridView_StateInfocreate_interp_viewers (const std::vector< size_t > &matches) const
 Create an interpolation viewer (GridView_StateInfo) of the headers from a match set of States. More...
 
template<>
std::vector< GridView_Statecreate_interp_viewers (const std::vector< size_t > &matches) const
 Create an interpolation viewer from a match set of States. More...
 

Protected Member Functions

void canonicalize_states_at (size_t)
 
bool check_headers ()
 Check for self-consistency of all headers on this StateSet. More...
 
SP_State interpolate_internal (float time, int case_number, bool info_only) const
 Interpolate a StateSet to a given time & optionally generate a new interpolated State. More...
 
std::vector< float > create_interp_times (const std::vector< size_t > &viewer_list) const
 Create a set of reference times as grid points for interpolation, based on a selected set of States (matches) More...
 
template<typename T >
std::vector< Tcreate_interp_viewers (const std::vector< size_t > &matches) const
 
template<typename T >
T::GD_t::Vec_Rptr create_interp_responses (const std::vector< T > &viewer_list) const
 Create a set of interpolated responses from a viewer list. More...
 
template<typename View >
View::Type::SP interpolate_view (float time, const std::vector< float > &times, const std::vector< View > &viewer_list, const View &prototype) const
 Generate an interpolation view of the StateSet by mapping a set of States onto GridData;. More...
 

Protected Attributes

SP_Vec_SP_State b_states
 
SCP_DecayResource r_decay_resource
 

Detailed Description

Stores a set of calculation states.

Author
William A. Wieselquist
Examples:
tstGridView.cpp, tstState.cpp, tstStateSet.cpp, and tstStateSetIO.cpp.

Member Typedef Documentation

typedef std::shared_ptr<StateSet> SP

StateSet smart pointer typedef.

typedef std::shared_ptr<const StateSet> SCP

StateSet constant smart pointer typedef.

Constructor & Destructor Documentation

StateSet ( )

Default constructor.

Member Function Documentation

bool operator== ( const StateSet a) const

Test for equality.

Test for equality with this State.

References StateSet::b_states, and StateSet::states_size().

bool has_states ( ) const

Get whether the StateSet has states.

has a non-null states vector

const State & states_at ( size_t  i) const
SCP_State scp_states_at ( size_t  i) const

Get a shared pointer to a State at a given index.

return a const std::shared_ptr for read-only access

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

Examples:
tstGridView.cpp, and tstStateSet.cpp.

Referenced by StateSet::create_interp_times(), StateSet::create_interp_viewers(), Origen::printConcentrations_csv(), Origen::printStateInfo(), Origen::printTags_json(), TEST(), and timing_smart_pointer().

bool has_states_at ( size_t  i) const

Get whether the StateSet has a particular state.

has a non-null element of states vector

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

void getptr_states_at ( const State *&  ,
size_t   
) const

Get a raw pointer to a state.

get a read-only pointer by index

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

void resize_states ( size_t  n)

Resize the states list.

resize the vector

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

void get_states_at ( State element,
size_t  i 
) const

Get a state at an index.

get a copy of the element in-place

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

void set_states_at ( const State element,
size_t  i 
)

Set a state at an index.

set a new element by index

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

Examples:
tstGridView.cpp.

Referenced by TEST().

void add_states ( const State element)

Add a state to the end.

add a new element to the end

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

Examples:
tstGridView.cpp, tstStateSet.cpp, and tstStateSetIO.cpp.

Referenced by StateSetIO_bof::read(), StateSetIO_s61::read(), StateSetIO_s62b::read(), FakeFactory::StateSet_random1(), TEST(), and TEST_F().

void delete_states_at ( size_t  i)

Delete a state and shift elements.

delete an element

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

void manageptr_states_at ( State *&  element,
size_t  i 
)

Manage a new raw pointer as a shared pointer.

manage an existing pointer in this class

Auto-generated from macro \ * #ORIGEN_ACCESSORS_SP_VECTOR_WITH_MANAGEMENT().

const State & states_back ( ) const

Return the last/back element.

References StateSet::b_states.

const State & states_front ( ) const

Return the first/front element.

SCP_DecayResource decay_resource ( ) const

return shared (read-only) decay_resource resource \

Auto-generated from macro \ #ORIGEN_ACCESSORS_SCP_RESOURCE().

bool has_decay_resource ( ) const

whether this instantiation of class has the decay_resource resource \

Auto-generated from macro #ORIGEN_ACCESSORS_SCP_RESOURCE().

void set_decay_resource ( SCP_DecayResource  decay_resource)

set a new shared (read-only) decay_resource resource (non-const version) \

Auto-generated from macro #ORIGEN_ACCESSORS_SCP_RESOURCE().

Vec_Pair_NSpectra neutron_spectra ( ) const

Return the neutron spectra.

Return the neutron spectra for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), State::scp_neutron_spectra(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Referenced by TEST().

Vec_Pair_ASpectra alpha_spectra ( ) const

Return the alpha spectra.

Return the alpha spectra for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), State::scp_alpha_spectra(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Referenced by TEST().

Vec_Pair_BSpectra beta_spectra ( ) const

Return the beta spectra.

Return the beta spectra for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), State::scp_beta_spectra(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Referenced by TEST().

Vec_Pair_GSpectra gamma_spectra ( ) const

Return the gamma spectra.

Return the gamma spectra for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), State::scp_gamma_spectra(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Referenced by TEST().

Vec_Pair_Concs concs ( ) const

Return all concentrations.

Return concentrations for for every State in StateSet.

Returns
Concentrations at each state
Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), State::scp_concs(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Referenced by TEST().

Vec_Pair_Concs concs ( const Concentrations filter) const

Return all concentrations for a set of nuclide.

Return filtered concentrations.

Parameters
Concentrationsobject with a NuclideSet and units used to filter what is returned
Returns
Concentrations at each state

References State::definition(), StateInfo::energy(), State::scp_concs(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

Vec_Dbl burnups ( ) const

Return each burnup on the StateSet.

Return the (deprecated) burnups for each State on the StateSet.

References StateSet::energies().

Vec_Dbl energies ( ) const

Return each energy-released on the StateSet.

Return the energies for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::energy(), StateSet::states_at(), and StateSet::states_size().

Referenced by StateSet::burnups(), Obiwan_diff::diff(), and TEST().

Vec_Dbl powers ( ) const

Return each power on the StateSet.

Return the sub-cycle irradiation power for each State on the StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::power(), StateSet::states_at(), and StateSet::states_size().

Referenced by Obiwan_diff::diff(), and TEST().

Vec_Dbl fluxes ( ) const

Return each flux on the StateSet.

Return the sub-cycle flux for each State on StateSet.

Examples:
tstStateSet.cpp.

References State::definition(), StateInfo::flux(), StateSet::states_at(), and StateSet::states_size().

Referenced by Obiwan_diff::diff(), and TEST().

SP_StateInfo interpolate_info ( float  time,
int  case_number 
) const

Interpolate headers to a given time (cheap)

Examples:
tstGridView.cpp.

References StateSet::interpolate_internal().

Referenced by TEST().

SP_State interpolate ( float  time,
int  case_number 
) const

Interpolate States to a given time (expensive)

Interpolate states to a given time (expensive)

Examples:
tstStateSet.cpp.

References StateSet::interpolate_internal().

Referenced by TEST().

std::vector< size_t > matching_states ( int  case_number) const

Find all States matching a case number.

Returns the index(es) of all states matching the requested case number.

Parameters
case_numberCase number to search on
Returns
Vector of case indexes with a case number matching the requested case number; empty vector if no matches found

References StateSet::b_states, StateInfo::case_number(), and Origen::info().

Referenced by StateSet::interpolate_internal().

size_t nearest_time ( float  time,
const std::vector< size_t > &  matches 
) const

Find State closest to the given time.

Find the State closest to the time value provided.

Parameters
timeTime (in seconds) to search on
matchesIndex numbers of States on StateSet to check for promixity to the given time
Returns
Index of the nearest State to the given time; -1 if no indices to match on are provided (invalid input)

References StateSet::b_states, Origen::info(), and StateInfo::time().

Referenced by StateSet::interpolate_internal().

int guessNumSteps ( ) const

References StateSet::times().

std::string to_string ( ) const

References StateSet::to_json().

Json::Value to_json ( ) const

References StateSet::b_states.

Referenced by StateSet::to_string().

void canonicalize_states_at ( size_t  i)
protected
bool check_headers ( )
protected

Check for self-consistency of all headers on this StateSet.

Checks that all header parameters (i.e., total number of nuclides, number of light elements / actinides / fission products) are equal

Also checks for monotonicity in time / burnup values

References State::definition(), StateInfo::energy(), State::num_alpha_groups(), State::num_beta_groups(), State::num_gamma_groups(), State::num_neutron_groups(), StateSet::states_at(), StateSet::states_size(), and StateInfo::time().

SP_State interpolate_internal ( float  time,
int  case_number,
bool  info_only 
) const
protected

Interpolate a StateSet to a given time & optionally generate a new interpolated State.

Parameters
info_onlyTrue: Only get the interpolated headers (don't generate an interpolated State - cheap) False: Generate a new interpolated State (expensive)

References StateSet::create_interp_times(), Origen::info(), StateSet::matching_states(), StateSet::nearest_time(), and StateSet::times().

Referenced by StateSet::interpolate(), and StateSet::interpolate_info().

std::vector< float > create_interp_times ( const std::vector< size_t > &  viewer_list) const
protected

Create a set of reference times as grid points for interpolation, based on a selected set of States (matches)

References Origen::info(), StateSet::scp_states_at(), and StateSet::times().

Referenced by StateSet::interpolate_internal().

std::vector<T> create_interp_viewers ( const std::vector< size_t > &  matches) const
protected
T::GD_t::Vec_Rptr create_interp_responses ( const std::vector< T > &  viewer_list) const
protected

Create a set of interpolated responses from a viewer list.

References kernel_rksuite::f(), and r.

Referenced by StateSet::interpolate_view().

View::Type::SP interpolate_view ( float  time,
const std::vector< float > &  times,
const std::vector< View > &  viewer_list,
const View &  prototype 
) const
protected

Generate an interpolation view of the StateSet by mapping a set of States onto GridData;.

Remarks
Grid extents defined by times (interpolated on time)

References StateSet::create_interp_responses().

std::vector<GridView_StateInfo> create_interp_viewers ( const std::vector< size_t > &  matches) const
inline

Create an interpolation viewer (GridView_StateInfo) of the headers from a match set of States.

This method translates StateInfo objects (headers for State) into a set of GridView extents, which can then be used for ND interpolation operations

References Origen::info(), and StateSet::scp_states_at().

std::vector<GridView_State> create_interp_viewers ( const std::vector< size_t > &  matches) const
inline

Create an interpolation viewer from a match set of States.

This method translates State objects into a set of GridView extents, which can then be used for ND interpolation operations

Here, interpolation would be of concentrations & spectra (as responses) on a time dimension (i.e., time mapped onto extents)

References StateSet::scp_states_at().

Member Data Documentation

SCP_DecayResource r_decay_resource
protected

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