From 1c5266521782deaa05bf90c419e965c988c365f7 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 8 Jul 2016 13:48:52 +0200
Subject: [PATCH] Tests: Cover partial Dirichlet BC where supported

---
 dune/solvers/test/gssteptest.cc | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/dune/solvers/test/gssteptest.cc b/dune/solvers/test/gssteptest.cc
index 0f735687..30b8e58b 100644
--- a/dune/solvers/test/gssteptest.cc
+++ b/dune/solvers/test/gssteptest.cc
@@ -24,13 +24,14 @@
   *  is solved correctly for a random rhs by a LoopSolver employing
   *  a GSStep.
   */
-template <size_t blocksize>
+template <size_t blocksize, bool trivialDirichletOnly = true>
 struct GSTestSuite {
   template <class GridType>
   bool check(const GridType& grid) {
     bool passed = true;
 
-    using Problem = SymmetricSampleProblem<blocksize, typename GridType::LevelGridView>;
+    using Problem = SymmetricSampleProblem<blocksize, typename GridType::LevelGridView,
+                                           trivialDirichletOnly>;
     Problem p(grid.levelGridView(grid.maxLevel()));
 
     const auto verbosity = Solver::QUIET;
@@ -144,14 +145,19 @@ struct GSTestSuite {
               Matrix, Vector>::createPtrFromConfig(config);
           auto gsString2 = Dune::formatString("Dune::Solvers::BlockGS(%s) %s",
                                               type, reg ? "regularized" : "");
-          test(&gsStep1, gsString1);
-          test(gsStep2Ptr.get(), gsString2);
-          diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-8);
+          if (trivialDirichletOnly) { // TODO: missing feature in SDBlockGS
+              test(&gsStep1, gsString1);
+              test(gsStep2Ptr.get(), gsString2);
+              diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-8);
+          } else {
+              test(gsStep2Ptr.get(), gsString2);
+          }
         }
       }
     }
 
     // test projected block GS
+    if (trivialDirichletOnly) // TODO: missing feature in ProjectedBlockGS
     {
       size_t size = p.u.size();
       using GSStep = ProjectedBlockGSStep<Matrix, Vector>;
@@ -186,5 +192,10 @@ int main(int argc, char** argv) {
   GSTestSuite<2> testsuite2;
   passed &= checkWithStandardGrids(testsuite2);
 
+  std::cout << std::endl;
+
+  GSTestSuite<2, false> testsuite2f;
+  passed &= checkWithStandardGrids(testsuite2f);
+
   return passed ? 0 : 1;
 }
-- 
GitLab