Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-istl
Commits
86c9cdef
Commit
86c9cdef
authored
7 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[solvers] store reduction as a scalar real value
parent
d628dfb1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!87
[multirhstest] Check with AlignedNumber.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/istl/solver.hh
+8
-4
8 additions, 4 deletions
dune/istl/solver.hh
dune/istl/solvers.hh
+8
-4
8 additions, 4 deletions
dune/istl/solvers.hh
with
16 additions
and
8 deletions
dune/istl/solver.hh
+
8
−
4
View file @
86c9cdef
...
...
@@ -98,6 +98,9 @@ namespace Dune
//! \brief The real type of the field type (is the same if using real numbers, but differs for std::complex)
typedef
typename
FieldTraits
<
field_type
>::
real_type
real_type
;
//! \brief scalar type underlying the field_type
typedef
SimdScalar
<
real_type
>
scalar_real_type
;
/**
\brief Apply inverse operator,
...
...
@@ -191,6 +194,7 @@ namespace Dune
using
typename
InverseOperator
<
X
,
Y
>::
range_type
;
using
typename
InverseOperator
<
X
,
Y
>::
field_type
;
using
typename
InverseOperator
<
X
,
Y
>::
real_type
;
using
typename
InverseOperator
<
X
,
Y
>::
scalar_real_type
;
/*!
\brief General constructor to initialize an iterative solver.
...
...
@@ -211,7 +215,7 @@ namespace Dune
<li> 2 : print line for each iteration </li>
</ul>
*/
IterativeSolver
(
LinearOperator
<
X
,
Y
>&
op
,
Preconditioner
<
X
,
Y
>&
prec
,
real_type
reduction
,
int
maxit
,
int
verbose
)
:
IterativeSolver
(
LinearOperator
<
X
,
Y
>&
op
,
Preconditioner
<
X
,
Y
>&
prec
,
scalar_
real_type
reduction
,
int
maxit
,
int
verbose
)
:
_op
(
stackobject_to_shared_ptr
(
op
)),
_prec
(
stackobject_to_shared_ptr
(
prec
)),
_sp
(
new
SeqScalarProduct
<
X
>
),
...
...
@@ -244,7 +248,7 @@ namespace Dune
</ul>
*/
IterativeSolver
(
LinearOperator
<
X
,
Y
>&
op
,
ScalarProduct
<
X
>&
sp
,
Preconditioner
<
X
,
Y
>&
prec
,
real_type
reduction
,
int
maxit
,
int
verbose
)
:
scalar_
real_type
reduction
,
int
maxit
,
int
verbose
)
:
_op
(
stackobject_to_shared_ptr
(
op
)),
_prec
(
stackobject_to_shared_ptr
(
prec
)),
_sp
(
stackobject_to_shared_ptr
(
sp
)),
...
...
@@ -270,7 +274,7 @@ namespace Dune
*/
virtual
void
apply
(
X
&
x
,
X
&
b
,
double
reduction
,
InverseOperatorResult
&
res
)
{
real_type
saved_reduction
=
_reduction
;
scalar_
real_type
saved_reduction
=
_reduction
;
_reduction
=
reduction
;
static_cast
<
InverseOperator
<
X
,
Y
>*>
(
this
)
->
apply
(
x
,
b
,
res
);
_reduction
=
saved_reduction
;
...
...
@@ -286,7 +290,7 @@ namespace Dune
std
::
shared_ptr
<
LinearOperator
<
X
,
Y
>>
_op
;
std
::
shared_ptr
<
Preconditioner
<
X
,
Y
>>
_prec
;
std
::
shared_ptr
<
ScalarProduct
<
X
>>
_sp
;
real_type
_reduction
;
scalar_
real_type
_reduction
;
int
_maxit
;
int
_verbose
;
SolverCategory
::
Category
_category
;
...
...
This diff is collapsed.
Click to expand it.
dune/istl/solvers.hh
+
8
−
4
View file @
86c9cdef
...
...
@@ -904,6 +904,8 @@ namespace Dune {
using
typename
IterativeSolver
<
X
,
Y
>::
real_type
;
private:
using
typename
IterativeSolver
<
X
,
X
>::
scalar_real_type
;
//! \bief field_type Allocator retrieved from domain type
using
fAlloc
=
typename
X
::
allocator_type
::
template
rebind
<
field_type
>
::
other
;
...
...
@@ -919,7 +921,7 @@ namespace Dune {
\copydoc LoopSolver::LoopSolver(L&,P&,double,int,int)
\param restart number of GMRes cycles before restart
*/
RestartedGMResSolver
(
LinearOperator
<
X
,
Y
>&
op
,
Preconditioner
<
X
,
Y
>&
prec
,
real_type
reduction
,
int
restart
,
int
maxit
,
int
verbose
)
:
RestartedGMResSolver
(
LinearOperator
<
X
,
Y
>&
op
,
Preconditioner
<
X
,
Y
>&
prec
,
scalar_
real_type
reduction
,
int
restart
,
int
maxit
,
int
verbose
)
:
IterativeSolver
<
X
,
Y
>::
IterativeSolver
(
op
,
prec
,
reduction
,
maxit
,
verbose
),
_restart
(
restart
)
{}
...
...
@@ -930,7 +932,7 @@ namespace Dune {
\copydoc LoopSolver::LoopSolver(L&,S&,P&,double,int,int)
\param restart number of GMRes cycles before restart
*/
RestartedGMResSolver
(
LinearOperator
<
X
,
Y
>&
op
,
ScalarProduct
<
X
>&
sp
,
Preconditioner
<
X
,
Y
>&
prec
,
real_type
reduction
,
int
restart
,
int
maxit
,
int
verbose
)
:
RestartedGMResSolver
(
LinearOperator
<
X
,
Y
>&
op
,
ScalarProduct
<
X
>&
sp
,
Preconditioner
<
X
,
Y
>&
prec
,
scalar_
real_type
reduction
,
int
restart
,
int
maxit
,
int
verbose
)
:
IterativeSolver
<
X
,
Y
>::
IterativeSolver
(
op
,
sp
,
prec
,
reduction
,
maxit
,
verbose
),
_restart
(
restart
)
{}
...
...
@@ -1230,6 +1232,8 @@ namespace Dune {
using
typename
IterativeSolver
<
X
,
X
>::
real_type
;
private:
using
typename
IterativeSolver
<
X
,
X
>::
scalar_real_type
;
//! \bief field_type Allocator retrieved from domain type
typedef
typename
X
::
allocator_type
::
template
rebind
<
field_type
>
::
other
fAlloc
;
public:
...
...
@@ -1240,7 +1244,7 @@ namespace Dune {
\copydoc LoopSolver::LoopSolver(L&,P&,double,int,int)
\param restart number of GMRes cycles before restart
*/
GeneralizedPCGSolver
(
LinearOperator
<
X
,
X
>&
op
,
Preconditioner
<
X
,
X
>&
prec
,
real_type
reduction
,
int
maxit
,
int
verbose
,
int
restart
=
10
)
:
GeneralizedPCGSolver
(
LinearOperator
<
X
,
X
>&
op
,
Preconditioner
<
X
,
X
>&
prec
,
scalar_
real_type
reduction
,
int
maxit
,
int
verbose
,
int
restart
=
10
)
:
IterativeSolver
<
X
,
X
>::
IterativeSolver
(
op
,
prec
,
reduction
,
maxit
,
verbose
),
_restart
(
restart
)
{}
...
...
@@ -1252,7 +1256,7 @@ namespace Dune {
\param restart When to restart the construction of
the Krylov search space.
*/
GeneralizedPCGSolver
(
LinearOperator
<
X
,
X
>&
op
,
ScalarProduct
<
X
>&
sp
,
Preconditioner
<
X
,
X
>&
prec
,
real_type
reduction
,
int
maxit
,
int
verbose
,
int
restart
=
10
)
:
GeneralizedPCGSolver
(
LinearOperator
<
X
,
X
>&
op
,
ScalarProduct
<
X
>&
sp
,
Preconditioner
<
X
,
X
>&
prec
,
scalar_
real_type
reduction
,
int
maxit
,
int
verbose
,
int
restart
=
10
)
:
IterativeSolver
<
X
,
X
>::
IterativeSolver
(
op
,
sp
,
prec
,
reduction
,
maxit
,
verbose
),
_restart
(
restart
)
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment