 |
Reference documentation for deal.II version 9.2.0
|
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\)
\(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\)
\(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\)
\(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Go to the documentation of this file.
16 #ifndef dealii_solver_bicgstab_h
17 #define dealii_solver_bicgstab_h
123 template <
typename VectorType = Vector<
double>>
166 const AdditionalData & data = AdditionalData());
173 const AdditionalData &data = AdditionalData());
183 template <
typename MatrixType,
typename PreconditionerType>
188 const PreconditionerType &preconditioner);
239 template <
typename MatrixType>
263 template <
typename MatrixType>
288 template <
typename MatrixType,
typename PreconditionerType>
290 iterate(
const MatrixType &
A,
const PreconditionerType &preconditioner);
299 template <
typename VectorType>
301 const bool breakdown,
303 const unsigned int last_step,
304 const double last_residual)
305 : breakdown(breakdown)
307 , last_step(last_step)
308 , last_residual(last_residual)
313 template <
typename VectorType>
316 const AdditionalData & data)
320 , additional_data(data)
325 template <
typename VectorType>
327 const AdditionalData &data)
331 , additional_data(data)
336 template <
typename VectorType>
337 template <
typename MatrixType>
352 template <
typename VectorType>
353 template <
typename MatrixType>
358 Vr->sadd(-1., 1., *Vb);
361 return this->iteration_status(step, res, *Vx);
366 template <
typename VectorType>
376 template <
typename VectorType>
377 template <
typename MatrixType,
typename PreconditionerType>
380 const PreconditionerType &preconditioner)
385 alpha = omega = rho = 1.;
403 beta = rhobar * alpha / (rho * omega);
413 p.add(-beta * omega, v);
416 preconditioner.vmult(y, p);
420 alpha = rho / rhobar;
425 return IterationResult(
true, state, step, res);
427 res =
std::sqrt(r.add_and_dot(-alpha, v, r));
438 print_vectors(step, *Vx, r, y);
442 preconditioner.vmult(z, r);
445 omega = rhobar / (t * t);
446 Vx->add(alpha, y, omega, z);
448 if (additional_data.exact_residual)
451 res = criterion(
A, *Vx, *Vb);
454 res =
std::sqrt(r.add_and_dot(-omega, t, r));
456 state = this->iteration_status(step, res, *Vx);
457 print_vectors(step, *Vx, r, y);
460 return IterationResult(
false, state, step, res);
464 template <
typename VectorType>
465 template <
typename MatrixType,
typename PreconditionerType>
470 const PreconditionerType &preconditioner)
482 Vrbar->reinit(x,
true);
500 deallog <<
"Restart step " << step << std::endl;
506 state = iterate(
A, preconditioner);
509 while (state.breakdown ==
true);
514 state.last_residual));
AdditionalData(const bool exact_residual=true, const double breakdown=1.e-10)
VectorMemory< VectorType >::Pointer Vp
SolverBicgstab(SolverControl &cn, const AdditionalData &data=AdditionalData())
VectorMemory< VectorType >::Pointer Vv
VectorMemory< VectorType >::Pointer Vr
AdditionalData additional_data
VectorMemory< VectorType >::Pointer Vy
virtual void print_vectors(const unsigned int step, const VectorType &x, const VectorType &r, const VectorType &d) const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Expression fabs(const Expression &x)
@ iterate
Continue iteration.
IterationResult iterate(const MatrixType &A, const PreconditionerType &preconditioner)
virtual ~SolverBicgstab() override=default
#define DEAL_II_NAMESPACE_OPEN
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
IterationResult(const bool breakdown, const SolverControl::State state, const unsigned int last_step, const double last_residual)
SolverControl::State start(const MatrixType &A)
VectorMemory< VectorType >::Pointer Vz
inline ::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &x)
VectorMemory< VectorType >::Pointer Vt
@ failure
Stop iteration, goal not reached.
SolverControl::State state
SolverBicgstab(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
@ success
Stop iteration, goal reached.
#define DEAL_II_NAMESPACE_CLOSE
VectorMemory< VectorType >::Pointer Vrbar
double criterion(const MatrixType &A, const VectorType &x, const VectorType &b)
#define AssertThrow(cond, exc)