21 "Decayer is deprecated in favor of pyne::decayers::decay");
28 std::map<int, double>::const_iterator comp_iter = comp.begin();
29 for (comp_iter = comp.begin(); comp_iter != comp.end(); ++comp_iter) {
30 nuc = comp_iter->first;
32 if (!IsNucTracked(nuc)) {
41 pre_vect_ =
Vector(parent_.size(), 1);
42 for (comp_iter = comp.begin(); comp_iter != comp.end(); ++comp_iter) {
43 nuc = comp_iter->first;
45 col = parent_[nuc].first;
53void Decayer::AddNucToMaps(
int nuc) {
58 std::set<int>::iterator
d;
60 if (IsNucTracked(nuc))
63 col = parent_.size() + 1;
76 daughters_[col] =
dvec;
80bool Decayer::IsNucTracked(
int nuc) {
81 return (
find(nuclides_tracked_.begin(), nuclides_tracked_.end(), nuc)
82 != nuclides_tracked_.end());
86void Decayer::AddNucToList(
int nuc) {
87 if (!IsNucTracked(nuc)) {
88 nuclides_tracked_.push_back(nuc);
96 ParentMap::const_iterator
parent_iter = parent_.begin();
99 int col = parent_.find(nuc)->second.first;
102 if (col <= post_vect_.
NumRows()) {
109 LOG(
LEV_ERROR,
"none!") <<
"Decay Error - invalid Vector position";
116void Decayer::BuildDecayMatrix() {
117 double decay_const = 0;
119 int n = parent_.size();
120 decay_matrix_ =
Matrix(n, n);
122 ParentMap::const_iterator
parent_iter = parent_.begin();
129 if (
static_cast<long double>(
exp(-2903040000 * decay_const)) == 0.0)
131 decay_matrix_(
jcol,
jcol) = -1 * decay_const;
134 if (!daughters_.find(
jcol)->second.empty()) {
137 std::vector< std::pair<int, double> >::const_iterator
141 while (
nuc_iter != daughters_.find(
jcol)->second.end()) {
143 int irow = parent_.find(nuc)->second.first;
144 double branch_ratio =
nuc_iter->second;
145 decay_matrix_(
irow,
jcol) = branch_ratio * decay_const;
157 "should be considered experimental.");
void GetResult(CompMap &comp)
set the composition from a CompMap
Decayer(const CompMap &comp)
void Decay(double secs)
decay the material
Code providing rudimentary logging capability for the Cyclus core.
#define LOG(level, prefix)
allows easy logging via the streaming operator similar to std::cout; this is the primary way to use t...
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
std::map< int, std::pair< int, double > > ParentMap
A map type to represent all of the parent nuclides tracked.
@ LEV_ERROR
Use for errors that require agent code or input file modification (use extremely sparingly)
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
std::map< int, std::vector< std::pair< int, double > > > DaughtersMap
A map type to represent all of the daughter nuclides tracked.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
std::vector< int > NucList
double decay_const(int nuc)
Returns the decay constant for a nuclide nuc.
std::set< int > decay_children(int nuc)
Returns a set of decay children of a nuc.
double branch_ratio(std::pair< int, int > from_to)
Returns the branch ratio for a parent/child nuclide pair.