dune-pdelab
2.5-dev
dune
pdelab
backend
solver.hh
Go to the documentation of this file.
1
// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=8 sw=2 sts=2:
3
#ifndef DUNE_PDELAB_BACKEND_SOLVER_HH
4
#define DUNE_PDELAB_BACKEND_SOLVER_HH
5
6
#include <dune/common/fvector.hh>
7
#include <
dune/pdelab/backend/interface.hh
>
8
9
namespace
Dune
{
10
namespace
PDELab {
11
15
16
struct
SequentialNorm
17
{
21
template
<
class
V>
22
typename
Dune::template FieldTraits<typename V::ElementType >::real_type
norm
(
const
V& v)
const
23
{
24
return
Backend::native
(v).two_norm();
25
}
26
};
27
28
// Status information of a linear solver
29
template
<
class
RFType>
30
struct
LinearSolverResult
31
{
32
bool
converged
;
// Solver converged
33
unsigned
int
iterations
;
// number of iterations
34
double
elapsed
;
// total user time in seconds
35
RFType
reduction
;
// defect reduction
36
RFType
conv_rate
;
// convergence rate (average reduction per step)
37
38
LinearSolverResult
() :
39
converged
(false),
iterations
(0),
elapsed
(0.0),
reduction
(0.0),
conv_rate
(0.0) {}
40
};
41
42
class
LinearResultStorage
43
{
44
public
:
46
const
Dune::PDELab::LinearSolverResult<double>
&
result
()
const
47
{
48
return
res
;
49
}
50
51
protected
:
52
Dune::PDELab::LinearSolverResult<double>
res
;
53
};
54
56
57
}
// end namespace PDELab
58
}
// end namespace Dune
59
60
61
#endif // DUNE_PDELAB_BACKEND_SOLVER_HH
Dune::PDELab::LinearSolverResult::reduction
RFType reduction
Definition:
solver.hh:35
Dune::PDELab::SequentialNorm::norm
Dune::template FieldTraits< typename V::ElementType >::real_type norm(const V &v) const
compute global norm of a vector
Definition:
solver.hh:22
Dune::PDELab::Backend::native
std::enable_if< std::is_base_of< impl::WrapperBase, T >::value, Native< T > & >::type native(T &t)
Definition:
backend/interface.hh:192
Dune
For backward compatibility – Do not use this!
Definition:
adaptivity.hh:28
Dune::PDELab::LinearSolverResult::elapsed
double elapsed
Definition:
solver.hh:34
Dune::PDELab::LinearSolverResult::conv_rate
RFType conv_rate
Definition:
solver.hh:36
Dune::PDELab::SequentialNorm
Definition:
solver.hh:16
Dune::PDELab::LinearResultStorage
Definition:
solver.hh:42
Dune::PDELab::LinearResultStorage::res
Dune::PDELab::LinearSolverResult< double > res
Definition:
solver.hh:52
Dune::PDELab::LinearResultStorage::result
const Dune::PDELab::LinearSolverResult< double > & result() const
Return access to result data.
Definition:
solver.hh:46
Dune::PDELab::LinearSolverResult::iterations
unsigned int iterations
Definition:
solver.hh:33
Dune::PDELab::LinearSolverResult::LinearSolverResult
LinearSolverResult()
Definition:
solver.hh:38
Dune::PDELab::LinearSolverResult
Definition:
solver.hh:30
interface.hh
Dune::PDELab::LinearSolverResult::converged
bool converged
Definition:
solver.hh:32
Generated by
1.8.17