From 5e05c2ecb17ba981aa5752b39620d786a516a48c Mon Sep 17 00:00:00 2001 From: Chichi Lalescu <chichilalescu@gmail.com> Date: Mon, 28 May 2018 09:59:58 +0200 Subject: [PATCH] add Parseval test --- bfps/test/test_Parseval.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 bfps/test/test_Parseval.py diff --git a/bfps/test/test_Parseval.py b/bfps/test/test_Parseval.py new file mode 100644 index 00000000..00945185 --- /dev/null +++ b/bfps/test/test_Parseval.py @@ -0,0 +1,33 @@ +#! /usr/bin/env python + +import os +import numpy as np +import h5py +import sys + +import bfps +from bfps import DNS + +def main(): + niterations = 10 + c = DNS() + c.launch( + ['NSVE', + '--nx', '32', + '--ny', '32', + '--nz', '32', + '--forcing_type', 'linear', + '--np', '4', + '--ntpp', '1', + '--niter_todo', '{0}'.format(niterations), + '--niter_out', '{0}'.format(niterations), + '--niter_stat', '1', + '--wd', './'] + + sys.argv[1:]) + c.compute_statistics() + print(c.statistics['energy(t)'] - c.statistics['renergy(t)']) + return None + +if __name__ == '__main__': + main() + -- GitLab