preCICE v3.1.1
Loading...
Searching...
No Matches
ConstantRelaxationAcceleration.cpp
Go to the documentation of this file.
2#include <Eigen/Core>
3#include <map>
4#include <memory>
5#include <ostream>
6#include <utility>
7
10#include "utils/Helpers.hpp"
11#include "utils/assertion.hpp"
12
13namespace precice::acceleration {
14
16 double relaxation,
17 std::vector<int> dataIDs)
18 : _relaxation(relaxation),
19 _dataIDs(std::move(dataIDs))
20{
21 PRECICE_CHECK((relaxation > 0.0) && (relaxation <= 1.0),
22 "Relaxation factor for constant relaxation acceleration has to be larger than zero and smaller or equal to one. "
23 "Current relaxation factor is: {}",
24 relaxation);
25}
26
28{
29 checkDataIDs(cplData);
30}
31
37
38} // namespace precice::acceleration
#define PRECICE_TRACE(...)
Definition LogMacros.hpp:95
#define PRECICE_CHECK(check,...)
Definition LogMacros.hpp:35
void checkDataIDs(const DataMap &cplData) const
Checks if all dataIDs are contained in cplData.
static void applyRelaxation(double omega, DataMap &cplData)
performs a relaxation given a relaxation factor omega
ConstantRelaxationAcceleration(double relaxation, std::vector< int > dataIDs)
contains implementations of acceleration schemes.
STL namespace.