Commit 4b2d5307 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix interpolation comparison

parent f4ce2f1f
...@@ -3,3 +3,4 @@ x 2015-12-23 decide on versioning system ...@@ -3,3 +3,4 @@ x 2015-12-23 decide on versioning system
x 2015-12-24 move get_grid coords to interpolator @optimization +v1.0 x 2015-12-24 move get_grid coords to interpolator @optimization +v1.0
x 2015-12-25 get rid of temporal interpolation @optimization +v1.0 x 2015-12-25 get rid of temporal interpolation @optimization +v1.0
x 2015-12-26 call interpolation only when needed @optimization +v1.0 x 2015-12-26 call interpolation only when needed @optimization +v1.0
x 2015-12-26 clean up tox files, make sure all tests run @tests +v1.0
#! /usr/bin/env python2
####################################################################### #######################################################################
# # # #
# Copyright 2015 Max Planck Institute # # Copyright 2015 Max Planck Institute #
...@@ -26,35 +25,44 @@ ...@@ -26,35 +25,44 @@
import numpy as np import numpy as np
from test_base import * from base import *
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
class test_interpolation(bfps.NavierStokes):
def __init__(
self,
name = 'test_interpolation',
work_dir = './',
simname = 'test'):
super(test_interpolation, self).__init__(
work_dir = work_dir,
simname = simname,
name = name,
frozen_fields = True)
return None
if __name__ == '__main__': if __name__ == '__main__':
opt = parser.parse_args() opt = parser.parse_args(
c = test_interpolation(work_dir = opt.work_dir + '/io') ['-n', '32',
'--run',
'--ncpu', '2',
'--initialize',
'--neighbours', '4',
'--smoothness', '1',
'--nparticles', '4225',
'--niter_todo', '1',
'--niter_stat', '1',
'--niter_part', '1',
'--niter_out', '1',
'--wd', 'interp'] +
sys.argv[1:])
c = bfps.NavierStokes(
name = 'test_interpolation',
use_fftw_wisdom = False,
frozen_fields = True)
c.pars_from_namespace(opt) c.pars_from_namespace(opt)
c.fill_up_fluid_code()
c.add_particle_fields(
name = 'n{0}m{1}'.format(opt.neighbours, opt.smoothness),
neighbours = opt.neighbours,
smoothness = opt.smoothness)
c.add_particle_fields(
name = 'n{0}'.format(opt.neighbours),
neighbours = opt.neighbours,
interp_type = 'Lagrange')
c.add_particles( c.add_particles(
integration_steps = 1, integration_steps = 1,
neighbours = 4, fields_name = 'n{0}m{1}'.format(opt.neighbours, opt.smoothness))
smoothness = 1)
c.add_particles( c.add_particles(
integration_steps = 1, integration_steps = 1,
neighbours = 4, fields_name = 'n{0}'.format(opt.neighbours))
interp_type = 'Lagrange')
c.fill_up_fluid_code()
c.finalize_code() c.finalize_code()
c.write_src() c.write_src()
c.write_par() c.write_par()
......
(B) FFTW interpolator doesn't need its own field @optimization +v1.0 (B) FFTW interpolator doesn't need its own field @optimization +v1.0
(B) clean up tox files, make sure all tests run @tests +v1.0
(B) compute z polynomials only when needed @optimization +v1.0 (B) compute z polynomials only when needed @optimization +v1.0
(B) use less memory @optimization (B) use less memory @optimization
(B) split library into core and extra @optimization +v1.0 (B) split library into core and extra @optimization +v1.0
......
[tox]
envlist = py27
[testenv]
whitelist_externals =
echo
cp
passenv = LD_LIBRARY_PATH
changedir =
{envtmpdir}
commands =
cp -r {toxinidir}/tests {envtmpdir}
python tests/test_interpolation.py \
-n 32 --ncpu 2 \
--initialize \
--nparticles 4225 \
--niter_todo 1 \
--niter_stat 1 \
--niter_part 1 \
--niter_out 1 \
--run
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment