From e3f5916d3421b9531c920660d935b613729bd794 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Fri, 7 Nov 2008 12:30:37 +0000 Subject: [PATCH] Updated the Trilinos tests so that most of them are working now. Need to check some outputs, and need to find out what goes wrong in sparse_matrix_vector_04. git-svn-id: https://svn.dealii.org/trunk@17510 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/trilinos/02.cc | 6 ++ tests/trilinos/03.cc | 8 ++ tests/trilinos/03a.cc | 2 - tests/trilinos/03b.cc | 4 +- tests/trilinos/09.cc | 1 - tests/trilinos/10.cc | 1 - tests/trilinos/12.cc | 4 +- tests/trilinos/13.cc | 4 +- tests/trilinos/14.cc | 4 +- tests/trilinos/15.cc | 4 +- tests/trilinos/16.cc | 4 +- tests/trilinos/20.cc | 4 +- tests/trilinos/21.cc | 4 +- tests/trilinos/29.cc | 2 +- tests/trilinos/30.cc | 2 +- tests/trilinos/52.cc | 1 - tests/trilinos/53.cc | 4 +- tests/trilinos/54.cc | 4 +- tests/trilinos/55.cc | 4 +- tests/trilinos/56.cc | 4 +- tests/trilinos/62.cc | 4 +- tests/trilinos/63.cc | 2 +- tests/trilinos/64.cc | 24 +++-- tests/trilinos/65.cc | 3 +- tests/trilinos/66.cc | 8 +- tests/trilinos/67.cc | 8 +- tests/trilinos/68.cc | 8 +- tests/trilinos/69.cc | 8 +- tests/trilinos/70.cc | 2 +- tests/trilinos/block_vector_iterator_01.cc | 6 +- tests/trilinos/block_vector_iterator_02.cc | 6 +- tests/trilinos/deal_solver_01.cc | 4 +- tests/trilinos/deal_solver_02.cc | 2 +- tests/trilinos/deal_solver_03.cc | 2 +- tests/trilinos/deal_solver_05.cc | 2 +- tests/trilinos/parallel_sparse_matrix_01.cc | 41 +++----- tests/trilinos/slowness_01.cc | 7 +- tests/trilinos/slowness_02.cc | 21 ++-- tests/trilinos/slowness_03.cc | 32 ++++--- tests/trilinos/slowness_04.cc | 31 +++--- tests/trilinos/solver_01.cc | 94 ------------------ tests/trilinos/solver_01/cmp/generic | 7 -- tests/trilinos/solver_02.cc | 93 ------------------ tests/trilinos/solver_02/cmp/generic | 7 -- tests/trilinos/solver_03.cc | 5 +- tests/trilinos/solver_04.cc | 92 ------------------ tests/trilinos/solver_04/cmp/generic | 6 -- tests/trilinos/solver_05.cc | 5 +- tests/trilinos/solver_06.cc | 3 +- tests/trilinos/solver_07.cc | 19 ++-- tests/trilinos/solver_08.cc | 3 +- tests/trilinos/solver_09.cc | 96 ------------------- tests/trilinos/solver_09/cmp/generic | 7 -- .../cmp/i386-apple-darwin8.10.1+gcc4.0 | 7 -- .../cmp/powerpc-apple-darwin8.10.0+gcc4.0 | 7 -- .../cmp/x86_64-unknown-linux-gnu+gcc3.3 | 7 -- .../cmp/x86_64-unknown-linux-gnu+gcc4.1 | 7 -- tests/trilinos/solver_10.cc | 92 ------------------ tests/trilinos/solver_10/cmp/generic | 6 -- tests/trilinos/solver_11.cc | 93 ------------------ tests/trilinos/solver_11/cmp/generic | 7 -- .../cmp/i386-apple-darwin8.10.1+gcc4.0 | 7 -- .../cmp/powerpc-apple-darwin8.10.0+gcc4.0 | 7 -- .../cmp/x86_64-unknown-linux-gnu+gcc3.3 | 7 -- .../cmp/x86_64-unknown-linux-gnu+gcc4.1 | 7 -- 65 files changed, 172 insertions(+), 811 deletions(-) delete mode 100644 tests/trilinos/solver_01.cc delete mode 100644 tests/trilinos/solver_01/cmp/generic delete mode 100644 tests/trilinos/solver_02.cc delete mode 100644 tests/trilinos/solver_02/cmp/generic delete mode 100644 tests/trilinos/solver_04.cc delete mode 100644 tests/trilinos/solver_04/cmp/generic delete mode 100644 tests/trilinos/solver_09.cc delete mode 100644 tests/trilinos/solver_09/cmp/generic delete mode 100644 tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 delete mode 100644 tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 delete mode 100644 tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 delete mode 100644 tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 delete mode 100644 tests/trilinos/solver_10.cc delete mode 100644 tests/trilinos/solver_10/cmp/generic delete mode 100644 tests/trilinos/solver_11.cc delete mode 100644 tests/trilinos/solver_11/cmp/generic delete mode 100644 tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 delete mode 100644 tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 delete mode 100644 tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 delete mode 100644 tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 diff --git a/tests/trilinos/02.cc b/tests/trilinos/02.cc index 504c39b2a5..b6bf4bcdca 100644 --- a/tests/trilinos/02.cc +++ b/tests/trilinos/02.cc @@ -25,6 +25,12 @@ void test (TrilinosWrappers::SparseMatrix &m) { // first set a few entries + for (unsigned int i=0; i @@ -24,7 +24,7 @@ #include -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() != 0, ExcInternalError()); Assert (m.n() != 0, ExcInternalError()); diff --git a/tests/trilinos/63.cc b/tests/trilinos/63.cc index 04db7ad9cb..e5201c53e2 100644 --- a/tests/trilinos/63.cc +++ b/tests/trilinos/63.cc @@ -22,7 +22,7 @@ #include -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() == 100, ExcInternalError()); Assert (m.n() == 100, ExcInternalError()); diff --git a/tests/trilinos/64.cc b/tests/trilinos/64.cc index 41c1f1f417..406d31e49f 100644 --- a/tests/trilinos/64.cc +++ b/tests/trilinos/64.cc @@ -12,15 +12,14 @@ //---------------------------- trilinos_64.cc --------------------------- -// This test should be run on multiple processors. note that this test also -// started to fail with the upgrade to petsc 2.2.1 which required a fix in -// TrilinosWrappers::MatrixBase::operator= +// This test should be run on multiple processors. #include "../tests.h" #include #include -#include +#include +#include #include #include @@ -31,7 +30,8 @@ template void test (MatrixType &m) { - m.add(0,0,1); + m.set(0,0,1.); + m.compress(); m = 0; m.compress(); @@ -64,14 +64,12 @@ int main (int argc,char **argv) // check // TrilinosWrappers::SparseMatrix - MPI_Comm mpi_communicator (MPI_COMM_WORLD); - int n_jobs=1; - MPI_Comm_size (mpi_communicator, &n_jobs); - const unsigned int n_mpi_processes=static_cast(n_jobs); - Assert(n_dofs%n_mpi_processes==0, ExcInternalError()); - const unsigned int n_local_dofs=n_dofs/n_mpi_processes; - TrilinosWrappers::SparseMatrix - v2 (mpi_communicator, n_dofs, n_dofs, n_local_dofs, n_local_dofs, 5); + const unsigned int n_jobs = + Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()); + Assert(n_dofs%n_jobs==0, ExcInternalError()); + const unsigned int n_local_dofs=n_dofs/n_jobs; + Epetra_Map map(n_dofs, n_local_dofs, Utilities::Trilinos::comm_world()); + TrilinosWrappers::SparseMatrix v2 (map, 5); test (v2); } } diff --git a/tests/trilinos/65.cc b/tests/trilinos/65.cc index 862c98050e..05f3596ac5 100644 --- a/tests/trilinos/65.cc +++ b/tests/trilinos/65.cc @@ -26,7 +26,8 @@ void test () { - TrilinosWrappers::MPI::Vector v(PETSC_COMM_WORLD, 100, 100); + TrilinosWrappers::MPI::Vector + v (Epetra_Map(100,0,Utilities::Trilinos::comm_world())); v(0) = 1; v = 0; diff --git a/tests/trilinos/66.cc b/tests/trilinos/66.cc index e90259a056..7e723a8190 100644 --- a/tests/trilinos/66.cc +++ b/tests/trilinos/66.cc @@ -24,7 +24,7 @@ #include -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() != 0, ExcInternalError()); Assert (m.n() != 0, ExcInternalError()); @@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m) if (i>=5) { const double s = rand(); - m.add (i,i-5, s); + m.set (i,i-5, s); norm_sqr += s*s; ++nnz; } @@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m) if (i -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() != 0, ExcInternalError()); Assert (m.n() != 0, ExcInternalError()); @@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m) if (i>=5) { const double s = rand(); - m.add (i,i-5, s); + m.set (i,i-5, s); norm_sqr += s*s; ++nnz; } @@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m) if (i -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() != 0, ExcInternalError()); Assert (m.n() != 0, ExcInternalError()); @@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m) if (i>=5) { const double s = rand(); - m.add (i,i-5, s); + m.set (i,i-5, s); norm_sqr += s*s; ++nnz; } @@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m) if (i -void test (TrilinosWrappers::MatrixBase &m) +void test (TrilinosWrappers::SparseMatrix &m) { Assert (m.m() != 0, ExcInternalError()); Assert (m.n() != 0, ExcInternalError()); @@ -38,7 +38,7 @@ void test (TrilinosWrappers::MatrixBase &m) if (i>=5) { const double s = rand(); - m.add (i,i-5, s); + m.set (i,i-5, s); norm_sqr += s*s; ++nnz; } @@ -46,13 +46,13 @@ void test (TrilinosWrappers::MatrixBase &m) if (i -int main () +int main (int argc, char** argv) { std::ofstream logfile("70/output"); deallog.attach(logfile); diff --git a/tests/trilinos/block_vector_iterator_01.cc b/tests/trilinos/block_vector_iterator_01.cc index 2e4018f033..3fc9662b15 100644 --- a/tests/trilinos/block_vector_iterator_01.cc +++ b/tests/trilinos/block_vector_iterator_01.cc @@ -23,7 +23,11 @@ void test () { - TrilinosWrappers::BlockVector v(2,1); + TrilinosWrappers::BlockVector v(2); + for (unsigned int i=0; i mem; - SolverCG solver(control,mem); + SolverCG solver(control, mem); PreconditionIdentity preconditioner; check_solve (solver, A,u,f, preconditioner); } diff --git a/tests/trilinos/deal_solver_02.cc b/tests/trilinos/deal_solver_02.cc index 327d5e1cf0..71dd9153ca 100644 --- a/tests/trilinos/deal_solver_02.cc +++ b/tests/trilinos/deal_solver_02.cc @@ -72,7 +72,7 @@ int main(int argc, char **argv) { - SolverControl control(100, 1.e-3); + SolverControl control(200, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); diff --git a/tests/trilinos/deal_solver_03.cc b/tests/trilinos/deal_solver_03.cc index e9a3fe4f6f..af4958ebf1 100644 --- a/tests/trilinos/deal_solver_03.cc +++ b/tests/trilinos/deal_solver_03.cc @@ -72,7 +72,7 @@ int main(int argc, char **argv) { - SolverControl control(100, 1.e-3); + SolverControl control(2000, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); diff --git a/tests/trilinos/deal_solver_05.cc b/tests/trilinos/deal_solver_05.cc index 8c8c0b5359..89667e2c5e 100644 --- a/tests/trilinos/deal_solver_05.cc +++ b/tests/trilinos/deal_solver_05.cc @@ -70,7 +70,7 @@ int main(int argc, char **argv) { - SolverControl control(100, 1.e-3); + SolverControl control(200, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); diff --git a/tests/trilinos/parallel_sparse_matrix_01.cc b/tests/trilinos/parallel_sparse_matrix_01.cc index 0b80cc8cf2..60919c0e62 100644 --- a/tests/trilinos/parallel_sparse_matrix_01.cc +++ b/tests/trilinos/parallel_sparse_matrix_01.cc @@ -31,36 +31,19 @@ #include -unsigned int -get_n_mpi_processes () -{ - int n_jobs; - MPI_Comm_size (MPI_COMM_WORLD, &n_jobs); - - return n_jobs; -} - - - -unsigned int -get_this_mpi_process () -{ - int rank; - MPI_Comm_rank (MPI_COMM_WORLD, &rank); - - return rank; -} - - void test () { // create a parallel matrix where the first // process has 10 rows, the second one 20, // the third one 30, and so on unsigned int N = 0; - std::vector local_rows_per_process (get_n_mpi_processes()); - std::vector start_row (get_n_mpi_processes()); - for (unsigned int i=0; i local_rows_per_process + (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world())); + std::vector start_row + (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world())); + for (unsigned int i=0; + i0) { - matrix.add(global-1, global, -1); - matrix.add(global, global-1, -1); + matrix.set(global-1, global, -1); + matrix.set(global, global-1, -1); } if (j0) { - matrix.add(global-N, global, -1); - matrix.add(global, global-N, -1); + matrix.set(global-N, global, -1); + matrix.set(global, global-N, -1); } if (i0) { - matrix.add(global-1, global, -1); - matrix.add(global, global-1, -1); + matrix.set(global-1, global, -1); + matrix.set(global, global-1, -1); } if (j0) { - matrix.add(global-N, global, -1); - matrix.add(global, global-N, -1); + matrix.set(global-N, global, -1); + matrix.set(global, global-N, -1); } if (i0) { - matrix.add(global-1, global, rand()); - matrix.add(global, global-1, rand()); + matrix.set(global-1, global, rand()); + matrix.set(global, global-1, rand()); } if (j0) { - matrix.add(global-N, global, rand()); - matrix.add(global, global-N, rand()); + matrix.set(global-N, global, rand()); + matrix.set(global, global-N, rand()); } if (i -#include "../lac/testmatrix.h" -#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; - // it needs to be expected for the - // richardson solver that we end up - // here, so don't abort - } - - deallog << "Solver stopped after " << solver.control().last_step() - << " iterations" << std::endl; -} - - -int main(int argc, char **argv) -{ - std::ofstream logfile("solver_01/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverRichardson solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_01/cmp/generic b/tests/trilinos/solver_01/cmp/generic deleted file mode 100644 index 208bfd4911..0000000000 --- a/tests/trilinos/solver_01/cmp/generic +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers16SolverRichardsonE -DEAL::Starting value 7.750 -DEAL::Failure step 100 value 4.004 -DEAL::Iterative method reported convergence failure in step 100 with residual 4.00437 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_02.cc b/tests/trilinos/solver_02.cc deleted file mode 100644 index ec6cedce98..0000000000 --- a/tests/trilinos/solver_02.cc +++ /dev/null @@ -1,93 +0,0 @@ -//---------------------------- trilinos_solver_02.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004, 2005, 2008 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. -// -//---------------------------- trilinos_solver_02.cc --------------------------- - -// test the Trilinos Chebychev solver - - -#include "../tests.h" -#include -#include "../lac/testmatrix.h" -#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; - // just like for Richardson: we end up - // here normally for this solver - } - - deallog << "Solver stopped after " << solver.control().last_step() - << " iterations" << std::endl; -} - - -int main(int argc, char **argv) -{ - std::ofstream logfile("solver_02/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverChebychev solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_02/cmp/generic b/tests/trilinos/solver_02/cmp/generic deleted file mode 100644 index ec6166756a..0000000000 --- a/tests/trilinos/solver_02/cmp/generic +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers15SolverChebychevE -DEAL::Starting value 7.745 -DEAL::Failure step 100 value 3.885 -DEAL::Iterative method reported convergence failure in step 100 with residual 3.88526 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_03.cc b/tests/trilinos/solver_03.cc index 5fa013f82b..f10862d954 100644 --- a/tests/trilinos/solver_03.cc +++ b/tests/trilinos/solver_03.cc @@ -65,7 +65,7 @@ int main(int argc, char **argv) { - SolverControl control(100, 1.e-3); + SolverControl control(200, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); @@ -85,7 +85,8 @@ int main(int argc, char **argv) u.compress (); TrilinosWrappers::SolverCG solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); + TrilinosWrappers::PreconditionJacobi preconditioner; + preconditioner.initialize(A); check_solve (solver, A,u,f, preconditioner); } } diff --git a/tests/trilinos/solver_04.cc b/tests/trilinos/solver_04.cc deleted file mode 100644 index aae751de12..0000000000 --- a/tests/trilinos/solver_04.cc +++ /dev/null @@ -1,92 +0,0 @@ -//---------------------------- trilinos_solver_04.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004, 2005, 2008 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. -// -//---------------------------- trilinos_solver_04.cc --------------------------- - -// test the Trilinos BiCG solver - - -#include "../tests.h" -#include -#include "../lac/testmatrix.h" -#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(int argc, char **argv) -{ - std::ofstream logfile("solver_04/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverBiCG solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_04/cmp/generic b/tests/trilinos/solver_04/cmp/generic deleted file mode 100644 index d69ef9440f..0000000000 --- a/tests/trilinos/solver_04/cmp/generic +++ /dev/null @@ -1,6 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverBiCGE -DEAL::Starting value 7.750 -DEAL::Convergence step 41 value 0.0006730 -DEAL::Solver stopped after 41 iterations diff --git a/tests/trilinos/solver_05.cc b/tests/trilinos/solver_05.cc index d4d28b01d5..75eb00c8f9 100644 --- a/tests/trilinos/solver_05.cc +++ b/tests/trilinos/solver_05.cc @@ -65,7 +65,7 @@ int main(int argc, char **argv) { - SolverControl control(100, 1.e-3); + SolverControl control(200, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); @@ -85,7 +85,8 @@ int main(int argc, char **argv) u.compress (); TrilinosWrappers::SolverGMRES solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); + TrilinosWrappers::PreconditionJacobi preconditioner; + preconditioner.initialize(A); check_solve (solver, A,u,f, preconditioner); } } diff --git a/tests/trilinos/solver_06.cc b/tests/trilinos/solver_06.cc index 5fe5bcd489..ce79d0c2ae 100644 --- a/tests/trilinos/solver_06.cc +++ b/tests/trilinos/solver_06.cc @@ -85,7 +85,8 @@ int main(int argc, char **argv) u.compress (); TrilinosWrappers::SolverBicgstab solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); + TrilinosWrappers::PreconditionJacobi preconditioner; + preconditioner.initialize(A); check_solve (solver, A,u,f, preconditioner); } } diff --git a/tests/trilinos/solver_07.cc b/tests/trilinos/solver_07.cc index 74f4362acf..679459cf1c 100644 --- a/tests/trilinos/solver_07.cc +++ b/tests/trilinos/solver_07.cc @@ -1,8 +1,8 @@ //---------------------------- trilinos_solver_07.cc --------------------------- -// $Id$ +// $Id: solver_07.cc 17307 2008-10-23 01:52:20Z bangerth $ // Version: $Name$ // -// Copyright (C) 2004, 2005, 2008 by the deal.II authors +// Copyright (C) 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -14,14 +14,14 @@ // test the Trilinos CGS solver -#include "../tests.h" -#include +#include "../tests.h" #include "../lac/testmatrix.h" #include #include #include #include #include +#include #include #include #include @@ -59,13 +59,12 @@ int main(int argc, char **argv) logfile.precision(4); deallog.attach(logfile); deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); + deallog.threshold_double(1.e-10); + Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); { - SolverControl control(100, 1.e-3); + SolverControl control(200, 1.e-3); const unsigned int size = 32; unsigned int dim = (size-1)*(size-1); @@ -85,8 +84,10 @@ int main(int argc, char **argv) u.compress (); TrilinosWrappers::SolverCGS solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); + TrilinosWrappers::PreconditionJacobi preconditioner; + preconditioner.initialize(A); check_solve (solver, A,u,f, preconditioner); } + } diff --git a/tests/trilinos/solver_08.cc b/tests/trilinos/solver_08.cc index 71f5227574..0b672bf226 100644 --- a/tests/trilinos/solver_08.cc +++ b/tests/trilinos/solver_08.cc @@ -85,7 +85,8 @@ int main(int argc, char **argv) u.compress (); TrilinosWrappers::SolverTFQMR solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); + TrilinosWrappers::PreconditionJacobi preconditioner; + preconditioner.initialize(A); check_solve (solver, A,u,f, preconditioner); } } diff --git a/tests/trilinos/solver_09.cc b/tests/trilinos/solver_09.cc deleted file mode 100644 index 4e2995179d..0000000000 --- a/tests/trilinos/solver_09.cc +++ /dev/null @@ -1,96 +0,0 @@ -//---------------------------- trilinos_solver_09.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004, 2005, 2008 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. -// -//---------------------------- trilinos_solver_09.cc --------------------------- - -// test the Trilinos TCQMR solver -// -// note that this test fails on Trilinos 2.1.6 due to a bug in the TCQMR -// implementation. this is reported and should be fixed soonish - - - -#include "../tests.h" -#include -#include "../lac/testmatrix.h" -#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(int argc, char **argv) -{ - std::ofstream logfile("solver_09/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverTCQMR solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_09/cmp/generic b/tests/trilinos/solver_09/cmp/generic deleted file mode 100644 index c1e7ffb703..0000000000 --- a/tests/trilinos/solver_09/cmp/generic +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE -DEAL::Starting value 7.750 -DEAL::Starting value 7.750 -DEAL::Convergence step 44 value 0.0007016 -DEAL::Solver stopped after 44 iterations diff --git a/tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 b/tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 deleted file mode 100644 index c6b97de860..0000000000 --- a/tests/trilinos/solver_09/cmp/i386-apple-darwin8.10.1+gcc4.0 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE -DEAL::Starting value 7.750 -DEAL::Starting value 7.750 -DEAL::Convergence step 44 value 0.0007012 -DEAL::Solver stopped after 44 iterations diff --git a/tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 deleted file mode 100644 index 5757c5d52d..0000000000 --- a/tests/trilinos/solver_09/cmp/powerpc-apple-darwin8.10.0+gcc4.0 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE -DEAL::Starting value 7.750 -DEAL::Starting value 7.750 -DEAL::Convergence step 44 value 0.0007011 -DEAL::Solver stopped after 44 iterations diff --git a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 b/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 deleted file mode 100644 index 34a22672b0..0000000000 --- a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc3.3 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE -DEAL::Starting value 7.750 -DEAL::Starting value 7.750 -DEAL::Convergence step 44 value 0.0007008 -DEAL::Solver stopped after 44 iterations diff --git a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 b/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 deleted file mode 100644 index 7fad18ad6e..0000000000 --- a/tests/trilinos/solver_09/cmp/x86_64-unknown-linux-gnu+gcc4.1 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers11SolverTCQMRE -DEAL::Starting value 7.750 -DEAL::Starting value 7.750 -DEAL::Convergence step 44 value 0.0007010 -DEAL::Solver stopped after 44 iterations diff --git a/tests/trilinos/solver_10.cc b/tests/trilinos/solver_10.cc deleted file mode 100644 index cb7a6ac4ae..0000000000 --- a/tests/trilinos/solver_10.cc +++ /dev/null @@ -1,92 +0,0 @@ -//---------------------------- trilinos_solver_10.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004, 2005, 2008 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. -// -//---------------------------- trilinos_solver_10.cc --------------------------- - -// test the Trilinos CR solver - - -#include "../tests.h" -#include -#include "../lac/testmatrix.h" -#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(int argc, char **argv) -{ - std::ofstream logfile("solver_10/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverCR solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_10/cmp/generic b/tests/trilinos/solver_10/cmp/generic deleted file mode 100644 index 0c6333fd40..0000000000 --- a/tests/trilinos/solver_10/cmp/generic +++ /dev/null @@ -1,6 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers8SolverCRE -DEAL::Starting value 7.750 -DEAL::Convergence step 41 value 0.0005700 -DEAL::Solver stopped after 41 iterations diff --git a/tests/trilinos/solver_11.cc b/tests/trilinos/solver_11.cc deleted file mode 100644 index f68de16c15..0000000000 --- a/tests/trilinos/solver_11.cc +++ /dev/null @@ -1,93 +0,0 @@ -//---------------------------- trilinos_solver_11.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004, 2005, 2008 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. -// -//---------------------------- trilinos_solver_11.cc --------------------------- - -// test the Trilinos LSQR solver - - -#include "../tests.h" -#include -#include "../lac/testmatrix.h" -#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; - // just like for Richardson: expect to - // get here, don't abort the program - } - - deallog << "Solver stopped after " << solver.control().last_step() - << " iterations" << std::endl; -} - - -int main(int argc, char **argv) -{ - std::ofstream logfile("solver_11/output"); - logfile.precision(4); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - Utilities::System::MPI_InitFinalize mpi_initialization (argc, argv); - - - { - 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); - TrilinosWrappers::SparseMatrix A(dim, dim, 5); - testproblem.five_point(A); - - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); - f = 1.; - A.compress (); - f.compress (); - u.compress (); - - TrilinosWrappers::SolverLSQR solver(control); - TrilinosWrappers::PreconditionJacobi preconditioner(A); - check_solve (solver, A,u,f, preconditioner); - } -} - diff --git a/tests/trilinos/solver_11/cmp/generic b/tests/trilinos/solver_11/cmp/generic deleted file mode 100644 index 2a67dabd0f..0000000000 --- a/tests/trilinos/solver_11/cmp/generic +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE -DEAL::Starting value 31.00 -DEAL::Failure step 100 value 24.01 -DEAL::Iterative method reported convergence failure in step 100 with residual 24.0098 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 b/tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 deleted file mode 100644 index ef72f8d07b..0000000000 --- a/tests/trilinos/solver_11/cmp/i386-apple-darwin8.10.1+gcc4.0 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE -DEAL::Starting value 31.00 -DEAL::Failure step 100 value 24.02 -DEAL::Iterative method reported convergence failure in step 100 with residual 24.0185 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 deleted file mode 100644 index a7a6ad6cd2..0000000000 --- a/tests/trilinos/solver_11/cmp/powerpc-apple-darwin8.10.0+gcc4.0 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE -DEAL::Starting value 31.00 -DEAL::Failure step 100 value 24.02 -DEAL::Iterative method reported convergence failure in step 100 with residual 24.0199 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 b/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 deleted file mode 100644 index 3b0d9868be..0000000000 --- a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc3.3 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE -DEAL::Starting value 31.00 -DEAL::Failure step 100 value 24.02 -DEAL::Iterative method reported convergence failure in step 100 with residual 24.0219 -DEAL::Solver stopped after 100 iterations diff --git a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 b/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 deleted file mode 100644 index b4f65146aa..0000000000 --- a/tests/trilinos/solver_11/cmp/x86_64-unknown-linux-gnu+gcc4.1 +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::Size 32 Unknowns 961 -DEAL::Solver type: N6dealii13PETScWrappers10SolverLSQRE -DEAL::Starting value 31.00 -DEAL::Failure step 100 value 24.02 -DEAL::Iterative method reported convergence failure in step 100 with residual 24.0221 -DEAL::Solver stopped after 100 iterations -- 2.39.5