diff --git a/dune/solvers/test/projectedgradienttest.cc b/dune/solvers/test/projectedgradienttest.cc index b85f917ec55407e75f4be0c9d198c9834473772d..437f0406f5fcc577d05666661ca1596ae9ca67ac 100644 --- a/dune/solvers/test/projectedgradienttest.cc +++ b/dune/solvers/test/projectedgradienttest.cc @@ -78,7 +78,7 @@ bool solveObstacleProblemByProjectedGradientSolver(const GridType& grid, const M template <class GridType> -bool checkWithGrid(const GridType& grid, const std::string fileName="") +bool checkWithGrid(const GridType& grid, const std::string fileName, int maxIterations) { bool passed = true; @@ -115,7 +115,7 @@ bool checkWithGrid(const GridType& grid, const std::string fileName="") markBoundaryDOFs(gridView, ignore); - solveObstacleProblemByProjectedGradientSolver(grid, A, u, rhs, ignore); + solveObstacleProblemByProjectedGradientSolver(grid, A, u, rhs, ignore, maxIterations); if (fileName!="") { @@ -129,7 +129,7 @@ bool checkWithGrid(const GridType& grid, const std::string fileName="") template <int dim> -bool checkWithYaspGrid(int refine, const std::string fileName="") +bool checkWithYaspGrid(int refine, const std::string fileName, int maxIterations) { bool passed = true; @@ -150,7 +150,7 @@ bool checkWithYaspGrid(int refine, const std::string fileName="") std::cout << "Number of levels: " << (grid.maxLevel()+1) << std::endl; std::cout << "Number of leaf nodes: " << grid.leafGridView().size(dim) << std::endl; - passed = passed and checkWithGrid(grid, fileName); + passed = passed and checkWithGrid(grid, fileName, maxIterations); return passed; @@ -164,9 +164,13 @@ int main(int argc, char** argv) try bool passed(true); - int refine1d = 16; - int refine2d = 8; - int refine3d = 5; + int refine1d = 7; + int refine2d = 5; + int refine3d = 4; + + int maxIter1D = 10000; + int maxIter2D = 1000; + int maxIter3D = 100; if (argc>1) std::istringstream(argv[1]) >> refine1d; @@ -175,9 +179,9 @@ int main(int argc, char** argv) try if (argc>3) std::istringstream(argv[3]) >> refine3d; - passed = passed and checkWithYaspGrid<1>(refine1d, "projectedgradienttest_yasp_1d_solution"); - passed = passed and checkWithYaspGrid<2>(refine2d, "projectedgradienttest_yasp_2d_solution"); - passed = passed and checkWithYaspGrid<3>(refine3d, "projectedgradienttest_yasp_3d_solution"); + passed = passed and checkWithYaspGrid<1>(refine1d, "projectedgradienttest_yasp_1d_solution", maxIter1D); + passed = passed and checkWithYaspGrid<2>(refine2d, "projectedgradienttest_yasp_2d_solution", maxIter2D); + passed = passed and checkWithYaspGrid<3>(refine3d, "projectedgradienttest_yasp_3d_solution", maxIter3D); return passed ? 0 : 1; }