Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The description of an element. More...
#include <bayeux/materials/element.h>
Public Types | |
enum | build_flag_type { BF_NIST_COMPOSITION = 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 | |
element () | |
Defaut Constructor. More... | |
element (const std::string &name_, int z_, unsigned int build_flags_=0) | |
Normal Constructor. More... | |
element (const char *name_, int z_, unsigned int build_flags_=0) | |
Normal Constructor. More... | |
element (const std::string &name_, int z_, double molar_mass_, unsigned int build_flags_=0) | |
Normal Constructor. More... | |
element (const char *name_, int z_, double molar_mass_, unsigned int build_flags_=0) | |
Normal Constructor. More... | |
element (const std::string &name_, const std::string &symbol_="", unsigned int build_flags_=0) | |
Normal Constructor. More... | |
element (const char *name_, const char *symbol_="", unsigned int build_flags_=0) | |
Normal Constructor. More... | |
virtual | ~element () |
Destructor. More... | |
bool | is_built_by_isotopic_composition () const |
Return true if the element is built by isotopic composition. More... | |
void | set_name (const std::string &name_) |
Set the name of the element. More... | |
void | set_z (int z_) |
Set the Z (number of protons) & the chemical symbol of the element. More... | |
void | set_z (const std::string &symbol_) |
Set the Z (number of protons) & the chemical symbol of the element. More... | |
void | set_molar_mass (double molar_mass_) |
Set the molar mass of the element [g/mol]. More... | |
void | add_isotope (const isotope &iso_ref_, double weight_=1.0, bool owned_=false) |
Add an isotope with weight. More... | |
void | add_isotope (const isotope *iso_ptr_, double weight_=1.0) |
Add an isotope with weight. More... | |
void | build (unsigned int build_flags_=0) |
Build the element : norm weights, compute molar mass. More... | |
void | build_from_nist () |
Build the element using NIST composition data, then normalize weights, compute molar mass. More... | |
const std::string & | get_name () const |
Return the name. More... | |
const std::string & | get_symbol () const |
Return the chemical symbol. More... | |
int | get_z () const |
Return the number of protons (Z). More... | |
double | get_molar_mass () const |
Return the molar mass [g/mol]. More... | |
bool | is_locked () const |
Return true if composition is valid, weights are normalized and molar mass is computed. More... | |
void | lock () |
Lock the element data structure. More... | |
void | unlock () |
Unlock the element data structure. More... | |
const isotope_weight_map_type & | get_composition () const |
Return the isotopic composition of the element. 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 Attributes | |
static const int | Z_UNDEFINED = -1 |
Protected Member Functions | |
void | _set_defaults () |
Set default values. More... | |
Additional Inherited Members | |
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_) |
The description of an element.
materials::element::element | ( | ) |
Defaut Constructor.
|
explicit |
Normal Constructor.
name_ | : Name of the element |
z_ | : Z of the element |
build_flags_ | : On the fly building |
|
explicit |
Normal Constructor.
name_ | : Name of the element |
z_ | : Z of the element |
build_flags_ | : On the fly building |
|
explicit |
Normal Constructor.
name_ | : Name of the element |
z_ | : Z of the element |
molar_mass_ | : Molar mass of the element |
build_flags_ | : On the fly building |
|
explicit |
Normal Constructor.
name_ | : Name of the element |
z_ | : Z of the element |
molar_mass_ | : Molar mass of the element |
build_flags_ | : On the fly building |
|
explicit |
Normal Constructor.
name_ | : Name of the element |
symbol_ | : Chemical symbol of the element |
build_flags_ | : On the fly building |
|
explicit |
Normal Constructor.
name_ | : Name of the element |
symbol_ | : Chemical symbol of the element |
build_flags_ | : On the fly building |
|
virtual |
Destructor.
|
protected |
Set default values.
void materials::element::add_isotope | ( | const isotope & | iso_ref_, |
double | weight_ = 1.0 , |
||
bool | owned_ = false |
||
) |
Add an isotope with weight.
void materials::element::add_isotope | ( | const isotope * | iso_ptr_, |
double | weight_ = 1.0 |
||
) |
Add an isotope with weight.
void materials::element::build | ( | unsigned int | build_flags_ = 0 | ) |
Build the element : norm weights, compute molar mass.
void materials::element::build_from_nist | ( | ) |
Build the element using NIST composition data, then normalize weights, compute molar mass.
const isotope_weight_map_type& materials::element::get_composition | ( | ) | const |
Return the isotopic composition of the element.
double materials::element::get_molar_mass | ( | ) | const |
Return the molar mass [g/mol].
const std::string& materials::element::get_name | ( | ) | const |
Return the name.
const datatools::properties& materials::element::get_properties | ( | ) | const |
Get reference of auxiliary properties.
const std::string& materials::element::get_symbol | ( | ) | const |
Return the chemical symbol.
int materials::element::get_z | ( | ) | const |
Return the number of protons (Z).
datatools::properties& materials::element::grab_properties | ( | ) |
Get reference of auxiliary properties.
bool materials::element::is_built_by_isotopic_composition | ( | ) | const |
Return true if the element is built by isotopic composition.
bool materials::element::is_locked | ( | ) | const |
Return true if composition is valid, weights are normalized and molar mass is computed.
void materials::element::lock | ( | ) |
Lock the element data structure.
void materials::element::reset | ( | ) |
Reset.
void materials::element::set_molar_mass | ( | double | molar_mass_ | ) |
Set the molar mass of the element [g/mol].
or
void materials::element::set_name | ( | const std::string & | name_ | ) |
Set the name of the element.
void materials::element::set_z | ( | int | z_ | ) |
Set the Z (number of protons) & the chemical symbol of the element.
void materials::element::set_z | ( | const std::string & | symbol_ | ) |
Set the Z (number of protons) & the chemical symbol of the element.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
void materials::element::unlock | ( | ) |
Unlock the element data structure.
|
static |