diff --git a/bfps/cpp/full_code/postprocess_particles.hpp b/bfps/cpp/full_code/postprocess_particles.hpp deleted file mode 100644 index 981a2cbf44823c901f69d247e97571d318b44a7b..0000000000000000000000000000000000000000 --- a/bfps/cpp/full_code/postprocess_particles.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************** -* * -* Copyright 2017 Max Planck Institute * -* for Dynamics and Self-Organization * -* * -* This file is part of bfps. * -* * -* bfps 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. * -* * -* bfps 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 bfps. If not, see <http://www.gnu.org/licenses/> * -* * -* Contact: Cristian.Lalescu@ds.mpg.de * -* * -**********************************************************************/ - - - -#ifndef POSTPROCESS_HPP -#define POSTPROCESS_HPP - - -#include "base.hpp" - -int grow_single_dataset(hid_t dset, int tincrement); - -herr_t grow_dataset_visitor( - hid_t o_id, - const char *name, - const H5O_info_t *info, - void *op_data); - -class direct_numerical_simulation -{ - public: - int myrank, nprocs; - MPI_Comm comm; - - std::string simname; - - int iteration, checkpoint; - int checkpoints_per_file; - int niter_out; - int niter_stat; - int niter_todo; - hid_t stat_file; - bool stop_code_now; - - - int nx; - int ny; - int nz; - int dealias_type; - double dkx; - double dky; - double dkz; - - direct_numerical_simulation( - const MPI_Comm COMMUNICATOR, - const std::string &simulation_name); - virtual ~direct_numerical_simulation(){} - - virtual int write_checkpoint(void) = 0; - virtual int initialize(void) = 0; - virtual int step(void) = 0; - virtual int do_stats(void) = 0; - virtual int finalize(void) = 0; - - int main_loop(void); - int read_iteration(void); - int write_iteration(void); - int grow_file_datasets(void); - int check_stopping_condition(void); -}; - -#endif//DIRECT_NUMERICAL_SIMULATION_HPP - diff --git a/bfps/cpp/full_code/ppNSVE.cpp b/bfps/cpp/full_code/ppNSVE.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dc667184851b49d9883d04b0badb8b7b95128bc8 --- /dev/null +++ b/bfps/cpp/full_code/ppNSVE.cpp @@ -0,0 +1,40 @@ +#include <string> +#include <cmath> +#include "NSVEparticles.hpp" +#include "scope_timer.hpp" + + +template <typename rnumber> +int NSVEparticles<rnumber>::initialize(void) +{ + return EXIT_SUCCESS; +} + +template <typename rnumber> +int NSVEparticles<rnumber>::step(void) +{ + return EXIT_SUCCESS; +} + +template <typename rnumber> +int NSVEparticles<rnumber>::write_checkpoint(void) +{ + return EXIT_SUCCESS; +} + +template <typename rnumber> +int NSVEparticles<rnumber>::finalize(void) +{ + this->NSVE<rnumber>::finalize(); + return EXIT_SUCCESS; +} + +template <typename rnumber> +int NSVEparticles<rnumber>::do_stats() +{ + return EXIT_SUCCESS; +} + +template class NSVEparticles<float>; +template class NSVEparticles<double>; + diff --git a/bfps/cpp/full_code/postprocess_fields.hpp b/bfps/cpp/full_code/ppNSVE.hpp similarity index 62% rename from bfps/cpp/full_code/postprocess_fields.hpp rename to bfps/cpp/full_code/ppNSVE.hpp index 9cd630f3102fc358c3d96cbaca895d96d6b5e989..738ceb9652339bbbd5cd0ff910df6775d9d581a7 100644 --- a/bfps/cpp/full_code/postprocess_fields.hpp +++ b/bfps/cpp/full_code/ppNSVE.hpp @@ -24,55 +24,40 @@ -#ifndef POSTPROCESS_FIELDS_HPP -#define POSTPROCESS_FIELDS_HPP +#ifndef PPNSVE_HPP +#define PPNSVE_HPP + +#include <cstdlib> #include "base.hpp" -#include "direct_numerical_simulation.hpp" +#include "vorticity_equation.hpp" +#include "full_code/direct_numerical_simulation.hpp" +#include "full_code/NSVE.hpp" -class postprocess_fields +template <typename rnumber> +class ppNSVE: public NSVE<rnumber> { public: - int myrank, nprocs; - MPI_Comm comm; - - std::string simname; - - int iteration, checkpoint; - int checkpoints_per_file; - int niter_out; - int niter_stat; - int niter_todo; - hid_t stat_file; - bool stop_code_now; - int nx; - int ny; - int nz; - int dealias_type; - double dkx; - double dky; - double dkz; - - direct_numerical_simulation( + ppNSVE( const MPI_Comm COMMUNICATOR, - const std::string &simulation_name); - virtual ~direct_numerical_simulation(){} - - virtual int write_checkpoint(void) = 0; - virtual int initialize(void) = 0; - virtual int step(void) = 0; - virtual int do_stats(void) = 0; - virtual int finalize(void) = 0; - + const std::string &simulation_name): + NSVE<rnumber>( + COMMUNICATOR, + simulation_name){} + ~ppNSVE(){} + + int initialize(void); + int step(void); + int finalize(void); + + virtual int read_parameters(void); + int write_checkpoint(void); + int do_stats(void); int main_loop(void); - int read_iteration(void); - int write_iteration(void); - int grow_file_datasets(void); - int check_stopping_condition(void); }; -#endif//POSTPROCESS_FIELDS_HPP +#endif//PPNSVE_HPP diff --git a/setup.py b/setup.py index b0dadfe10e05cf7f5503000d4e0cb9bdd82641cc..6da0c551d5087b8ae5dca2599a7ec5a5ed1761af 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,8 @@ print('This is bfps version ' + VERSION) ### lists of files and MANIFEST.in -src_file_list = ['field_binary_IO', +src_file_list = ['full_code/ppNSVE', + 'field_binary_IO', 'full_code/direct_numerical_simulation', 'full_code/NSVE', 'full_code/NSVEparticles',