18 #ifndef MATERIALS_MATERIAL_H 19 #define MATERIALS_MATERIAL_H 164 explicit material(
const std::string & name_);
170 explicit material(
const char * name_);
188 const std::string &
get_name()
const;
257 void build(
unsigned int build_flags_ = 0);
278 virtual void tree_dump(std::ostream & out_ = std::clog,
279 const std::string & title_ =
"",
280 const std::string & indent_ =
"",
281 bool inherit_ =
false)
const;
291 void _compute_molar_mass_();
294 void _set_mean_z_(
double);
297 void _set_mean_a_(
double);
300 void _normalize_weights_();
309 double _temperature_;
320 #endif // MATERIALS_MATERIAL_H void set_temperature(double)
Set the temperature of the material.
void reset_compound()
Reset the compound.
double get_weight() const
Return the weight.
void set_state(state_type state_)
Set the state.
void set_density(double)
Set the density of the material.
double get_density() const
Return the density of the material.
bool has_pressure() const
Check if pressure is defined.
bool is_composed_by_mean_z_a() const
Check if the material is composed by mean Z and A.
Proportion by number of atoms.
Definition: material.h:140
void build(unsigned int build_flags_=0)
Build the material : compute molar mass and lock (or not).
build_flag_type
Build flags.
Definition: material.h:149
bool has_weight() const
Check the weight.
const element & get_element() const
Return the compound element.
static state_type label_to_state(const std::string &)
Return state value associated to a label.
bool has_density() const
Check density.
double get_mean_a() const
Return the mean A (atomic mass)
Proportion by fraction of mass.
Definition: material.h:143
void set_material(const material &mat_, bool owned_=false)
Set the material.
static std::string state_to_label(state_type)
Return label associated to a state value.
void add_element_by_mass(const element &elt_ref_, double weight_, bool owned_=false)
Add an element with weight in KP_MASS proportion unit.
~compound_entry()
Destructor.
void set_number_of_atoms(int)
Set the number of atoms.
void unlock()
Unlock the material data structure.
const material & get_material() const
Return the compound material.
state_type get_state() const
Return the state.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Proportion by mean Z, A.
Definition: material.h:144
bool is_valid() const
Check validity.
bool has_temperature() const
Check if temperature is defined.
Undefined.
Definition: material.h:139
bool has_state() const
Check state.
bool is_locked() const
Return true if composition is valid, weights are normalized and molar mass is computed.
std::map< std::string, compound_entry > composition_map_type
Dictionary of material compounds.
Definition: material.h:113
proportion_unit_type
Define the proportion units :
Definition: material.h:138
bool has_material() const
Check for a material compound.
Proportion by number of atoms.
Definition: material.h:141
void set_name(const std::string &)
Set the material name.
const composition_map_type & get_composition() const
Return the composition map.
static double g_per_cm3()
Default density unit.
compound_entry()
Constructor.
Proportion by mean Z, A.
Definition: material.h:145
Liquid.
Definition: material.h:125
void set_element(const element &elt_, bool owned_=false)
Set the element.
void lock()
Lock the material data structure.
Gas.
Definition: material.h:124
Solid.
Definition: material.h:126
datatools::properties & grab_properties()
Get reference of auxiliary properties.
Unknown state.
Definition: material.h:123
const datatools::properties & get_properties() const
Get reference of auxiliary properties.
state_type
State of the material.
Definition: material.h:122
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.
void _set_defaults()
Set default values.
Material compound entry.
Definition: material.h:38
int get_number_of_atoms() const
Return the number of atoms.
void set_weight(double)
Set the weight.
bool has_number_of_atoms() const
Check the number of atoms.
Lock after building.
Definition: material.h:151
Proportion by fraction of mass.
Definition: material.h:142
void add_material_by_mass(const material &mat_ref_, double weight_, bool owned_=false)
Add an material with weight in KP_MASS proportion unit.
double get_pressure() const
Return the pressure of the material.
bool is_composed_by_fraction_mass() const
Check if the material is composed by fraction of mass.
void set_pressure(double)
Set the pressure of the material.
virtual ~material()
Destructor.
const std::string & get_name() const
Return the material name.
material()
Defaut Constructor.
bool has_element() const
Check for a element compound.
bool is_owned() const
Check for an owned compound.
void set_mean_z_a(double z_, double a_)
Set the mean Z and A.
Extract mass excess and mass from tabulated isotopes.
Definition: material.h:150
double get_mean_z() const
Return the mean Z (atomic number)
double get_temperature() const
Return the pressure of the material.
The description of a material.
Definition: material.h:116
The description of an element.
Definition: element.h:93
bool is_composed_by_number_of_atoms() const
Check if the material is composed by number of atoms.
Top-level namespace of the Bayeux/materials module library.
Definition: geom_manager_utils.h:14