|
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_minres_h
17 #define dealii_solver_minres_h
71 template <
class VectorType = Vector<
double>>
104 template <
typename MatrixType,
typename PreconditionerType>
106 solve(
const MatrixType &
A,
109 const PreconditionerType &preconditioner);
154 template <
class VectorType>
157 const AdditionalData &)
164 template <
class VectorType>
166 const AdditionalData &)
173 template <
class VectorType>
181 template <
class VectorType>
191 template <
class VectorType>
192 template <
typename MatrixType,
typename PreconditionerType>
197 const PreconditionerType &preconditioner)
214 vecptr u[3] = {Vu0.get(), Vu1.get(), Vu2.get()};
215 vecptr m[3] = {Vm0.get(), Vm1.get(), Vm2.get()};
220 u[0]->reinit(
b,
true);
221 u[1]->reinit(
b,
true);
222 u[2]->reinit(
b,
true);
223 m[0]->reinit(
b,
true);
224 m[1]->reinit(
b,
true);
225 m[2]->reinit(
b,
true);
229 double delta[3] = {0, 0, 0};
230 double f[2] = {0, 0};
231 double e[2] = {0, 0};
253 preconditioner.vmult(v, *u[1]);
255 delta[1] = v * (*u[1]);
257 Assert(delta[1] >= 0, ExcPreconditionerNotDefinite());
278 u[2]->add(-std::sqrt(delta[1] / delta[0]), *u[0]);
280 const double gamma = *u[2] * v;
281 u[2]->add(-
gamma / std::sqrt(delta[1]), *u[1]);
287 preconditioner.vmult(v, *u[2]);
289 delta[2] = v * (*u[2]);
291 Assert(delta[2] >= 0, ExcPreconditionerNotDefinite());
300 d_ = s *
e[0] - c *
gamma;
306 const double d =
std::sqrt(d_ * d_ + delta[2]);
318 m[0]->add(-
e[0], *m[1]);
320 m[0]->add(-f[0], *m[2]);
325 conv = this->iteration_status(j, r_l2, x);
long double gamma(const unsigned int n)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
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.
#define DEAL_II_NAMESPACE_OPEN
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
void swap(BlockIndices &u, BlockIndices &v)
virtual void print_vectors(const unsigned int step, const VectorType &x, const VectorType &r, const VectorType &d) const
virtual ~SolverMinRes() override=default
static ::ExceptionBase & ExcPreconditionerNotDefinite()
inline ::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &x)
#define Assert(cond, exc)
#define DeclException0(Exception0)
virtual double criterion()
@ success
Stop iteration, goal reached.
#define DEAL_II_NAMESPACE_CLOSE
SolverMinRes(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
#define AssertThrow(cond, exc)