From 3327e6e2bcab20726ea6d2db491ba72900d69097 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org>
Date: Tue, 14 Jan 2025 09:32:12 +0100
Subject: [PATCH] [test] Test FastAMG with non-blocked BCRSMatrix

---
 dune/istl/paamg/test/fastamg.cc | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/dune/istl/paamg/test/fastamg.cc b/dune/istl/paamg/test/fastamg.cc
index 713475f96..102cc3ca5 100644
--- a/dune/istl/paamg/test/fastamg.cc
+++ b/dune/istl/paamg/test/fastamg.cc
@@ -38,7 +38,7 @@ void randomize(const M& mat, V& b)
   mat.mv(static_cast<const V&>(x), b);
 }
 
-template <int BS>
+template <class MatrixBlock, class VectorBlock>
 void testAMG(int N, int coarsenTarget, int ml)
 {
   std::cout<<"N="<<N<<" coarsenTarget="<<coarsenTarget<<" maxlevel="<<ml<<std::endl;
@@ -46,9 +46,7 @@ void testAMG(int N, int coarsenTarget, int ml)
   typedef Dune::ParallelIndexSet<int,LocalIndex,512> ParallelIndexSet;
 
   ParallelIndexSet indices;
-  typedef Dune::FieldMatrix<double,BS,BS> MatrixBlock;
   typedef Dune::BCRSMatrix<MatrixBlock> BCRSMat;
-  typedef Dune::FieldVector<double,BS> VectorBlock;
   typedef Dune::BlockVector<VectorBlock> Vector;
   typedef Dune::MatrixAdapter<BCRSMat,Vector,Vector> Operator;
   typedef Dune::Communication<void*> Comm;
@@ -137,8 +135,23 @@ try
   if(argc>3)
     ml = atoi(argv[3]);
 
-  testAMG<1>(N, coarsenTarget, ml);
-  testAMG<2>(N, coarsenTarget, ml);
+  {
+    using MB = double;
+    using VB = double;
+    testAMG<MB, VB>(N, coarsenTarget, ml);
+  }
+
+  {
+    using MB = Dune::FieldMatrix<double,1,1>;
+    using VB = Dune::FieldVector<double,1>;
+    testAMG<MB, VB>(N, coarsenTarget, ml);
+  }
+
+  {
+    using MB = Dune::FieldMatrix<double,2,2>;
+    using VB = Dune::FieldVector<double,2>;
+    testAMG<MB, VB>(N, coarsenTarget, ml);
+  }
 
   return 0;
 }
-- 
GitLab