3#include <boost/range/adaptor/map.hpp>
26 : _initialRelaxation(initialRelaxation),
27 _dataIDs(
std::move(dataIDs)),
28 _aitkenFactor(initialRelaxation),
29 _preconditioner(
std::move(preconditioner))
32 "Initial relaxation factor for Aitken acceleration has to "
33 "be larger than zero and smaller or equal to one. "
34 "Current initial relaxation is: {}",
41 for (
const auto &data : cplData | boost::adaptors::map_values) {
43 "Aitken acceleration does not yet support using data from all substeps. Please set substeps=\"false\" in the exchange tag of data \"{}\".", data->getDataName());
56 _values = Eigen::VectorXd::Zero(entries);
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
T back_inserter(T... args)
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
void concatenateCouplingData(const DataMap &cplData, const std::vector< DataID > &dataIDs, Eigen::VectorXd &targetValues, Eigen::VectorXd &targetOldValues) const
Concatenates all coupling data involved into a single vector.
Eigen::VectorXd _oldResiduals
double _initialRelaxation
AitkenAcceleration(double initialRelaxationFactor, std::vector< int > dataIDs, impl::PtrPreconditioner preconditioner)
virtual void iterationsConverged(const DataMap &cpldata)
std::vector< int > _dataIDs
Eigen::VectorXd _oldValues
virtual void performAcceleration(DataMap &cpldata)
virtual void initialize(const DataMap &cpldata)
impl::PtrPreconditioner _preconditioner
Preconditioner for data vector if multiple data sets are used.
static double dot(const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2)
contains implementations of acceleration schemes.
int sign(double number)
Return the sign, one of {-1, 0, 1}.
bool contained(const ELEMENT_T &element, const std::vector< ELEMENT_T > &vec)
Returns true, if given element is in vector, otherwise false.