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
c10ec539
Verified
Commit
c10ec539
authored
5 years ago
by
Nils-Arne Dreier
Browse files
Options
Downloads
Patches
Plain Diff
add constructors to IterativeSolvers in solvers.hh that take shared_ptr s
parent
5662cca1
No related branches found
No related tags found
1 merge request
!310
Add constructors that take shared ptr to iterative solvers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/solvers.hh
+61
-0
61 additions, 0 deletions
dune/istl/solvers.hh
with
61 additions
and
0 deletions
dune/istl/solvers.hh
+
61
−
0
View file @
c10ec539
...
...
@@ -308,6 +308,24 @@ namespace Dune {
}
}
/*!
\brief Constructor to initialize a CG solver.
\copydetails IterativeSolver::IterativeSolver(std::shared_ptr<LinearOperator<X,Y>>, std::shared_ptr<ScalarProduct<X>>, std::shared_ptr<Preconditioner<X,Y>>, real_type, int, int)
\param condition_estimate Whether to calculate an estimate of the condition number.
The estimate is given in the InverseOperatorResult returned by apply().
This is only supported for float and double field types.
*/
CGSolver
(
std
::
shared_ptr
<
LinearOperator
<
X
,
X
>>
op
,
std
::
shared_ptr
<
ScalarProduct
<
X
>>
sp
,
std
::
shared_ptr
<
Preconditioner
<
X
,
X
>>
prec
,
scalar_real_type
reduction
,
int
maxit
,
int
verbose
,
bool
condition_estimate
)
:
IterativeSolver
<
X
,
X
>
(
op
,
sp
,
prec
,
reduction
,
maxit
,
verbose
),
condition_estimate_
(
condition_estimate
)
{
if
(
condition_estimate
&&
!
(
std
::
is_same
<
field_type
,
float
>::
value
||
std
::
is_same
<
field_type
,
double
>::
value
))
{
condition_estimate_
=
false
;
std
::
cerr
<<
"WARNING: Condition estimate was disabled. It is only available for double and float field types!"
<<
std
::
endl
;
}
}
/*!
\brief Apply inverse operator.
...
...
@@ -1060,6 +1078,20 @@ namespace Dune {
_restart
(
restart
)
{}
/*!
\brief Set up RestartedGMResSolver solver.
\copydoc LoopSolver::LoopSolver(std::shared_ptr<L>,std::shared_ptr<S>,std::shared_ptr<P>,double,int,int)
\param restart number of GMRes cycles before restart
*/
RestartedGMResSolver
(
std
::
shared_ptr
<
LinearOperator
<
X
,
Y
>>
op
,
std
::
shared_ptr
<
ScalarProduct
<
X
>>
sp
,
std
::
shared_ptr
<
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
)
{}
/*!
\brief Apply inverse operator.
...
...
@@ -1586,6 +1618,22 @@ private:
_restart
(
restart
)
{}
/*!
\brief Set up nonlinear preconditioned conjugate gradient solver.
\copydoc LoopSolver::LoopSolver(std::shared_ptr<L>,std::shared_ptr<S>,std::shared_ptr<P>,double,int,int)
\param restart When to restart the construction of
the Krylov search space.
*/
GeneralizedPCGSolver
(
std
::
shared_ptr
<
LinearOperator
<
X
,
X
>>
op
,
std
::
shared_ptr
<
ScalarProduct
<
X
>>
sp
,
std
::
shared_ptr
<
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
)
{}
/*!
\brief Apply inverse operator.
...
...
@@ -1784,6 +1832,19 @@ private:
{
}
/*!
\brief Constructor to initialize a RestartedFCG solver.
\copydetails IterativeSolver::IterativeSolver(std::shared_ptr<LinearOperator<X,Y>>, std::shared_ptr<ScalarProduct<X>>, std::shared_ptr<Preconditioner<X,Y>>, real_type, int, int,int)
\param mmax is the maximal number of previous vectors which are orthogonalized against the new search direction.
*/
RestartedFCGSolver
(
std
::
shared_ptr
<
LinearOperator
<
X
,
X
>>
op
,
std
::
shared_ptr
<
ScalarProduct
<
X
>>
sp
,
std
::
shared_ptr
<
Preconditioner
<
X
,
X
>>
prec
,
scalar_real_type
reduction
,
int
maxit
,
int
verbose
,
int
mmax
=
10
)
:
IterativeSolver
<
X
,
X
>
(
op
,
sp
,
prec
,
reduction
,
maxit
,
verbose
),
_mmax
(
mmax
)
{}
/*!
\brief Apply inverse operator.
...
...
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