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
bf509869
Commit
bf509869
authored
Jan 27, 2016
by
Cristian Lalescu
Browse files
Merge branch 'bugfix/environment' into develop
parents
82cf5e36
7b5555e8
Changes
6
Show whitespace changes
Inline
Side-by-side
bfps/FluidResize.py
View file @
bf509869
...
...
@@ -133,13 +133,12 @@ class FluidResize(_fluid_particle_base):
self
,
args
=
[],
**
kwargs
):
parser
=
argparse
.
ArgumentParser
(
'bfps '
+
type
(
self
).
__name__
)
self
.
add_parser_arguments
(
parser
)
opt
=
parser
.
parse_args
(
args
)
opt
=
self
.
prepare_launch
(
args
)
cmd_line_pars
=
vars
(
opt
)
for
k
in
[
'dst_nx'
,
'dst_ny'
,
'dst_nz'
]:
if
type
(
cmd_line_pars
[
k
])
==
type
(
None
):
cmd_line_pars
[
k
]
=
opt
.
m
self
.
parameters
[
'niter_todo'
]
=
0
self
.
pars_from_namespace
(
opt
)
src_file
=
os
.
path
.
join
(
os
.
path
.
realpath
(
opt
.
src_work_dir
),
...
...
bfps/NavierStokes.py
View file @
bf509869
...
...
@@ -30,6 +30,7 @@ import h5py
import
argparse
import
bfps
from
._code
import
_code
from
._fluid_base
import
_fluid_particle_base
class
NavierStokes
(
_fluid_particle_base
):
...
...
@@ -976,12 +977,10 @@ class NavierStokes(_fluid_particle_base):
self
,
args
=
[],
**
kwargs
):
opt
=
self
.
prepare_launch
(
args
)
# with the default Lundgren forcing, I can estimate the dissipation
# with nondefault forcing, figure out the amplitude for this viscosity
# yourself
parser
=
argparse
.
ArgumentParser
(
'bfps '
+
type
(
self
).
__name__
)
self
.
add_parser_arguments
(
parser
)
opt
=
parser
.
parse_args
(
args
)
self
.
QR_stats_on
=
opt
.
QR_stats
self
.
parameters
[
'nu'
]
=
(
opt
.
kMeta
*
2
/
opt
.
n
)
**
(
4.
/
3
)
self
.
parameters
[
'dt'
]
=
(
opt
.
dtfactor
/
opt
.
n
)
...
...
@@ -1001,7 +1000,6 @@ class NavierStokes(_fluid_particle_base):
self
.
fill_up_fluid_code
()
self
.
finalize_code
()
self
.
write_src
()
self
.
set_host_info
(
bfps
.
host_info
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
work_dir
,
self
.
simname
+
'.h5'
)):
self
.
write_par
()
if
self
.
parameters
[
'nparticles'
]
>
0
:
...
...
bfps/__main__.py
View file @
bf509869
...
...
@@ -29,7 +29,6 @@ import argparse
import
bfps
from
.NavierStokes
import
NavierStokes
from
.FluidConvert
import
FluidConvert
from
.FluidResize
import
FluidResize
def
main
():
...
...
bfps/_base.py
View file @
bf509869
...
...
@@ -166,7 +166,7 @@ class _base(object):
'--environment'
,
type
=
str
,
dest
=
'environment'
,
default
=
''
)
default
=
None
)
parser
.
add_argument
(
'--wd'
,
type
=
str
,
dest
=
'work_dir'
,
...
...
bfps/_code.py
View file @
bf509869
...
...
@@ -28,6 +28,7 @@ import os
import
sys
import
shutil
import
subprocess
import
argparse
import
h5py
from
datetime
import
datetime
import
math
...
...
@@ -263,4 +264,15 @@ class _code(_base):
script_file
.
write
(
'exit 0
\n
'
)
script_file
.
close
()
return
None
def
prepare_launch
(
self
,
args
=
[],
**
kwargs
):
parser
=
argparse
.
ArgumentParser
(
'bfps '
+
type
(
self
).
__name__
)
self
.
add_parser_arguments
(
parser
)
opt
=
parser
.
parse_args
(
args
)
self
.
set_host_info
(
bfps
.
host_info
)
if
type
(
opt
.
environment
)
!=
type
(
None
):
self
.
host_info
[
'environment'
]
=
opt
.
environment
return
opt
bfps/_fluid_base.py
View file @
bf509869
...
...
@@ -395,9 +395,4 @@ class _fluid_particle_base(_code):
nshells
=
kspace
[
'nshell'
].
shape
[
0
]
ofile
.
close
()
return
None
def
launch
(
self
,
args
=
[],
**
kwargs
):
return
None
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