diff --git a/CMakeLists.txt b/CMakeLists.txt index afbc19b772597ec3a2d99c6cf51e8963c53c3627..89048a4ba41af69a7e35ceb76762576b7adc4911 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,14 +425,46 @@ install(CODE "execute_process(COMMAND python3 ${PROJECT_SOURCE_DIR}/setup.py ins ##################################################################################### ## Add tests include(CTest) +set(TEST_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/test_runs/") enable_testing() if (BUILD_TESTING) - add_test(test_fftw turtle.test_fftw) - add_test(test_Parseval turtle.test_Parseval) - add_test(test_NSVEparticles turtle.test_NSVEparticles) - add_test(test_pp_single_to_double turtle PP field_single_to_double --simname dns_nsveparticles --iter0 32 --iter1 32) - add_test(test_pp_get_rfields turtle PP get_rfields --simname dns_nsveparticles --iter0 0 --iter1 64) - add_test(test_pp_joint_acc_vel_stats turtle PP joint_acc_vel_stats --simname dns_nsveparticles --iter0 0 --iter1 64) - add_test(test_pp_resize turtle PP resize --simname dns_nsveparticles --new_nx 96 --new_ny 96 --new_nz 96 --new_simname dns_nsveparticles_resized) + file(MAKE_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + ### basic functionality + add_test(NAME test_fftw + COMMAND turtle.test_fftw + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_Parseval + COMMAND turtle.test_Parseval + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + ### compare DNS output to stored results + add_test(NAME test_NSVEparticles + COMMAND turtle.test_NSVEparticles + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + ### simple runs of post-processing tools + add_test(NAME test_pp_single_to_double + COMMAND turtle PP field_single_to_double --simname dns_nsveparticles --iter0 32 --iter1 32 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_pp_get_rfields + COMMAND turtle PP get_rfields --simname dns_nsveparticles --iter0 0 --iter1 64 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_pp_joint_acc_vel_stats + COMMAND turtle PP joint_acc_vel_stats --simname dns_nsveparticles --iter0 0 --iter1 64 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_pp_resize + COMMAND turtle PP resize --simname dns_nsveparticles --new_nx 96 --new_ny 96 --new_nz 96 --new_simname dns_nsveparticles_resized + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + ### simple runs of different DNS + add_test(NAME test_NSVEp_extra_sampling + COMMAND turtle DNS NSVEp_extra_sampling -n 32 --src-simname dns_nsveparticles --src-iteration 32 --simname dns_nsvep_extra_sampling --nparticles 1000 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_NSVEcomplex_particles + COMMAND turtle DNS NSVEcomplex_particles -n 32 --src-simname dns_nsveparticles --src-iteration 32 --simname dns_nsvecomplex_particles --nparticles 1000 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_static_field + COMMAND turtle DNS static_field --simname dns_static_field --nparticles 10000 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) + add_test(NAME test_kraichnan_field + COMMAND turtle DNS kraichnan_field --simname dns_kraichnan_field --nparticles 10000 + WORKING_DIRECTORY ${TEST_OUTPUT_DIRECTORY}) endif(BUILD_TESTING) diff --git a/TurTLE/test/test_turtle_NSVEparticles.py b/TurTLE/test/test_turtle_NSVEparticles.py index 0e600e7847fe6c01adc4578682f6aebfff80ac6f..8329a0b5ceebdb0f8477fbb45dc05645891a774e 100644 --- a/TurTLE/test/test_turtle_NSVEparticles.py +++ b/TurTLE/test/test_turtle_NSVEparticles.py @@ -4,20 +4,20 @@ # Copyright 2019 Max Planck Institute # # for Dynamics and Self-Organization # # # -# This file is part of TurTLE. # +# This file is part of TurTLE. # # # -# TurTLE is free software: you can redistribute it and/or modify # +# TurTLE is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published # # by the Free Software Foundation, either version 3 of the License, # # or (at your option) any later version. # # # -# TurTLE is distributed in the hope that it will be useful, # +# TurTLE is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # -# along with TurTLE. If not, see <http://www.gnu.org/licenses/> # +# along with TurTLE. If not, see <http://www.gnu.org/licenses/> # # # # Contact: Cristian.Lalescu@ds.mpg.de # # # diff --git a/cpp/full_code/NSVEp_extra_sampling.cpp b/cpp/full_code/NSVEp_extra_sampling.cpp index 7b3e5a76c6d47c990df9698ccb5f8ef22770a70d..5a8cef55edf62575f950208f22ca028de1649932 100644 --- a/cpp/full_code/NSVEp_extra_sampling.cpp +++ b/cpp/full_code/NSVEp_extra_sampling.cpp @@ -149,6 +149,14 @@ int NSVEp_extra_sampling<rnumber>::do_stats() return EXIT_SUCCESS; } +template <typename rnumber> +int NSVEp_extra_sampling<rnumber>::read_parameters(void) +{ + TIMEZONE("NSVEp_extra_sampling::read_parameters"); + this->NSVEparticles<rnumber>::read_parameters(); + return EXIT_SUCCESS; +} + template class NSVEp_extra_sampling<float>; template class NSVEp_extra_sampling<double>; diff --git a/cpp/full_code/ornstein_uhlenbeck_process.cpp b/cpp/full_code/ornstein_uhlenbeck_process.cpp index b6af42d324a27cddedd56aefbf7c57632ce186c6..2c680914c3b13042ec50f2f33e0743ba677cced6 100644 --- a/cpp/full_code/ornstein_uhlenbeck_process.cpp +++ b/cpp/full_code/ornstein_uhlenbeck_process.cpp @@ -4,7 +4,7 @@ #include <cassert> #include "scope_timer.hpp" #include <algorithm> -#define NDEBUG + template <class rnumber,field_backend be>