Add temperatures to statepoints, Material.from_hdf5

Also include material attributes to summary format documentation
This commit is contained in:
Andrew Johnson 2019-07-12 14:17:46 -05:00
parent 05ce0e9f51
commit 60d92f89d2
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
3 changed files with 12 additions and 0 deletions

View file

@ -116,6 +116,13 @@ The current version of the summary file format is 6.0.
- **sab_names** (*char[][]*) -- Names of
S(:math:`\alpha,\beta`) tables assigned to the material.
:Attributes: - **volume** (*double[]*) -- Volume of this material [cm^3]. Only
present if ``volume`` supplied
- **temperature** (*double[]*) -- Temperature of this material [K].
Only present in ``temperature`` supplied
- **depletable** (*int[]*) -- ``1`` if the material can be depleted,
``0`` otherwise. Always present
**/nuclides/**
:Attributes: - **n_nuclides** (*int*) -- Number of nuclides in the problem.

View file

@ -287,6 +287,8 @@ class Material(IDManagerMixin):
material.depletable = bool(group.attrs['depletable'])
if 'volume' in group.attrs:
material.volume = group.attrs['volume']
if "temperature" in group.attrs:
material.temperature = group.attrs["temperature"]
# Read the names of the S(a,b) tables for this Material and add them
if 'sab_names' in group:

View file

@ -898,6 +898,9 @@ void Material::to_hdf5(hid_t group) const
if (volume_ > 0.0) {
write_attribute(material_group, "volume", volume_);
}
if (temperature_ > 0.0) {
write_attribute(material_group, "temperature", temperature_);
}
write_dataset(material_group, "name", name_);
write_dataset(material_group, "atom_density", density_);