16 const Eigen::VectorXd &oldValues,
17 const Eigen::VectorXd &res)
19 if (not timeWindowComplete) {
26 part(i) = res(i + offset);
35 PRECICE_WARN(
"A sub-vector in the residual preconditioner became numerically zero. "
36 "If this occurred in the second iteration and the initial-relaxation factor is equal to 1.0, "
37 "check if the coupling data values of one solver is zero in the first iteration. "
38 "The preconditioner scaling factors were not applied for this iteration.");
42 _weights[i + offset] = 1.0 / norms[k];
#define PRECICE_WARN(...)
#define PRECICE_ASSERT(...)
Interface for preconditioner variants that can be applied to quasi-Newton acceleration schemes.
std::vector< size_t > _subVectorSizes
Sizes of each sub-vector, i.e. each coupling data.
std::vector< double > _invWeights
Inverse weights (for efficiency reasons)
std::vector< double > _weights
Weights used to scale the matrix V and the residual.
bool _requireNewQR
True if a QR decomposition from scratch is necessary.
ResidualPreconditioner(int maxNonConstTimeWindows)
virtual void _update_(bool timeWindowComplete, const Eigen::VectorXd &oldValues, const Eigen::VectorXd &res)
Update the scaling after every FSI iteration.
static double l2norm(const Eigen::VectorXd &vec)
The l2 norm of a vector is calculated on distributed data.
constexpr double NUMERICAL_ZERO_DIFFERENCE