12 int maxNonConstTimeWindows,
13 bool preconditionerUpdateOnThreshold)
29 const Eigen::VectorXd &oldValues,
30 const Eigen::VectorXd &res)
32 if (timeWindowComplete) {
51 "All residual sub-vectors in the residual-sum preconditioner are numerically zero ( sum = {}). "
52 "This indicates that the data values exchanged between two successive iterations did not change. "
53 "The simulation may be unstable, e.g. produces NAN values. Please check the data values exchanged "
54 "between the solvers is not identical between iterations. The preconditioner scaling factors were "
55 "not updated in this iteration and the scaling factors determined in the previous iteration were used.",
64 "A sub-vector in the residual-sum preconditioner became numerically zero ( sub-vector = {}). "
65 "If this occurred in the second iteration and the initial-relaxation factor is equal to 1.0, "
66 "check if the coupling data values of one solver is zero in the first iteration. "
67 "The preconditioner scaling factors were not updated for this iteration and the scaling factors "
68 "determined in the previous iteration were used.",
85 if ((factor > 10.0) || (factor < 0.1)) {
87 PRECICE_DEBUG(
"Significant scaling weight change is detected. The pre-scaling weights will be reset.");
106 PRECICE_DEBUG(
"preconditioner scaling factor[{}] = {}", k, 1 / resSum);
#define PRECICE_WARN_IF(condition,...)
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
std::vector< size_t > _subVectorSizes
Sizes of each sub-vector, i.e. each coupling data.
Preconditioner(int maxNonConstTimeWindows)
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.
std::vector< size_t > _subVectorOffsets
Offsets of each sub-vector in concatenated data, i.e. each coupling data.
bool _requireNewQR
True if a QR decomposition from scratch is necessary.
std::vector< double > _residualSum
ResidualSumPreconditioner(int maxNonConstTimeWindows, bool preconditionerUpdateOnThreshold)
std::vector< double > _previousResidualSum
bool _preconditionerUpdateOnThreshold
void initialize(std::vector< size_t > &svs) override
initialize the preconditioner
void _update_(bool timeWindowComplete, const Eigen::VectorXd &oldValues, const Eigen::VectorXd &res) override
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