52template <
typename VectorType = Vector<
double>>
84 const AdditionalData & data = AdditionalData());
93 template <
typename MatrixType>
95 solve(
double &value,
const MatrixType &
A, VectorType &x);
125template <
typename VectorType = Vector<
double>>
169 const AdditionalData & data = AdditionalData());
178 template <
typename MatrixType>
180 solve(
double &value,
const MatrixType &
A, VectorType &x);
193template <
class VectorType>
198 , additional_data(data)
203template <
class VectorType>
204template <
typename MatrixType>
213 VectorType & y = *Vy;
216 VectorType & r = *Vr;
219 double length = x.l2_norm();
220 double old_length = 0.;
229 y.add(additional_data.shift, x);
233 length = y.l2_norm();
239 double thresh = length / x.size();
250 value = (entry * x(i) < 0.) ? -length : length;
251 value -= additional_data.shift;
254 x.equ(1 / length, y);
261 conv = this->iteration_status(iter,
262 std::fabs(1. / length - 1. / old_length),
269 iter,
std::fabs(1. / length - 1. / old_length)));
276template <
class VectorType>
281 , additional_data(data)
286template <
class VectorType>
287template <
typename MatrixType>
299 double current_shift = -value;
308 unsigned int goal = additional_data.start_adaption;
312 VectorType & y = *Vy;
315 VectorType & r = *Vr;
318 double length = x.l2_norm();
319 double old_value = value;
328 solver.
solve(A_s, y, x, prec);
331 length = y.l2_norm();
337 double thresh = length / x.size();
348 value = (entry * x(i) < 0. ? -1. : 1.) / length - current_shift;
352 const auto & relaxation = additional_data.relaxation;
353 const double new_shift =
354 relaxation * (-value) + (1. - relaxation) * current_shift;
357 current_shift = new_shift;
363 x.equ(1. / length, y);
365 if (additional_data.use_residual)
369 r.sadd(-1., value, x);
372 conv = this->iteration_status(iter, res, x);
376 res =
std::fabs(1. / value - 1. / old_value);
377 conv = this->iteration_status(iter, res, x);
EigenInverse(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
AdditionalData additional_data
void solve(double &value, const MatrixType &A, VectorType &x)
EigenPower(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
void solve(double &value, const MatrixType &A, VectorType &x)
AdditionalData additional_data
@ iterate
Continue iteration.
@ success
Stop iteration, goal reached.
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
#define AssertThrow(cond, exc)
LinearOperator< Range, Range, Payload > identity_operator(const std::function< void(Range &, bool)> &reinit_vector)
LinearOperator< Range, Domain, Payload > linear_operator(const Matrix &matrix)
Expression fabs(const Expression &x)
unsigned int global_dof_index
AdditionalData(double relaxation=1., unsigned int start_adaption=6, bool use_residual=true)
unsigned int start_adaption
AdditionalData(const double shift=0.)