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
26
namespace
boost::mpi
{
27
class
communicator
;
28
}
29
30
namespace
Accumulators
{
31
32
class
AccumulatorBase
{
33
public
:
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
43
private
:
44
// Number of timesteps between automatic updates.
45
int
m_delta_N;
46
};
47
}
// namespace Accumulators
48
49
#endif
Accumulators::AccumulatorBase
Definition
core/accumulators/AccumulatorBase.hpp:32
Accumulators::AccumulatorBase::delta_N
int & delta_N()
Definition
core/accumulators/AccumulatorBase.hpp:37
Accumulators::AccumulatorBase::~AccumulatorBase
virtual ~AccumulatorBase()=default
Accumulators::AccumulatorBase::shape
virtual std::vector< std::size_t > shape() const =0
Dimensions needed to reshape the flat array returned by the accumulator.
Accumulators::AccumulatorBase::update
virtual void update(boost::mpi::communicator const &comm)=0
Accumulators::AccumulatorBase::AccumulatorBase
AccumulatorBase(int delta_N=1)
Definition
core/accumulators/AccumulatorBase.hpp:34
communicator
Communicator communicator
Definition
communication.cpp:48
Accumulators
Definition
accumulators.cpp:29
boost::mpi
Definition
core/accumulators/AccumulatorBase.hpp:26
src
core
accumulators
AccumulatorBase.hpp
Generated on Sat May 18 2024 01:34:48 for ESPResSo by
1.9.8