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
53f54f99
Commit
53f54f99
authored
11 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Adds an adapter that turns an InverseOperator into a Preconditioner.
This fixes FS #1224
parent
28194295
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/istl/preconditioners.hh
+51
-0
51 additions, 0 deletions
dune/istl/preconditioners.hh
dune/istl/test/CMakeLists.txt
+2
-0
2 additions, 0 deletions
dune/istl/test/CMakeLists.txt
dune/istl/test/Makefile.am
+3
-0
3 additions, 0 deletions
dune/istl/test/Makefile.am
with
56 additions
and
0 deletions
dune/istl/preconditioners.hh
+
51
−
0
View file @
53f54f99
...
...
@@ -122,6 +122,57 @@ namespace Dune {
virtual
~
Preconditioner
()
{}
};
template
<
class
X
,
class
Y
>
class
InverseOperator
;
class
InverseOperatorResult
;
/**
* @brief Turns an InverseOperator into a Preconditioner.
* @tparam O The type of the inverse operator to wrap.
*/
template
<
class
O
,
int
c
>
class
InverseOperator2Preconditioner
:
public
Preconditioner
<
typename
O
::
domain_type
,
typename
O
::
range_type
>
{
public:
//! \brief The domain type of the preconditioner.
typedef
typename
O
::
domain_type
domain_type
;
//! \brief The range type of the preconditioner.
typedef
typename
O
::
range_type
range_type
;
//! \brief The field type of the preconditioner.
typedef
typename
range_type
::
field_type
field_type
;
typedef
O
InverseOperator
;
// define the category
enum
{
//! \brief The category the preconditioner is part of.
category
=
c
};
/**
* @brief Construct the preconditioner from the solver
* @param inverse_operator The inverse operator to wrap.
*/
InverseOperator2Preconditioner
(
InverseOperator
&
inverse_operator
)
:
inverse_operator_
(
inverse_operator
)
{}
void
pre
(
domain_type
&
,
range_type
&
)
{}
void
apply
(
domain_type
&
v
,
const
range_type
&
d
)
{
InverseOperatorResult
res
;
range_type
copy
(
d
);
inverse_operator_
.
apply
(
v
,
copy
,
res
);
}
void
post
(
domain_type
&
)
{}
private
:
InverseOperator
&
inverse_operator_
;
};
//=====================================================================
// Implementation of this interface for sequential ISTL-preconditioners
...
...
This diff is collapsed.
Click to expand it.
dune/istl/test/CMakeLists.txt
+
2
−
0
View file @
53f54f99
...
...
@@ -4,6 +4,7 @@ set(NORMALTEST
bcrsbuildtest
dotproducttest
iotest
inverseoperator2prectest
matrixiteratortest
matrixtest
matrixutilstest
...
...
@@ -50,6 +51,7 @@ add_executable(matrixiteratortest "matrixiteratortest.cc")
add_executable
(
mmtest mmtest.cc
)
add_executable
(
mv
"mv.cc"
)
add_executable
(
iotest
"iotest.cc"
)
add_executable
(
inverseoperator2prectest
"inverseoperator2prectest.cc"
)
add_executable
(
scaledidmatrixtest
"scaledidmatrixtest.cc"
)
add_executable
(
seqmatrixmarkettest
"matrixmarkettest.cc"
)
#set_target_properties(seqmatrixmarkettest PROPERTIES COMPILE_FLAGS
...
...
This diff is collapsed.
Click to expand it.
dune/istl/test/Makefile.am
+
3
−
0
View file @
53f54f99
...
...
@@ -23,6 +23,7 @@ NORMALTESTS = basearraytest \
complexrhstest
\
dotproducttest
\
iotest
\
inverseoperator2prectest
\
matrixiteratortest
\
matrixtest
\
matrixutilstest
\
...
...
@@ -103,6 +104,8 @@ mv_SOURCES = mv.cc
iotest_SOURCES
=
iotest.cc
inverseoperator2prectest_SOURCES
=
inverseoperator2prectest.cc
scaledidmatrixtest_SOURCES
=
scaledidmatrixtest.cc
if
MPI
...
...
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