12 int maxNonConstTimeWindows)
26 const Eigen::VectorXd &oldValues,
27 const Eigen::VectorXd &res)
29 if (not timeWindowComplete) {
38 part(i) = res(i + offset);
48 "All residual sub-vectors in the residual-sum preconditioner are numerically zero ( sum = {}). "
49 "This indicates that the data values exchanged between two successive iterations did not change. "
50 "The simulation may be unstable, e.g. produces NAN values. Please check the data values exchanged "
51 "between the solvers is not identical between iterations. The preconditioner scaling factors were "
52 "not updated in this iteration and the scaling factors determined in the previous iteration were used.",
61 "A sub-vector in the residual-sum preconditioner became numerically zero ( sub-vector = {}). "
62 "If this occurred in the second iteration and the initial-relaxation factor is equal to 1.0, "
63 "check if the coupling data values of one solver is zero in the first iteration. "
64 "The preconditioner scaling factors were not updated for this iteration and the scaling factors "
65 "determined in the previous iteration were used.",
#define PRECICE_WARN_IF(condition,...)
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
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.
virtual void initialize(std::vector< size_t > &svs)
initialize the preconditioner
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.
std::vector< double > _residualSum
ResidualSumPreconditioner(int maxNonConstTimeWindows)
virtual void initialize(std::vector< size_t > &svs)
initialize the preconditioner
virtual void _update_(bool timeWindowComplete, const Eigen::VectorXd &oldValues, const Eigen::VectorXd &res)
Update the scaling after every FSI iteration.
static double dot(const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2)
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.
constexpr double NUMERICAL_ZERO_DIFFERENCE