Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
agnumpde
dune-solvers
Commits
542a2f30
Commit
542a2f30
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
experimental wrapper for the ISTL SeqILU0 preconditioner
[[Imported from SVN: r3133]]
parent
da5987c7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune-solvers/iterationsteps/istlseqilu0step.hh
+89
-0
89 additions, 0 deletions
dune-solvers/iterationsteps/istlseqilu0step.hh
with
89 additions
and
0 deletions
dune-solvers/iterationsteps/istlseqilu0step.hh
0 → 100644
+
89
−
0
View file @
542a2f30
#ifndef ISTL_SEQILU0_STEP_HH
#define ISTL_SEQILU0_STEP_HH
/** \file
\brief A wrapper class for the ISTL SeqILU0 implementation
*/
#include
<memory>
#include
<dune-solvers/iterationsteps/lineariterationstep.hh>
#include
<dune/istl/preconditioners.hh>
#include
<dune/istl/operators.hh>
/** \brief A wrapper class for the ISTL SeqILU0 implementation
*/
template
<
class
MatrixType
,
class
VectorType
>
class
ISTLSeqILU0Step
:
public
LinearIterationStep
<
MatrixType
,
VectorType
>
{
typedef
Dune
::
MatrixAdapter
<
MatrixType
,
VectorType
,
VectorType
>
Operator
;
typedef
Dune
::
SeqILU0
<
MatrixType
,
VectorType
,
VectorType
>
SeqILU0
;
public:
/** \brief Constructor which initializes and sets up an algebraic hierarchy
\param smootherArgs Arguments for the smoother. See the dune-istl documentation for details
\param coarseningCriterion Arguments for the coarsening. See the dune-istl documentation for details
*/
ISTLSeqILU0Step
(
const
MatrixType
*
stiffnessMatrix
,
VectorType
&
x
,
VectorType
&
rhs
,
double
relaxationFactor
)
:
relaxationFactor_
(
relaxationFactor
)
{
setProblem
(
*
stiffnessMatrix
,
x
,
rhs
);
seqILU0_
=
std
::
auto_ptr
<
SeqILU0
>
(
new
SeqILU0
(
*
stiffnessMatrix
,
relaxationFactor
));
seqILU0_
->
pre
(
*
this
->
x_
,
*
this
->
rhs_
);
}
/** \brief Initialize the iteration step but don't actually build the matrix hierarchy yet */
ISTLSeqILU0Step
(
const
MatrixType
*
stiffnessMatrix
,
VectorType
&
x
,
VectorType
&
rhs
)
{
setProblem
(
*
stiffnessMatrix
,
x
,
rhs
);
}
/** \brief Sets up an algebraic hierarchy
*/
virtual
void
preprocess
();
/** \brief Perform one iteration */
virtual
void
iterate
();
/** \brief Get the solution */
virtual
VectorType
getSol
();
private
:
/** \brief The dune-istl sequential ILU0 preconditioner */
std
::
auto_ptr
<
SeqILU0
>
seqILU0_
;
/** \brief Some magic relaxation factor */
double
relaxationFactor_
;
};
template
<
class
MatrixType
,
class
VectorType
>
void
ISTLSeqILU0Step
<
MatrixType
,
VectorType
>::
preprocess
()
{
seqILU0_
=
std
::
auto_ptr
<
SeqILU0
>
(
new
SeqILU0
(
*
this
->
mat_
,
relaxationFactor_
));
seqILU0_
->
pre
(
*
this
->
x_
,
*
this
->
rhs_
);
}
template
<
class
MatrixType
,
class
VectorType
>
void
ISTLSeqILU0Step
<
MatrixType
,
VectorType
>::
iterate
()
{
seqILU0_
->
apply
(
*
this
->
x_
,
*
this
->
rhs_
);
}
template
<
class
MatrixType
,
class
VectorType
>
VectorType
ISTLSeqILU0Step
<
MatrixType
,
VectorType
>::
getSol
()
{
return
*
this
->
x_
;
}
#endif
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