CYCLUS
mat_query.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_TOOLKIT_MAT_QUERY_H_
2 #define CYCLUS_SRC_TOOLKIT_MAT_QUERY_H_
3 
4 #include "comp_math.h"
5 #include "cyc_limits.h"
6 #include "material.h"
7 
8 namespace cyclus {
9 namespace toolkit {
10 
11 /// A class that provides convenience methods for querying a material's properties.
12 class MatQuery {
13  public:
14  /// Creates a new query object inspecting m.
16 
17  /// Returns the mass in kg of the material.
18  double qty();
19 
20  /// Returns the mass in kg of nuclide nuc in the material.
21  double mass(Nuc nuc);
22 
23  /// Returns the mass in kg of nuclide nuc in the material.
24  double mass(std::string nuc);
25 
26  /// Returns the number of moles of nuclide nuc in the material.
27  double moles(Nuc nuc);
28 
29  /// Returns the number of moles of nuclide nuc in the material.
30  double moles(std::string nuc);
31 
32  /// Returns the mass fraction of nuclide nuc in the material.
33  double mass_frac(Nuc nuc);
34 
35  /// Returns the mass fraction of nuclide nuc in the material.
36  double mass_frac(std::string nuc);
37 
38  /// Returns the combined mass fraction of the set of nuclides
39  /// nuc in the material.
40  double mass_frac(std::set<Nuc> nucs);
41 
42  /// returns the atom/mole fraction of nuclide nuc in the material.
43  double atom_frac(Nuc nuc);
44 
45  /// returns the atom/mole fraction of nuclide nuc in the material.
46  double atom_frac(std::string nuc);
47 
48  /// Returns true if all nuclide fractions of the material and other
49  /// are the same within threshold.
50  bool AlmostEq(Material::Ptr other, double threshold = eps_rsrc());
51 
52  /// Returns the maximum mass quantity of composition c that can be extracted
53  /// from the material.
54  double Amount(Composition::Ptr c);
55 
56  private:
57  Material::Ptr m_;
58 };
59 
60 } // namespace toolkit
61 } // namespace cyclus
62 
63 #endif // CYCLUS_SRC_TOOLKIT_MAT_QUERY_H_
double moles(Nuc nuc)
Returns the number of moles of nuclide nuc in the material.
Definition: mat_query.cc:19
boost::shared_ptr< Composition > Ptr
Definition: composition.h:43
MatQuery(Material::Ptr m)
Creates a new query object inspecting m.
Definition: mat_query.cc:9
boost::shared_ptr< Material > Ptr
Definition: material.h:75
double qty()
Returns the mass in kg of the material.
Definition: mat_query.cc:11
double mass_frac(Nuc nuc)
Returns the mass fraction of nuclide nuc in the material.
Definition: mat_query.cc:23
double atom_frac(Nuc nuc)
returns the atom/mole fraction of nuclide nuc in the material.
Definition: mat_query.cc:38
bool AlmostEq(Material::Ptr other, double threshold=eps_rsrc())
Returns true if all nuclide fractions of the material and other are the same within threshold...
Definition: mat_query.cc:60
double eps_rsrc()
an epsilon value to be used by resources
Definition: cyc_limits.h:19
A class that provides convenience methods for querying a material&#39;s properties.
Definition: mat_query.h:12
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
double mass(Nuc nuc)
Returns the mass in kg of nuclide nuc in the material.
Definition: mat_query.cc:15
double Amount(Composition::Ptr c)
Returns the maximum mass quantity of composition c that can be extracted from the material...
Definition: mat_query.cc:68
int Nuc
Definition: composition.h:12