mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Add accessors for Material.density_ and density_gpcc_
This commit is contained in:
parent
4815cfebac
commit
5d3afc1110
2 changed files with 9 additions and 1 deletions
|
|
@ -65,6 +65,14 @@ public:
|
|||
//! \param[in] density Density of the nuclide in [atom/b-cm]
|
||||
void add_nuclide(const std::string& nuclide, double density);
|
||||
|
||||
//! Get density in [atom/b-cm]
|
||||
//! \return Density in [atom/b-cm]
|
||||
double density() const { return density_; }
|
||||
|
||||
//! Get density in [g/cm^3]
|
||||
//! \return Density in [g/cm^3]
|
||||
double density_gpcc() const { return density_gpcc_; }
|
||||
|
||||
//! Set total density of the material
|
||||
int set_density(double density, std::string units);
|
||||
|
||||
|
|
|
|||
|
|
@ -1216,7 +1216,7 @@ openmc_material_get_density(int32_t index, double* density)
|
|||
{
|
||||
if (index >= 0 && index < model::materials.size()) {
|
||||
auto& mat = model::materials[index];
|
||||
*density = mat->density_gpcc_;
|
||||
*density = mat->density_gpcc();
|
||||
return 0;
|
||||
} else {
|
||||
set_errmsg("Index in materials array is out of bounds.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue