CYCLUS
Loading...
Searching...
No Matches
decayer.h
Go to the documentation of this file.
1#ifndef CYCLUS_SRC_DECAYER_H_
2#define CYCLUS_SRC_DECAYER_H_
3
4#include <map>
5#include <set>
6
7#include "composition.h"
8#include "error.h"
9#include "pyne.h"
10#include "use_matrix_lib.h"
11
12// Undefines isnan from pyne
13#ifdef isnan
14#undef isnan
15#endif
16
17namespace cyclus {
18
19/// A map type to represent all of the parent nuclides tracked. The key
20/// for this map type is the parent's Nuc number, and the value is a pair
21/// that contains the corresponding decay matrix column and decay
22/// constant associated with that parent.
23typedef std::map<int, std::pair<int, double>> ParentMap;
24
25/// A map type to represent all of the daughter nuclides tracked. The
26/// key for this map type is the decay matrix column associated with the
27/// parent, and the value is a vector of pairs of all the daughters for
28/// that parent. Each of the daughters are represented by a pair that
29/// contains the daughter's Nuc number and its branching ratio.
30typedef std::map<int, std::vector<std::pair<int, double>>> DaughtersMap;
31
32typedef std::vector<int> NucList;
33
34/// Decayer is DEPRECATED. Use pyne::decayers::decay.
35class Decayer {
36 public:
37 Decayer(const CompMap& comp);
38
39 ~Decayer();
40
41 /// set the composition from a CompMap
42 void GetResult(CompMap& comp);
43
44 /// decay the material
45 /// @param secs the number of seconds to decay
46 void Decay(double secs);
47
48 /// the number of tracked nuclides
49 int n_tracked_nuclides() { return nuclides_tracked_.size(); }
50
51 /// the tracked nuclide at position i
52 int TrackedNuclide(int i) { return nuclides_tracked_.at(i); }
53
54 private:
55 /// Builds the decay matrix needed for the decay calculations from
56 /// the parent and daughters map variables. The resulting matrix is
57 /// stored in the static variable decayMatrix.
58 static void BuildDecayMatrix();
59
60 /// The CompMap's parent
61 static ParentMap parent_;
62
63 /// The CompMap's daughters
64 static DaughtersMap daughters_;
65
66 /// The decay matrix
67 static Matrix decay_matrix_;
68
69 /// The atomic composition map
70 Vector pre_vect_;
71 Vector post_vect_;
72
73 /// the list of tracked nuclides
74 static NucList nuclides_tracked_;
75
76 /// Add the nuclide to the parent/daughter maps IFF it is not in the tracked
77 /// list.
78 static void AddNucToMaps(int nuc);
79
80 /// Add the nuclide to our list of tracked nuclides IFF it is not in the list.
81 static void AddNucToList(int nuc);
82
83 /// Checks if the nuclide is tracked
84 static bool IsNucTracked(int nuc);
85};
86
87} // namespace cyclus
88
89#endif // CYCLUS_SRC_DECAYER_H_
int TrackedNuclide(int i)
the tracked nuclide at position i
Definition decayer.h:52
void GetResult(CompMap &comp)
set the composition from a CompMap
Definition decayer.cc:91
Decayer(const CompMap &comp)
Definition decayer.cc:19
void Decay(double secs)
decay the material
Definition decayer.cc:154
int n_tracked_nuclides()
the number of tracked nuclides
Definition decayer.h:49
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
Definition composition.h:17
std::map< int, std::vector< std::pair< int, double > > > DaughtersMap
A map type to represent all of the daughter nuclides tracked.
Definition decayer.h:30
LMatrix Matrix
std::map< int, std::pair< int, double > > ParentMap
A map type to represent all of the parent nuclides tracked.
Definition decayer.h:23
LMatrix Vector
std::vector< int > NucList
Definition decayer.h:32