From df0f18fc76f396a7114950783432c09ec228ccdf Mon Sep 17 00:00:00 2001
From: Cristian C Lalescu <Cristian.Lalescu@ds.mpg.de>
Date: Mon, 22 May 2017 17:21:37 +0200
Subject: [PATCH] modify postprocessing class

doesn't do anything for now
---
 bfps/cpp/full_code/postprocess_particles.hpp  | 85 -------------------
 bfps/cpp/full_code/ppNSVE.cpp                 | 40 +++++++++
 .../{postprocess_fields.hpp => ppNSVE.hpp}    | 63 ++++++--------
 setup.py                                      |  3 +-
 4 files changed, 66 insertions(+), 125 deletions(-)
 delete mode 100644 bfps/cpp/full_code/postprocess_particles.hpp
 create mode 100644 bfps/cpp/full_code/ppNSVE.cpp
 rename bfps/cpp/full_code/{postprocess_fields.hpp => ppNSVE.hpp} (62%)

diff --git a/bfps/cpp/full_code/postprocess_particles.hpp b/bfps/cpp/full_code/postprocess_particles.hpp
deleted file mode 100644
index 981a2cbf..00000000
--- 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 00000000..dc667184
--- /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 9cd630f3..738ceb96 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 b0dadfe1..6da0c551 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',
-- 
GitLab