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