Skip to content
Snippets Groups Projects
Commit 0558c96c authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[examples] Use more fine-grained version testing for FastAMG

* The way the `FastAMG` preconditioner is set up only works in 2.10.
* Using non-blocked matrices only works in master (>2.10) which is
  now tested as >=2.11, because in the 2.10 CI job, checking fo >2.10
  succeeds.
parent b92f96cc
Branches
Tags
1 merge request!249[examples] Add convenience utility for FastAMG preconditioner and use it in Poisson example
Pipeline #76351 passed
......@@ -202,7 +202,8 @@ int main (int argc, char *argv[]) try
// Technicality: turn the matrix into a linear operator
MatrixAdapter<Matrix,Vector,Vector> op(stiffnessMatrix);
#if DUNE_VERSION_GT(DUNE_ISTL, 2, 10)
// FastAMG is not working for non-blocked matrices in 2.10
#if DUNE_VERSION_GTE(DUNE_ISTL, 2, 11)
auto preconditioner = makeAMGPreconditioner<Vector>(stiffnessMatrix);
#else
// Sequential incomplete LU decomposition as the preconditioner
......
......@@ -22,12 +22,6 @@
#include <dune/istl/multitypeblockmatrix.hh>
#include <dune/istl/multitypeblockvector.hh>
#if DUNE_VERSION_GT(DUNE_ISTL, 2, 10)
#include <dune/istl/paamg/fastamg.hh>
#endif
#include <dune/functions/functionspacebases/interpolate.hh>
#include <dune/functions/functionspacebases/taylorhoodbasis.hh>
#include <dune/functions/backends/istlvectorbackend.hh>
......@@ -66,7 +60,7 @@ using namespace Dune;
#if DUNE_VERSION_GT(DUNE_ISTL, 2, 10)
#if DUNE_VERSION_GTE(DUNE_ISTL, 2, 10)
template<class V, class... P>
class BlockDiagonalPreconditioner : public Preconditioner<V,V> {
......@@ -310,7 +304,7 @@ int main (int argc, char *argv[]) try
// Technicality: turn the matrix into a linear operator
MatrixAdapter<Matrix,Vector,Vector> stiffnessOperator(stiffnessMatrix);
#if DUNE_VERSION_GT(DUNE_ISTL, 2, 10)
#if DUNE_VERSION_GTE(DUNE_ISTL, 2, 10)
// As iterative solver we use MinRes with a block-diagonal preconditioner
// for the saddle point problem. An optimal preconditioner would be obtained,
// if the (0,0)-velocity-block is exact, while the (1,1)-block is the Schur-
......
......@@ -10,7 +10,7 @@
#include <dune/common/typetraits.hh>
#include <dune/common/concept.hh>
#if DUNE_VERSION_GT(DUNE_ISTL, 2, 10)
#if DUNE_VERSION_GTE(DUNE_ISTL, 2, 10)
#include <dune/istl/paamg/fastamg.hh>
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment