19 #ifndef MATERIALS_ELEMENT_H 20 #define MATERIALS_ELEMENT_H 1 114 explicit element(
const std::string & name_,
int z_,
unsigned int build_flags_ = 0);
122 explicit element(
const char * name_,
int z_,
unsigned int build_flags_ = 0);
131 explicit element(
const std::string & name_,
int z_,
double molar_mass_,
unsigned int build_flags_ = 0);
140 explicit element(
const char * name_,
int z_,
double molar_mass_,
unsigned int build_flags_ = 0);
148 explicit element(
const std::string & name_,
const std::string & symbol_ =
"",
unsigned int build_flags_ = 0);
156 explicit element(
const char * name_,
const char * symbol_ =
"",
unsigned int build_flags_ = 0);
165 void set_name(
const std::string & name_);
171 void set_z(
const std::string & symbol_);
189 void add_isotope(
const isotope & iso_ref_ ,
double weight_ = 1.0,
bool owned_ =
false);
195 void build(
unsigned int build_flags_ = 0);
201 const std::string &
get_name()
const;
242 virtual void tree_dump(std::ostream & out_ = std::clog,
243 const std::string & title_ =
"",
244 const std::string & indent_ =
"",
245 bool inherit_ =
false)
const;
255 void _norm_weights_();
258 void _compute_molar_mass_();
261 void _set_molar_mass_(
double molar_mass_);
267 std::string _symbol_;
277 #endif // MATERIALS_ELEMENT_H void build(unsigned int build_flags_=0)
Build the element : norm weights, compute molar mass.
void reset_iso()
Reset the compound isotope.
bool is_valid() const
Check validity.
const std::string & get_symbol() const
Return the chemical symbol.
bool is_owned() const
Check for an owned compound.
bool is_locked() const
Return true if composition is valid, weights are normalized and molar mass is computed.
const isotope & get_isotope() const
Return the compound isotope.
const std::string & get_name() const
Return the name.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void unlock()
Unlock the element data structure.
void build_from_nist()
Build the element using NIST composition data, then normalize weights, compute molar mass.
const datatools::properties & get_properties() const
Get reference of auxiliary properties.
element()
Defaut Constructor.
double get_weight() const
Return the weight.
Build from the NIST table.
Definition: element.h:101
const isotope_weight_map_type & get_composition() const
Return the isotopic composition of the element.
void set_weight(double)
Set the weight.
bool has_weight() const
Check the weight.
void set_z(int z_)
Set the Z (number of protons) & the chemical symbol of the element.
std::map< std::string, iso_entry > isotope_weight_map_type
Dictionary of isotope composition entries.
Definition: element.h:90
bool is_built_by_isotopic_composition() const
Return true if the element is built by isotopic composition.
void _set_defaults()
Set default values.
void set_name(const std::string &name_)
Set the name of the element.
static const int Z_UNDEFINED
Definition: element.h:97
A simple class to handle known isotopes (ZAI) and their basic properties (mass & decays).
Definition: isotope.h:60
double get_molar_mass() const
Return the molar mass [g/mol].
datatools::properties & grab_properties()
Get reference of auxiliary properties.
void add_isotope(const isotope &iso_ref_, double weight_=1.0, bool owned_=false)
Add an isotope with weight.
Lock after building.
Definition: element.h:102
void lock()
Lock the element data structure.
void set_molar_mass(double molar_mass_)
Set the molar mass of the element [g/mol].
bool has_isotope() const
Check for an isotope compound.
Isotope composition entry.
Definition: element.h:38
build_flag_type
Build flags.
Definition: element.h:100
virtual ~element()
Destructor.
int get_z() const
Return the number of protons (Z).
The description of an element.
Definition: element.h:93
void set_isotope(const isotope &iso_, bool owned_=false)
Set the isotope.
Top-level namespace of the Bayeux/materials module library.
Definition: geom_manager_utils.h:14