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
b5bcd505
Commit
b5bcd505
authored
Jan 08, 2016
by
Cristian Lalescu
Browse files
change add_particles
1 particle species seems to be correctly integrated at the moment.
parent
76581747
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
bfps/NavierStokes.py
View file @
b5bcd505
This diff is collapsed.
Click to expand it.
bfps/fluid_base.py
View file @
b5bcd505
...
...
@@ -445,25 +445,24 @@ class fluid_particle_base(bfps.code):
dtype
=
np
.
int64
,
compression
=
'gzip'
)
for
s
in
range
(
self
.
particle_species
):
if
self
.
parameters
[
'tracers{0}_integration_method'
.
format
(
s
)]
==
'AdamsBashforth'
:
time_chunk
=
2
**
20
//
(
8
*
3
*
self
.
parameters
[
'nparticles'
]
*
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)])
time_chunk
=
max
(
time_chunk
,
1
)
ofile
.
create_dataset
(
'particles/tracers{0}/rhs'
.
format
(
s
),
(
1
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
maxshape
=
(
None
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
chunks
=
(
time_chunk
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
dtype
=
np
.
float64
)
time_chunk
=
2
**
20
//
(
8
*
3
*
self
.
parameters
[
'nparticles'
]
*
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)])
time_chunk
=
max
(
time_chunk
,
1
)
ofile
.
create_dataset
(
'particles/tracers{0}/rhs'
.
format
(
s
),
(
1
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
maxshape
=
(
None
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
chunks
=
(
time_chunk
,
self
.
parameters
[
'tracers{0}_integration_steps'
.
format
(
s
)],
self
.
parameters
[
'nparticles'
],
3
),
dtype
=
np
.
float64
)
time_chunk
=
2
**
20
//
(
8
*
3
*
self
.
parameters
[
'nparticles'
])
time_chunk
=
max
(
time_chunk
,
1
)
ofile
.
create_dataset
(
...
...
tests/base.py
View file @
b5bcd505
...
...
@@ -102,30 +102,21 @@ def launch(
c
.
parameters
[
'famplitude'
]
=
0.2
c
.
fill_up_fluid_code
()
if
c
.
parameters
[
'nparticles'
]
>
0
:
c
.
add_3D_rFFTW_field
()
c
.
add_
particle_fields
(
name
=
'
regular
'
,
c
.
add_3D_rFFTW_field
(
name
=
'rFFTW_acc'
)
c
.
add_
interpolator
(
name
=
'
spline
'
,
neighbours
=
opt
.
neighbours
,
smoothness
=
opt
.
smoothness
)
c
.
add_particle_fields
(
kcut
=
'fs->kM/2'
,
name
=
'filtered'
,
neighbours
=
opt
.
neighbours
)
intsteps
=
[
2
]
#[2, 3, 4, 6]
c
.
add_particles
(
kcut
=
'fs->kM/2'
,
integration_steps
=
1
,
fields_name
=
'filtered'
)
#for integr_steps in range(1, 7):
# c.add_particles(
# integration_steps = integr_steps,
# neighbours = opt.neighbours,
# smoothness = opt.smoothness,
# fields_name = 'regular')
for
info
in
[(
2
,
'AdamsBashforth'
),
(
3
,
'AdamsBashforth'
),
(
4
,
'AdamsBashforth'
),
(
6
,
'AdamsBashforth'
)]:
c
.
add_particles
(
integration_steps
=
info
[
0
],
integration_method
=
info
[
1
],
fields_name
=
'regular'
)
integration_steps
=
intsteps
,
interpolator
=
[
'spline'
for
i
in
range
(
len
(
intsteps
))],
acc_name
=
'rFFTW_acc'
)
#c.add_particle_fields(kcut = 'fs->kM/2', name = 'filtered', neighbours = opt.neighbours)
#c.add_particles(
# kcut = 'fs->kM/2',
# integration_steps = 1,
# fields_name = 'filtered')
c
.
finalize_code
()
c
.
write_src
()
c
.
write_par
()
...
...
@@ -183,13 +174,12 @@ def acceleration_test(c, m = 3, species = 0):
pid
=
np
.
argmin
(
SNR
(
num_acc1
,
acc
[
n
+
1
:
-
n
-
1
]))
pars
=
d
[
'parameters'
]
to_print
=
(
'integration={0}, steps={1}, interp={2}, neighbours={3}, '
.
format
(
pars
[
'tracers{0}_integration_method'
.
format
(
species
)].
value
,
'steps={0}, interp={1}, neighbours={2}, '
.
format
(
pars
[
'tracers{0}_integration_steps'
.
format
(
species
)].
value
,
pars
[
str
(
pars
[
'tracers{0}_
field
'
.
format
(
species
)].
value
)
+
'_type'
].
value
,
pars
[
str
(
pars
[
'tracers{0}_
field
'
.
format
(
species
)].
value
)
+
'_neighbours'
].
value
))
if
'spline'
in
pars
[
'tracers{0}_
field
'
.
format
(
species
)].
value
:
to_print
+=
'smoothness = {0}, '
.
format
(
pars
[
str
(
pars
[
'tracers{0}_
field
'
.
format
(
species
)].
value
)
+
'_smoothness'
].
value
)
pars
[
str
(
pars
[
'tracers{0}_
interpolator
'
.
format
(
species
)].
value
)
+
'_type'
].
value
,
pars
[
str
(
pars
[
'tracers{0}_
interpolator
'
.
format
(
species
)].
value
)
+
'_neighbours'
].
value
))
if
'spline'
in
pars
[
'tracers{0}_
interpolator
'
.
format
(
species
)].
value
:
to_print
+=
'smoothness = {0}, '
.
format
(
pars
[
str
(
pars
[
'tracers{0}_
interpolator
'
.
format
(
species
)].
value
)
+
'_smoothness'
].
value
)
to_print
+=
(
'SNR d1p-vel={0:.3f}, d1v-acc={1:.3f}, d2p-acc={2:.3f}'
.
format
(
np
.
mean
(
SNR
(
num_vel1
,
vel
[
n
+
1
:
-
n
-
1
])),
...
...
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