##

MaterialDensity Class Reference

Encapsulates density types. More...

`#include <MaterialDensity.hh>`

## Static Public Member Functions

static double | Density (const MaterialType _material)
| Return the density of a material. More...
static double | Density (const std::string &_material)
| Return the density of the given material name, or -1 if the material is not found. More...
static const std::map< MaterialType, double > & | Materials ()
| Accessor for retrieving density entries. More...
static std::tuple< MaterialType, double > | Nearest (const double _value, const double _epsilon=ignition::math::MAX_D)
| Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found. More...
static MaterialType | NearestMaterial (const double _value, const double _epsilon=ignition::math::MAX_D)
| Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found. More...

## Detailed Description

Encapsulates density types.

## Member Function Documentation

## Density() [1/2]

static double Density | ( | const MaterialType | _material | ) |

static

Return the density of a material.

Parameters

  [in] | _material | Type of the material, See MaterialType.

Returns
  Matching density if found, otherwise -1.

## Density() [2/2]

static double Density | ( | const std::string & | _material | ) |

static

Return the density of the given material name, or -1 if the material is not found.

Parameters

  [in] | _material | Name of the material, See MaterialType.

Returns
  Matching density if found, otherwise -1.

## Materials()

static const std::map<MaterialType, double>& Materials | ( |  | ) |

static

Accessor for retrieving density entries.

Returns
  List of entries.

## Nearest()

static std::tuple<MaterialType, double> Nearest | ( | const double | _value,
|  | const double | _epsilon = `ignition::math::MAX_D`
| ) |  |

static

Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found.

Parameters

  [in] | _value | Density value of entry to match.
  [in] | _epsilon | Allowable range of difference between _value, and a material's density.

Returns
  A tuple where the first element is the MaterialType, and the second the density. A value of {MATERIAL_TYPE_END, -1} is returned on error.

## NearestMaterial()

static MaterialType NearestMaterial | ( | const double | _value,
|  | const double | _epsilon = `ignition::math::MAX_D`
| ) |  |

static

Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found.

Parameters

  [in] | _value | Density value of entry to match.
  [in] | _epsilon | Allowable range of difference between _value, and a material's density.

Returns
  The nearest material type. MATERIAL_TYPE_END on error.

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

- MaterialDensity.hh