Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
materials::material Class Reference

The description of a material. More...

#include <bayeux/materials/material.h>

Inheritance diagram for materials::material:
datatools::i_tree_dumpable

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_typeget_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::propertiesget_properties () const
 Get reference of auxiliary properties. More...
 
datatools::propertiesgrab_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...
 

Detailed Description

The description of a material.

Member Enumeration Documentation

◆ build_flag_type

Build flags.

Enumerator
BF_MASS_DATA 

Extract mass excess and mass from tabulated isotopes.

BF_LOCK 

Lock after building.

◆ proportion_unit_type

Define the proportion units :

KP_ATOM (number of atoms by molecule) or KP_MASS (% mass)

Enumerator
KP_UNDEFINED 

Undefined.

KP_ATOM 

Proportion by number of atoms.

NUMBER_OF_ATOMS 

Proportion by number of atoms.

KP_MASS 

Proportion by fraction of mass.

FRACTION_MASS 

Proportion by fraction of mass.

KP_ZA 

Proportion by mean Z, A.

MEAN_ZA 

Proportion by mean Z, A.

◆ state_type

State of the material.

Enumerator
STATE_UNKNOWN 

Unknown state.

STATE_GAS 

Gas.

STATE_LIQUID 

Liquid.

STATE_SOLID 

Solid.

Constructor & Destructor Documentation

◆ material() [1/3]

materials::material::material ( )

Defaut Constructor.

◆ material() [2/3]

materials::material::material ( const std::string &  name_)
explicit

Constructor.

Parameters
name_: Name of the material

◆ material() [3/3]

materials::material::material ( const char *  name_)
explicit

Constructor.

Parameters
name_: Name of the material

◆ ~material()

virtual materials::material::~material ( )
virtual

Destructor.

Member Function Documentation

◆ _set_defaults()

void materials::material::_set_defaults ( )
protected

Set default values.

◆ add_element_by_mass() [1/2]

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.

◆ add_element_by_mass() [2/2]

void materials::material::add_element_by_mass ( const element elt_ptr_,
double  weight_ 
)

Add an element with weight in KP_MASS proportion unit.

◆ add_element_by_nb_of_atoms() [1/2]

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.

◆ add_element_by_nb_of_atoms() [2/2]

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.

◆ add_material_by_mass() [1/2]

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.

◆ add_material_by_mass() [2/2]

void materials::material::add_material_by_mass ( const material mat_ptr_,
double  weight_ 
)

Add an element with weight in KP_MASS proportion unit.

◆ build()

void materials::material::build ( unsigned int  build_flags_ = 0)

Build the material : compute molar mass and lock (or not).

◆ g_per_cm3()

static double materials::material::g_per_cm3 ( )
static

Default density unit.

◆ get_composition()

const composition_map_type& materials::material::get_composition ( ) const

Return the composition map.

◆ get_density()

double materials::material::get_density ( ) const

Return the density of the material.

◆ get_mean_a()

double materials::material::get_mean_a ( ) const

Return the mean A (atomic mass)

◆ get_mean_z()

double materials::material::get_mean_z ( ) const

Return the mean Z (atomic number)

◆ get_name()

const std::string& materials::material::get_name ( ) const

Return the material name.

◆ get_pressure()

double materials::material::get_pressure ( ) const

Return the pressure of the material.

◆ get_properties()

const datatools::properties& materials::material::get_properties ( ) const

Get reference of auxiliary properties.

◆ get_state()

state_type materials::material::get_state ( ) const

Return the state.

◆ get_temperature()

double materials::material::get_temperature ( ) const

Return the pressure of the material.

◆ grab_properties()

datatools::properties& materials::material::grab_properties ( )

Get reference of auxiliary properties.

◆ has_density()

bool materials::material::has_density ( ) const

Check density.

◆ has_pressure()

bool materials::material::has_pressure ( ) const

Check if pressure is defined.

◆ has_state()

bool materials::material::has_state ( ) const

Check state.

◆ has_temperature()

bool materials::material::has_temperature ( ) const

Check if temperature is defined.

◆ is_composed_by_fraction_mass()

bool materials::material::is_composed_by_fraction_mass ( ) const

Check if the material is composed by fraction of mass.

◆ is_composed_by_mean_z_a()

bool materials::material::is_composed_by_mean_z_a ( ) const

Check if the material is composed by mean Z and A.

◆ is_composed_by_number_of_atoms()

bool materials::material::is_composed_by_number_of_atoms ( ) const

Check if the material is composed by number of atoms.

◆ is_locked()

bool materials::material::is_locked ( ) const

Return true if composition is valid, weights are normalized and molar mass is computed.

◆ label_to_state()

static state_type materials::material::label_to_state ( const std::string &  )
static

Return state value associated to a label.

◆ lock()

void materials::material::lock ( )

Lock the material data structure.

◆ reset()

void materials::material::reset ( )

Reset.

◆ set_density()

void materials::material::set_density ( double  )

Set the density of the material.

◆ set_mean_z_a()

void materials::material::set_mean_z_a ( double  z_,
double  a_ 
)

Set the mean Z and A.

◆ set_name()

void materials::material::set_name ( const std::string &  )

Set the material name.

◆ set_pressure()

void materials::material::set_pressure ( double  )

Set the pressure of the material.

◆ set_state()

void materials::material::set_state ( state_type  state_)

Set the state.

◆ set_temperature()

void materials::material::set_temperature ( double  )

Set the temperature of the material.

◆ state_to_label()

static std::string materials::material::state_to_label ( state_type  )
static

Return label associated to a state value.

◆ tree_dump()

virtual void materials::material::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

◆ unlock()

void materials::material::unlock ( )

Unlock the material data structure.


The documentation for this class was generated from the following file: