mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Writing interpolation attribute as an attribute of the 'y' dataset.
This commit is contained in:
parent
3351918394
commit
8228db6d47
3 changed files with 10 additions and 7 deletions
|
|
@ -108,8 +108,9 @@ The current version of the statepoint file format is 17.0.
|
|||
interpolation. Only used for 'energyfunction' filters.
|
||||
- **y** (*double[]*) -- Interpolant values for energyfunction
|
||||
interpolation. Only used for 'energyfunction' filters.
|
||||
- **interpolation** (*int*) -- Interpolation type. Only used for
|
||||
'energyfunction' filters.
|
||||
|
||||
:Attributes: - **interpolation** (*int*) -- Interpolation type. Only used for
|
||||
'energyfunction' filters.
|
||||
|
||||
**/tallies/derivatives/derivative <id>/**
|
||||
|
||||
|
|
|
|||
|
|
@ -1967,13 +1967,14 @@ class EnergyFunctionFilter(Filter):
|
|||
+ group['type'][()].decode() + " instead")
|
||||
|
||||
energy = group['energy'][()]
|
||||
y = group['y'][()]
|
||||
y_grp = group['y']
|
||||
y = y_grp[()]
|
||||
filter_id = int(group.name.split('/')[-1].lstrip('filter '))
|
||||
|
||||
out = cls(energy, y, filter_id=filter_id)
|
||||
if 'interpolation' in group:
|
||||
if 'interpolation' in y_grp.attrs:
|
||||
out.interpolation = \
|
||||
cls.INTERPOLATION_SCHEMES[group['interpolation'][()]]
|
||||
cls.INTERPOLATION_SCHEMES[y_grp.attrs['interpolation'][()]]
|
||||
|
||||
return out
|
||||
|
||||
|
|
|
|||
|
|
@ -104,8 +104,9 @@ void EnergyFunctionFilter::to_statepoint(hid_t filter_group) const
|
|||
Filter::to_statepoint(filter_group);
|
||||
write_dataset(filter_group, "energy", energy_);
|
||||
write_dataset(filter_group, "y", y_);
|
||||
write_dataset(
|
||||
filter_group, "interpolation", static_cast<int>(interpolation_));
|
||||
hid_t y_dataset = open_dataset(filter_group, "y");
|
||||
write_attribute<int>(y_dataset, "interpolation", static_cast<int>(interpolation_));
|
||||
close_dataset(y_dataset);
|
||||
}
|
||||
|
||||
std::string EnergyFunctionFilter::text_label(int bin) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue