Skip to content
Snippets Groups Projects
Commit 2c2996ac authored by Chichi Lalescu's avatar Chichi Lalescu
Browse files

play some more with acc tests

parent a98afc27
Branches
Tags
No related merge requests found
...@@ -92,7 +92,11 @@ def launch( ...@@ -92,7 +92,11 @@ def launch(
if c.parameters['nparticles'] > 0: if c.parameters['nparticles'] > 0:
c.add_particles(kcut = 'fs->kM/2', c.add_particles(kcut = 'fs->kM/2',
integration_steps = 1, neighbours = opt.neighbours, smoothness = opt.smoothness) integration_steps = 1, neighbours = opt.neighbours, smoothness = opt.smoothness)
c.add_particles(integration_steps = 1, neighbours = opt.neighbours, smoothness = opt.smoothness) c.add_particles(
integration_steps = 1,
neighbours = opt.neighbours,
smoothness = opt.smoothness,
force_vel_reset = True)
c.add_particles(integration_steps = 2, neighbours = opt.neighbours, smoothness = opt.smoothness) c.add_particles(integration_steps = 2, neighbours = opt.neighbours, smoothness = opt.smoothness)
c.add_particles(integration_steps = 3, neighbours = opt.neighbours, smoothness = opt.smoothness) c.add_particles(integration_steps = 3, neighbours = opt.neighbours, smoothness = opt.smoothness)
c.add_particles(integration_steps = 4, neighbours = opt.neighbours, smoothness = opt.smoothness) c.add_particles(integration_steps = 4, neighbours = opt.neighbours, smoothness = opt.smoothness)
...@@ -136,7 +140,7 @@ def launch( ...@@ -136,7 +140,7 @@ def launch(
return c return c
def acceleration_test(c, m = 3, species = 7): def acceleration_test(c, m = 3, species = 9):
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from bfps.tools import get_fornberg_coeffs from bfps.tools import get_fornberg_coeffs
...@@ -173,7 +177,7 @@ def acceleration_test(c, m = 3, species = 7): ...@@ -173,7 +177,7 @@ def acceleration_test(c, m = 3, species = 7):
a.plot(num_acc1[m+1-n:, pid[1], cc], color = col[cc]) a.plot(num_acc1[m+1-n:, pid[1], cc], color = col[cc])
a.plot(num_acc2[m+1-n:, pid[1], cc], color = col[cc], dashes = (2, 2)) a.plot(num_acc2[m+1-n:, pid[1], cc], color = col[cc], dashes = (2, 2))
fig.tight_layout() fig.tight_layout()
fig.savefig(os.path.join(c.work_dir, 'acc_test_{0}.pdf'.format(c.simname))) fig.savefig(os.path.join(c.work_dir, 'acc_test_{0}_{1}.pdf'.format(c.simname, species)))
return None return None
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -38,7 +38,8 @@ def plain(opt): ...@@ -38,7 +38,8 @@ def plain(opt):
opt.work_dir = wd + '/N{0:0>3x}_1'.format(opt.n) opt.work_dir = wd + '/N{0:0>3x}_1'.format(opt.n)
c0 = launch(opt, dt = 0.2/opt.n) c0 = launch(opt, dt = 0.2/opt.n)
c0.compute_statistics() c0.compute_statistics()
acceleration_test(c0) for s in range(c0.particle_species):
acceleration_test(c0, species = s)
if not opt.multiplejob: if not opt.multiplejob:
return None return None
assert(opt.niter_todo % 3 == 0) assert(opt.niter_todo % 3 == 0)
......
...@@ -11,8 +11,8 @@ commands = ...@@ -11,8 +11,8 @@ commands =
cp -r {toxinidir}/tests {envtmpdir} cp -r {toxinidir}/tests {envtmpdir}
#python tests/test_plain.py -n 256 --run --initialize --ncpu 8 --niter_todo 8 --precision single --wd "data/single" #python tests/test_plain.py -n 256 --run --initialize --ncpu 8 --niter_todo 8 --precision single --wd "data/single"
python tests/test_plain.py \ python tests/test_plain.py \
-n 32 --run --initialize --ncpu 2 \ -n 32 --run --initialize --ncpu 4 \
--nparticles 256 --niter_todo 64 \ --nparticles 256 --niter_todo 48 \
--precision single --wd "data/single" --precision single --wd "data/single"
#python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision single --wd "data/single" #python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision single --wd "data/single"
#python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision double --wd "data/double" #python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision double --wd "data/double"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment