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
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment