Skip to content
GitLab
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
235f4315
Commit
235f4315
authored
Jan 29, 2016
by
Cristian Lalescu
Browse files
split NavierStokes.launch into 3
this way, it's easier to handle launching of children classes.
parent
22f6aca1
Changes
1
Hide whitespace changes
Inline
Side-by-side
bfps/NavierStokes.py
View file @
235f4315
...
...
@@ -979,11 +979,10 @@ class NavierStokes(_fluid_particle_base):
dest
=
'particle_rand_seed'
,
default
=
None
)
return
None
def
launch
(
def
prepare_
launch
(
self
,
args
=
[],
**
kwargs
):
opt
=
self
.
prepare_launch
(
args
)
args
=
[]):
opt
=
_code
.
prepare_launch
(
self
,
args
=
args
)
# with the default Lundgren forcing, I can estimate the dissipation
# with nondefault forcing, figure out the amplitude for this viscosity
# yourself
...
...
@@ -1010,9 +1009,19 @@ class NavierStokes(_fluid_particle_base):
if
len
(
opt
.
src_work_dir
)
==
0
:
opt
.
src_work_dir
=
opt
.
work_dir
self
.
pars_from_namespace
(
opt
)
return
opt
def
launch
(
self
,
args
=
[],
**
kwargs
):
opt
=
self
.
prepare_launch
(
args
=
args
)
self
.
fill_up_fluid_code
()
self
.
finalize_code
()
self
.
write_src
()
self
.
launch_jobs
(
opt
=
opt
)
return
None
def
launch_jobs
(
self
,
opt
=
None
):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
work_dir
,
self
.
simname
+
'.h5'
)):
self
.
write_par
()
if
self
.
parameters
[
'nparticles'
]
>
0
:
...
...
@@ -1034,7 +1043,7 @@ class NavierStokes(_fluid_particle_base):
self
.
generate_vector_field
(
write_to_file
=
True
,
spectra_slope
=
2.0
,
amplitude
=
0.
2
5
)
amplitude
=
0.
0
5
)
self
.
run
(
ncpu
=
opt
.
ncpu
,
njobs
=
opt
.
njobs
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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