Skip to content
Snippets Groups Projects
Commit 1c526652 authored by Elias Pipping's avatar Elias Pipping
Browse files

Tests: Cover partial Dirichlet BC where supported

parent e305586a
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -24,13 +24,14 @@ ...@@ -24,13 +24,14 @@
* is solved correctly for a random rhs by a LoopSolver employing * is solved correctly for a random rhs by a LoopSolver employing
* a GSStep. * a GSStep.
*/ */
template <size_t blocksize> template <size_t blocksize, bool trivialDirichletOnly = true>
struct GSTestSuite { struct GSTestSuite {
template <class GridType> template <class GridType>
bool check(const GridType& grid) { bool check(const GridType& grid) {
bool passed = true; bool passed = true;
using Problem = SymmetricSampleProblem<blocksize, typename GridType::LevelGridView>; using Problem = SymmetricSampleProblem<blocksize, typename GridType::LevelGridView,
trivialDirichletOnly>;
Problem p(grid.levelGridView(grid.maxLevel())); Problem p(grid.levelGridView(grid.maxLevel()));
const auto verbosity = Solver::QUIET; const auto verbosity = Solver::QUIET;
...@@ -144,14 +145,19 @@ struct GSTestSuite { ...@@ -144,14 +145,19 @@ struct GSTestSuite {
Matrix, Vector>::createPtrFromConfig(config); Matrix, Vector>::createPtrFromConfig(config);
auto gsString2 = Dune::formatString("Dune::Solvers::BlockGS(%s) %s", auto gsString2 = Dune::formatString("Dune::Solvers::BlockGS(%s) %s",
type, reg ? "regularized" : ""); type, reg ? "regularized" : "");
test(&gsStep1, gsString1); if (trivialDirichletOnly) { // TODO: missing feature in SDBlockGS
test(gsStep2Ptr.get(), gsString2); test(&gsStep1, gsString1);
diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-8); test(gsStep2Ptr.get(), gsString2);
diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-8);
} else {
test(gsStep2Ptr.get(), gsString2);
}
} }
} }
} }
// test projected block GS // test projected block GS
if (trivialDirichletOnly) // TODO: missing feature in ProjectedBlockGS
{ {
size_t size = p.u.size(); size_t size = p.u.size();
using GSStep = ProjectedBlockGSStep<Matrix, Vector>; using GSStep = ProjectedBlockGSStep<Matrix, Vector>;
...@@ -186,5 +192,10 @@ int main(int argc, char** argv) { ...@@ -186,5 +192,10 @@ int main(int argc, char** argv) {
GSTestSuite<2> testsuite2; GSTestSuite<2> testsuite2;
passed &= checkWithStandardGrids(testsuite2); passed &= checkWithStandardGrids(testsuite2);
std::cout << std::endl;
GSTestSuite<2, false> testsuite2f;
passed &= checkWithStandardGrids(testsuite2f);
return passed ? 0 : 1; return passed ? 0 : 1;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment