ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
core/accumulators/AccumulatorBase.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef CORE_ACCUMULATORS_ACCUMULATOR_BASE_HPP
20#define CORE_ACCUMULATORS_ACCUMULATOR_BASE_HPP
21
22#include <cstddef>
23#include <vector>
24
25// Forward declaration
26namespace boost::mpi {
27class communicator;
28}
29
30namespace Accumulators {
31
33public:
34 explicit AccumulatorBase(int delta_N = 1) : m_delta_N(delta_N) {}
35 virtual ~AccumulatorBase() = default;
36
37 int &delta_N() { return m_delta_N; }
38
39 virtual void update(boost::mpi::communicator const &comm) = 0;
40 /** Dimensions needed to reshape the flat array returned by the accumulator */
41 virtual std::vector<std::size_t> shape() const = 0;
42
43private:
44 // Number of timesteps between automatic updates.
45 int m_delta_N;
46};
47} // namespace Accumulators
48
49#endif
virtual ~AccumulatorBase()=default
virtual std::vector< std::size_t > shape() const =0
Dimensions needed to reshape the flat array returned by the accumulator.
virtual void update(boost::mpi::communicator const &comm)=0
Communicator communicator