Skip to content
Snippets Groups Projects
Commit ae2acb3f authored by Max Kahnt's avatar Max Kahnt
Browse files

Add ProjectedBlockGSStep test.

parent 8f72feb2
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <dune/solvers/solvers/loopsolver.hh> #include <dune/solvers/solvers/loopsolver.hh>
#include <dune/solvers/iterationsteps/blockgsstep.hh> #include <dune/solvers/iterationsteps/blockgsstep.hh>
#include <dune/solvers/iterationsteps/projectedblockgsstep.hh>
#include <dune/solvers/iterationsteps/semidefiniteblockgsstep.hh> #include <dune/solvers/iterationsteps/semidefiniteblockgsstep.hh>
#include "common.hh" #include "common.hh"
...@@ -55,7 +56,7 @@ struct GSTestSuite ...@@ -55,7 +56,7 @@ struct GSTestSuite
bool check(const GridType& grid) bool check(const GridType& grid)
{ {
double stepTol = 1e-12; // termination criterion double stepTol = 1e-12; // termination criterion
double solveTol = 1e-6; // error in the solution double solveTol = 1.3e-5; // error in the solution
int maxIterations = 10000; int maxIterations = 10000;
bool passed = true; bool passed = true;
...@@ -97,6 +98,27 @@ struct GSTestSuite ...@@ -97,6 +98,27 @@ struct GSTestSuite
test(&gsStep, "BlockGS"); test(&gsStep, "BlockGS");
} }
{
size_t size = p.u.size();
using GSStep = ProjectedBlockGSStep<Matrix, Vector>;
ProjectedBlockGSStep<Matrix, Vector> gsStep;
typename GSStep::HasObstacle hasObstacle(size, false);
gsStep.hasObstacle_ = &hasObstacle;
test(&gsStep, "ProjectedBlockGS w/o obstacle");
hasObstacle.setAll();
std::vector<typename GSStep::Obstacle> obstacles(size);
for(size_t i=0; i<size; ++i) {
hasObstacle[i] = true;
for(size_t j=0; j<Vector::block_type::dimension; ++j) {
obstacles[i].lower(j) = j;
obstacles[i].upper(j) = j+1;
}
}
gsStep.obstacles_ = &obstacles;
test(&gsStep, "ProjectedBlockGS w obstacle");
}
for(auto reg : {false, true}) { for(auto reg : {false, true}) {
for(auto type : {"direct", "ldlt", "cg"}) { for(auto type : {"direct", "ldlt", "cg"}) {
Dune::ParameterTree config; Dune::ParameterTree config;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment