mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Seem to be able to read the new hdf5 files and run at least an example problem (!!!!)
This commit is contained in:
parent
63b3c6dbd0
commit
8fbd41eaf4
8 changed files with 61 additions and 78 deletions
|
|
@ -399,7 +399,9 @@ class IncidentNeutron(EqualityMixin):
|
|||
g.attrs['A'] = self.mass_number
|
||||
g.attrs['metastable'] = self.metastable
|
||||
g.attrs['atomic_weight_ratio'] = self.atomic_weight_ratio
|
||||
g.attrs['kTs'] = self.kTs
|
||||
ktg = g.create_group('kTs')
|
||||
for i, temperature in enumerate(self.temperatures):
|
||||
ktg.create_dataset(temperature, data=self.kTs[i])
|
||||
|
||||
# Write energy grid
|
||||
eg = g.create_group('energy')
|
||||
|
|
@ -457,7 +459,10 @@ class IncidentNeutron(EqualityMixin):
|
|||
mass_number = group.attrs['A']
|
||||
metastable = group.attrs['metastable']
|
||||
atomic_weight_ratio = group.attrs['atomic_weight_ratio']
|
||||
kTs = group.attrs['kTs'].tolist()
|
||||
kTg = group['kTs']
|
||||
kTs = []
|
||||
for temp in kTg:
|
||||
kTs.append(temp.value)
|
||||
temperatures = [str(int(round(kT_to_K(kT)))) + "K" for kT in kTs]
|
||||
|
||||
data = cls(name, atomic_number, mass_number, metastable,
|
||||
|
|
|
|||
|
|
@ -225,9 +225,11 @@ class ThermalScattering(EqualityMixin):
|
|||
# Write basic data
|
||||
g = f.create_group(self.name)
|
||||
g.attrs['atomic_weight_ratio'] = self.atomic_weight_ratio
|
||||
g.attrs['kTs'] = self.kTs
|
||||
g.attrs['zaids'] = self.zaids
|
||||
g.attrs['secondary_mode'] = np.string_(self.secondary_mode)
|
||||
ktg = g.create_group('kTs')
|
||||
for i, temperature in enumerate(self.temperatures):
|
||||
ktg.create_dataset(temperature, data=self.kTs[i])
|
||||
|
||||
for T in self.temperatures:
|
||||
Tg = g.create_group(T)
|
||||
|
|
@ -436,7 +438,10 @@ class ThermalScattering(EqualityMixin):
|
|||
|
||||
name = group.name[1:]
|
||||
atomic_weight_ratio = group.attrs['atomic_weight_ratio']
|
||||
kTs = group.attrs['kTs'].tolist()
|
||||
kTg = group['kTs']
|
||||
kTs = []
|
||||
for temp in kTg:
|
||||
kTs.append(temp.value)
|
||||
temperatures = [str(int(round(kT_to_K(kT)))) + "K" for kT in kTs]
|
||||
|
||||
table = cls(name, atomic_weight_ratio, kTs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue