From 04272fe69684789f914b27d2b2181d2ec7db5d6d Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 9 Oct 2012 21:52:30 +0000 Subject: [PATCH] add test for lucky breakdown git-svn-id: https://svn.dealii.org/trunk@27038 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/solver_02.cc | 69 +++++++++++++++++++++++++++++++++ tests/lac/solver_02/cmp/generic | 11 ++++++ 2 files changed, 80 insertions(+) create mode 100644 tests/lac/solver_02.cc create mode 100644 tests/lac/solver_02/cmp/generic diff --git a/tests/lac/solver_02.cc b/tests/lac/solver_02.cc new file mode 100644 index 0000000000..9382f2c0cf --- /dev/null +++ b/tests/lac/solver_02.cc @@ -0,0 +1,69 @@ +//---------------------------------------------------------------------- +// $Id: solver.cc 23710 2011-05-17 04:50:10Z bangerth $ +// +// Copyright (C) 1998 - 2005, 2010 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------- + + +// test lucky breakdown in GMRES (and others) + +#include "../tests.h" +#include "testmatrix.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +void test() +{ + const unsigned int size = 3; + SparsityPattern sparsity(size, size, 1); + sparsity.compress(); + SparseMatrix mat; + mat.reinit(sparsity); + mat = IdentityMatrix(size); + + Vector rhs; + Vector solvec; + solvec.reinit(size); + + rhs.reinit(size); + rhs(size-1)=1.0; + + SolverControl solvctrl(1000, 1e-12, true); + SOLVER solver(solvctrl); + + PreconditionIdentity precond; + solver.solve(mat, solvec, rhs, precond); + solvec.print(deallog); +} + +int main() +{ + std::ofstream logfile("solver_02/output"); + deallog << std::setprecision(4); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test > >(); + test > >(); +// test > >(); + +} + diff --git a/tests/lac/solver_02/cmp/generic b/tests/lac/solver_02/cmp/generic new file mode 100644 index 0000000000..20e12e7200 --- /dev/null +++ b/tests/lac/solver_02/cmp/generic @@ -0,0 +1,11 @@ + +DEAL:GMRES::Check 0 1.000 +DEAL:GMRES::Starting value 1.000 +DEAL:GMRES::Check 1 0 +DEAL:GMRES::Convergence step 1 value 0 +DEAL::0 0 1.000 +DEAL:cg::Check 0 1.000 +DEAL:cg::Starting value 1.000 +DEAL:cg::Check 1 0 +DEAL:cg::Convergence step 1 value 0 +DEAL::0 0 1.000 -- 2.39.5