CYCLUS
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 
17 namespace 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.
23 typedef 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.
30 typedef std::map<int, std::vector<std::pair<int, double> > > DaughtersMap;
31 
32 typedef std::vector<int> NucList;
33 
34 /// Decayer is DEPRECATED. Use pyne::decayers::decay.
35 class 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
50  return nuclides_tracked_.size();
51  }
52 
53  /// the tracked nuclide at position i
54  int TrackedNuclide(int i) {
55  return nuclides_tracked_.at(i);
56  }
57 
58  private:
59  /// Builds the decay matrix needed for the decay calculations from
60  /// the parent and daughters map variables. The resulting matrix is
61  /// stored in the static variable decayMatrix.
62  static void BuildDecayMatrix();
63 
64  /// The CompMap's parent
65  static ParentMap parent_;
66 
67  /// The CompMap's daughters
68  static DaughtersMap daughters_;
69 
70  /// The decay matrix
71  static Matrix decay_matrix_;
72 
73  /// The atomic composition map
74  Vector pre_vect_;
75  Vector post_vect_;
76 
77  /// the list of tracked nuclides
78  static NucList nuclides_tracked_;
79 
80  /// Add the nuclide to the parent/daughter maps IFF it is not in the tracked list.
81  static void AddNucToMaps(int nuc);
82 
83  /// Add the nuclide to our list of tracked nuclides IFF it is not in the list.
84  static void AddNucToList(int nuc);
85 
86  /// Checks if the nuclide is tracked
87  static bool IsNucTracked(int nuc);
88 };
89 
90 } // namespace cyclus
91 
92 #endif // CYCLUS_SRC_DECAYER_H_
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
int n_tracked_nuclides()
the number of tracked nuclides
Definition: decayer.h:49
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
Definition: composition.h:17
void Decay(double secs)
decay the material
Definition: decayer.cc:155
void GetResult(CompMap &comp)
set the composition from a CompMap
Definition: decayer.cc:93
Decayer(const CompMap &comp)
Definition: decayer.cc:19
Decayer is DEPRECATED. Use pyne::decayers::decay.
Definition: decayer.h:35
std::map< int, std::pair< int, double > > ParentMap
A map type to represent all of the parent nuclides tracked.
Definition: decayer.h:23
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
std::vector< int > NucList
Definition: decayer.h:32
int TrackedNuclide(int i)
the tracked nuclide at position i
Definition: decayer.h:54