Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The description of a material. More...
#include <bayeux/materials/material.h>
Public Types | |
enum | state_type { STATE_UNKNOWN = 0, STATE_GAS = 1, STATE_LIQUID = 2, STATE_SOLID = 3 } |
State of the material. More... | |
enum | proportion_unit_type { KP_UNDEFINED = -1, KP_ATOM = 0, NUMBER_OF_ATOMS = 0, KP_MASS = 1, FRACTION_MASS = 1, KP_ZA = 2, MEAN_ZA = 2 } |
Define the proportion units : More... | |
enum | build_flag_type { BF_MASS_DATA = datatools::bit_mask::bit00, BF_LOCK = datatools::bit_mask::bit31 } |
Build flags. More... | |
Public Types inherited from datatools::i_tree_dumpable | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Public Member Functions | |
material () | |
Defaut Constructor. More... | |
material (const std::string &name_) | |
Constructor. More... | |
material (const char *name_) | |
Constructor. More... | |
virtual | ~material () |
Destructor. More... | |
bool | is_composed_by_mean_z_a () const |
Check if the material is composed by mean Z and A. More... | |
bool | is_composed_by_number_of_atoms () const |
Check if the material is composed by number of atoms. More... | |
bool | is_composed_by_fraction_mass () const |
Check if the material is composed by fraction of mass. More... | |
const composition_map_type & | get_composition () const |
Return the composition map. More... | |
const std::string & | get_name () const |
Return the material name. More... | |
void | set_name (const std::string &) |
Set the material name. More... | |
double | get_mean_z () const |
Return the mean Z (atomic number) More... | |
double | get_mean_a () const |
Return the mean A (atomic mass) More... | |
void | set_mean_z_a (double z_, double a_) |
Set the mean Z and A. More... | |
bool | has_state () const |
Check state. More... | |
void | set_state (state_type state_) |
Set the state. More... | |
state_type | get_state () const |
Return the state. More... | |
bool | has_density () const |
Check density. More... | |
double | get_density () const |
Return the density of the material. More... | |
void | set_density (double) |
Set the density of the material. More... | |
bool | has_pressure () const |
Check if pressure is defined. More... | |
void | set_pressure (double) |
Set the pressure of the material. More... | |
double | get_pressure () const |
Return the pressure of the material. More... | |
bool | has_temperature () const |
Check if temperature is defined. More... | |
void | set_temperature (double) |
Set the temperature of the material. More... | |
double | get_temperature () const |
Return the pressure of the material. More... | |
void | add_element_by_mass (const element &elt_ref_, double weight_, bool owned_=false) |
Add an element with weight in KP_MASS proportion unit. More... | |
void | add_element_by_mass (const element *elt_ptr_, double weight_) |
Add an element with weight in KP_MASS proportion unit. More... | |
void | add_element_by_nb_of_atoms (const element &elt_ref_, int nb_of_atoms_, bool owned_=false) |
Add an element in KP_ATOM proportion unit. More... | |
void | add_element_by_nb_of_atoms (const element *elt_ptr_, int nb_of_atoms_) |
Add an element in KP_ATOM proportion unit. More... | |
void | add_material_by_mass (const material &mat_ref_, double weight_, bool owned_=false) |
Add an material with weight in KP_MASS proportion unit. More... | |
void | add_material_by_mass (const material *mat_ptr_, double weight_) |
Add an element with weight in KP_MASS proportion unit. More... | |
void | build (unsigned int build_flags_=0) |
Build the material : compute molar mass and lock (or not). More... | |
bool | is_locked () const |
Return true if composition is valid, weights are normalized and molar mass is computed. More... | |
void | lock () |
Lock the material data structure. More... | |
void | unlock () |
Unlock the material data structure. More... | |
const datatools::properties & | get_properties () const |
Get reference of auxiliary properties. More... | |
datatools::properties & | grab_properties () |
Get reference of auxiliary properties. More... | |
void | reset () |
Reset. More... | |
virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Smart print. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
i_tree_dumpable () | |
Constructor. More... | |
virtual | ~i_tree_dumpable () |
Destructor. More... | |
virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
Main new interface method for printing. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
Printing with jsonized options. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
Printing with jsonized options. More... | |
void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Static Public Member Functions | |
static std::string | state_to_label (state_type) |
Return label associated to a state value. More... | |
static state_type | label_to_state (const std::string &) |
Return state value associated to a label. More... | |
static double | g_per_cm3 () |
Default density unit. More... | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
static const boost::property_tree::ptree & | empty_options () |
static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
static std::ostream & | last_skip_tag (std::ostream &out_) |
static std::ostream & | skip_tag (std::ostream &out_) |
static std::ostream & | last_tag (std::ostream &out_) |
static std::ostream & | tag (std::ostream &out_) |
Protected Member Functions | |
void | _set_defaults () |
Set default values. More... | |
The description of a material.
Define the proportion units :
KP_ATOM (number of atoms by molecule) or KP_MASS (% mass)
materials::material::material | ( | ) |
Defaut Constructor.
|
explicit |
Constructor.
name_ | : Name of the material |
|
explicit |
Constructor.
name_ | : Name of the material |
|
virtual |
Destructor.
|
protected |
Set default values.
void materials::material::add_element_by_mass | ( | const element & | elt_ref_, |
double | weight_, | ||
bool | owned_ = false |
||
) |
Add an element with weight in KP_MASS proportion unit.
void materials::material::add_element_by_mass | ( | const element * | elt_ptr_, |
double | weight_ | ||
) |
Add an element with weight in KP_MASS proportion unit.
void materials::material::add_element_by_nb_of_atoms | ( | const element & | elt_ref_, |
int | nb_of_atoms_, | ||
bool | owned_ = false |
||
) |
Add an element in KP_ATOM proportion unit.
void materials::material::add_element_by_nb_of_atoms | ( | const element * | elt_ptr_, |
int | nb_of_atoms_ | ||
) |
Add an element in KP_ATOM proportion unit.
void materials::material::add_material_by_mass | ( | const material & | mat_ref_, |
double | weight_, | ||
bool | owned_ = false |
||
) |
Add an material with weight in KP_MASS proportion unit.
void materials::material::add_material_by_mass | ( | const material * | mat_ptr_, |
double | weight_ | ||
) |
Add an element with weight in KP_MASS proportion unit.
void materials::material::build | ( | unsigned int | build_flags_ = 0 | ) |
Build the material : compute molar mass and lock (or not).
|
static |
Default density unit.
const composition_map_type& materials::material::get_composition | ( | ) | const |
Return the composition map.
double materials::material::get_density | ( | ) | const |
Return the density of the material.
double materials::material::get_mean_a | ( | ) | const |
Return the mean A (atomic mass)
double materials::material::get_mean_z | ( | ) | const |
Return the mean Z (atomic number)
const std::string& materials::material::get_name | ( | ) | const |
Return the material name.
double materials::material::get_pressure | ( | ) | const |
Return the pressure of the material.
const datatools::properties& materials::material::get_properties | ( | ) | const |
Get reference of auxiliary properties.
state_type materials::material::get_state | ( | ) | const |
Return the state.
double materials::material::get_temperature | ( | ) | const |
Return the pressure of the material.
datatools::properties& materials::material::grab_properties | ( | ) |
Get reference of auxiliary properties.
bool materials::material::has_density | ( | ) | const |
Check density.
bool materials::material::has_pressure | ( | ) | const |
Check if pressure is defined.
bool materials::material::has_state | ( | ) | const |
Check state.
bool materials::material::has_temperature | ( | ) | const |
Check if temperature is defined.
bool materials::material::is_composed_by_fraction_mass | ( | ) | const |
Check if the material is composed by fraction of mass.
bool materials::material::is_composed_by_mean_z_a | ( | ) | const |
Check if the material is composed by mean Z and A.
bool materials::material::is_composed_by_number_of_atoms | ( | ) | const |
Check if the material is composed by number of atoms.
bool materials::material::is_locked | ( | ) | const |
Return true if composition is valid, weights are normalized and molar mass is computed.
|
static |
Return state value associated to a label.
void materials::material::lock | ( | ) |
Lock the material data structure.
void materials::material::reset | ( | ) |
Reset.
void materials::material::set_density | ( | double | ) |
Set the density of the material.
void materials::material::set_mean_z_a | ( | double | z_, |
double | a_ | ||
) |
Set the mean Z and A.
void materials::material::set_name | ( | const std::string & | ) |
Set the material name.
void materials::material::set_pressure | ( | double | ) |
Set the pressure of the material.
void materials::material::set_state | ( | state_type | state_ | ) |
Set the state.
void materials::material::set_temperature | ( | double | ) |
Set the temperature of the material.
|
static |
Return label associated to a state value.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
void materials::material::unlock | ( | ) |
Unlock the material data structure.