From bc8062277bc26b7e30b7f5a981feed5ab8267f27 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 8 Apr 2005 13:15:52 +0000 Subject: [PATCH] subset of lac/solver.cc git-svn-id: https://svn.dealii.org/trunk@10432 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/deal_solver_02.cc | 93 ------------------------------------ tests/bits/deal_solver_03.cc | 93 ------------------------------------ 2 files changed, 186 deletions(-) delete mode 100644 tests/bits/deal_solver_02.cc delete mode 100644 tests/bits/deal_solver_03.cc diff --git a/tests/bits/deal_solver_02.cc b/tests/bits/deal_solver_02.cc deleted file mode 100644 index b18bb61688..0000000000 --- a/tests/bits/deal_solver_02.cc +++ /dev/null @@ -1,93 +0,0 @@ - -//---------------------------- deal_solver_02.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004 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. -// -//---------------------------- deal_solver_02.cc --------------------------- - -// test the BiCGStab solver - - - -#include "../tests.h" -#include "../lac/testmatrix.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -void -check_solve( SOLVER& solver, const MATRIX& A, - VECTOR& u, VECTOR& f, const PRECONDITION& P) -{ - deallog << "Solver type: " << typeid(solver).name() << std::endl; - - u = 0.; - f = 1.; - try - { - solver.solve(A,u,f,P); - } - catch (std::exception& e) - { - deallog << e.what() << std::endl; - abort (); - } - - deallog << "Solver stopped after " << solver.control().last_step() - << " iterations" << std::endl; -} - - -int main() -{ - std::ofstream logfile("deal_solver_02.output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - - GrowingVectorMemory<> mem; - SolverControl control(100, 1.e-3); - - const unsigned int size = 32; - unsigned int dim = (size-1)*(size-1); - - deallog << "Size " << size << " Unknowns " << dim << std::endl; - - // Make matrix - FDMatrix testproblem(size, size); - SparsityPattern structure(dim, dim, 5); - testproblem.five_point_structure(structure); - structure.compress(); - SparseMatrix A(structure); - testproblem.five_point(A); - - Vector f(dim); - Vector u(dim); - f = 1.; - - SolverBicgstab<> solver(control, mem); - PreconditionIdentity preconditioner; - check_solve (solver, A,u,f, preconditioner); -} - diff --git a/tests/bits/deal_solver_03.cc b/tests/bits/deal_solver_03.cc deleted file mode 100644 index 5005b3d412..0000000000 --- a/tests/bits/deal_solver_03.cc +++ /dev/null @@ -1,93 +0,0 @@ - -//---------------------------- deal_solver_03.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004 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. -// -//---------------------------- deal_solver_03.cc --------------------------- - -// test the GMRES solver - - - -#include "../tests.h" -#include "../lac/testmatrix.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -void -check_solve( SOLVER& solver, const MATRIX& A, - VECTOR& u, VECTOR& f, const PRECONDITION& P) -{ - deallog << "Solver type: " << typeid(solver).name() << std::endl; - - u = 0.; - f = 1.; - try - { - solver.solve(A,u,f,P); - } - catch (std::exception& e) - { - deallog << e.what() << std::endl; - abort (); - } - - deallog << "Solver stopped after " << solver.control().last_step() - << " iterations" << std::endl; -} - - -int main() -{ - std::ofstream logfile("deal_solver_03.output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - - GrowingVectorMemory<> mem; - SolverControl control(100, 1.e-3); - - const unsigned int size = 32; - unsigned int dim = (size-1)*(size-1); - - deallog << "Size " << size << " Unknowns " << dim << std::endl; - - // Make matrix - FDMatrix testproblem(size, size); - SparsityPattern structure(dim, dim, 5); - testproblem.five_point_structure(structure); - structure.compress(); - SparseMatrix A(structure); - testproblem.five_point(A); - - Vector f(dim); - Vector u(dim); - f = 1.; - - SolverGMRES<> solver(control, mem); - PreconditionIdentity preconditioner; - check_solve (solver, A,u,f, preconditioner); -} - -- 2.39.5