fisx
|
Class containing the composition of a material. More...
#include <fisx_material.h>
Public Member Functions | |
Material () | |
Material (const std::string &materialName, const double &density=1.0, const double &thickness=1.0, const std::string &comment="") | |
void | setName (const std::string &name) |
void | initialize (const std::string &materialName, const double &density=1.0, const double &thickness=1.0, const std::string &comment="") |
void | setComposition (const std::map< std::string, double > &) |
void | setComposition (const std::vector< std::string > &, const std::vector< double > &) |
std::map< std::string, double > | getComposition () const |
std::string | getName () const |
std::string | getComment () const |
double | getDefaultDensity () |
double | getDefaultThickness () |
Class containing the composition of a material.
A material is nothing else than a name and a map of elements and mass fractions.
The default density, default thickness and comment can be supplied for convenience purposes.
fisx::Material::Material | ( | ) |
Minimalist constructor.
fisx::Material::Material | ( | const std::string & | materialName, |
const double & | density = 1.0 , |
||
const double & | thickness = 1.0 , |
||
const std::string & | comment = "" |
||
) |
Expected constructor.
std::map< std::string, double > fisx::Material::getComposition | ( | ) | const |
Return the material composition as normalized mass fractions
void fisx::Material::setComposition | ( | const std::map< std::string, double > & | composition | ) |
Set the composition of the material. This method normalizes the supplied amounts to make sure the sum is one.
void fisx::Material::setComposition | ( | const std::vector< std::string > & | names, |
const std::vector< double > & | amounts | ||
) |
Alternative method to set the composition of the material This method normalizes the supplied amounts to make sure the sum is one.