Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TurTLE
TurTLE
Commits
ee63b68e
Commit
ee63b68e
authored
Mar 22, 2019
by
Cristian Lalescu
Browse files
fix compute_stats
parent
1c73f150
Pipeline
#45684
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bfps/DNS.py
View file @
ee63b68e
...
...
@@ -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)'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment