Commit ee63b68e authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix compute_stats

parent 1c73f150
Pipeline #45684 failed with stage
......@@ -218,21 +218,21 @@ class DNS(_code):
if not os.path.exists(self.get_data_file_name()):
if os.path.exists(self.get_cache_file_name()):
self.read_parameters(fname = self.get_cache_file_name())
with self.get_cache_file() as pp_file:
for k in ['t',
'energy(t)',
'energy(k)',
'enstrophy(t)',
'enstrophy(k)',
'R_ij(t)',
'vel_max(t)',
'renergy(t)']:
if k in pp_file.keys():
self.statistics[k] = pp_file[k][...]
self.statistics['kM'] = pp_file['kspace/kM'][...]
self.statistics['dk'] = pp_file['kspace/dk'][...]
self.statistics['kshell'] = pp_file['kspace/kshell'][...]
self.statistics['nshell'] = pp_file['kspace/nshell'][...]
pp_file = self.get_cache_file()
for k in ['t',
'energy(t)',
'energy(k)',
'enstrophy(t)',
'enstrophy(k)',
'R_ij(t)',
'vel_max(t)',
'renergy(t)']:
if k in pp_file.keys():
self.statistics[k] = pp_file[k][...]
self.statistics['kM'] = pp_file['kspace/kM'][...]
self.statistics['dk'] = pp_file['kspace/dk'][...]
self.statistics['kshell'] = pp_file['kspace/kshell'][...]
self.statistics['nshell'] = pp_file['kspace/nshell'][...]
else:
self.read_parameters()
with self.get_data_file() as data_file:
......@@ -296,6 +296,7 @@ class DNS(_code):
pp_file['enstrophy(k)'] = np.mean(enstrophy_tk, axis = 0)*(4*np.pi*self.statistics['kshell']**2) / (self.statistics['dk']*self.statistics['nshell'])
pp_file['vel_max(t)'] = data_file['statistics/moments/velocity'][ii0:ii1+1, 9, 3]
pp_file['renergy(t)'] = data_file['statistics/moments/velocity'][ii0:ii1+1, 2, 3]/2
print(pp_file)
for k in ['t',
'energy(t)',
'energy(k)',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment