From: young Date: Sun, 20 Oct 2013 23:18:11 +0000 (+0000) Subject: Merge new testsuite into branch_petsc_scalar_complex. Modify petsc_complex and slepc_... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364857ba8c2a4a14e68f2268f91fa807f954f9b2;p=dealii-svn.git Merge new testsuite into branch_petsc_scalar_complex. Modify petsc_complex and slepc_complex tests accordingly with more todo... git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31363 0785d39b-7218-0410-832d-ea1e28bc413d --- 364857ba8c2a4a14e68f2268f91fa807f954f9b2 diff --cc tests/petsc/12.cc index 2f7735bb8a,a9954b0a8b..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/12.cc +++ /dev/null @@@ -1,95 -1,95 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::Vector::operator() in set-mode -- --#include "../tests.h" --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. have a bit pattern of where we -- // actually wrote elements to -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. have a bit pattern of where we -- // actually wrote elements to -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. have a bit pattern of where we -- // actually wrote elements to -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector, but disjoint sets of elements -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector, and record the expected scalar -- // product -- double product = 0; -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- v.reinit (13, true); -- -- Assert (v.size() == 13, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("29/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::Vector v (100); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/30.cc index d19042b55f,368a4d9194..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/30.cc +++ /dev/null @@@ -1,87 -1,87 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::Vector::reinit(!fast) -- --#include "../tests.h" --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some elements of the vector -- PetscScalar norm = 0; -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some elements of the vector -- PetscScalar sum = 0; -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some elements of the vector -- PetscScalar sum = 0; -- for (unsigned int i=0; i (1./3.)); -- Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value, -- ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("33/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::Vector v (100); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/34.cc index b2c73c1027,d2ce01c600..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/34.cc +++ /dev/null @@@ -1,90 -1,90 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::Vector::all_zero -- --#include "../tests.h" --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some elements of the vector -- double sum = 0; -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x, -- PETScWrappers::Vector &y) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x) --{ -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x) --{ -- for (unsigned int i=0; i) -- --#include "../tests.h" --#include --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- Vector w (v.size()); -- -- for (unsigned int i=0; i) with T!=PetscScalar -- --#include "../tests.h" --#include --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- Vector w (v.size()); -- Vector x (v.size()); -- -- for (unsigned int i=0; i must be different from -- // PetscScalar -- v = w; -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set some entries of the vector -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::SparseMatrix &m) --{ -- // first set a few entries -- for (unsigned int i=0; i row_lengths (5, 3U); -- row_lengths.back() = 2; -- PETScWrappers::SparseMatrix m (5,5,row_lengths); -- test (m); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/55.cc index e1066837cf,a6dd450067..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/55.cc +++ /dev/null @@@ -1,97 -1,97 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::Vector::operator() in set, and later in *= mode -- --#include "../tests.h" --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. have a bit pattern of where we -- // actually wrote elements to -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. have a bit pattern of where we -- // actually wrote elements to -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. they are all positive -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i w (v); -- Vector x (v); -- -- for (unsigned int i=0; i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i w (v); -- Vector x (v); -- -- PETScWrappers::Vector w1 (w); -- PETScWrappers::Vector x1 (x); -- -- for (unsigned int i=0; i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i w; -- w=v; -- Vector x; -- x=v; -- -- for (unsigned int i=0; i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- // set only certain elements of the -- // vector. -- std::vector pattern (v.size(), false); -- for (unsigned int i=0; i w; -- w=v; -- Vector x; -- x=v; -- -- PETScWrappers::Vector w1; -- w1=w; -- PETScWrappers::Vector x1; -- x1=x; -- -- for (unsigned int i=0; i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- Assert (m.m() != 0, ExcInternalError()); -- Assert (m.n() != 0, ExcInternalError()); -- -- m.clear (); -- -- Assert (m.m() == 0, ExcInternalError()); -- Assert (m.n() == 0, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("62/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::SparseMatrix v (100,100,5); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/63.cc index 1416c91a57,8b604a8309..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/63.cc +++ /dev/null @@@ -1,83 -1,83 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --#include "../tests.h" --#include --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- Assert (m.m() == 100, ExcInternalError()); -- Assert (m.n() == 100, ExcInternalError()); -- -- m = 0; -- -- Assert (m.m() == 100, ExcInternalError()); -- Assert (m.n() == 100, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("63/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::SparseMatrix v (100,100,5); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/64.cc index a51fc99056,f3ac698435..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/64.cc +++ /dev/null @@@ -1,104 -1,104 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// 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 --// PETScWrappers::MatrixBase::operator= -- -- --#include "../tests.h" --#include --#include --#include -- --#include --#include --#include -- -- --template --void test (MatrixType &m) --{ -- m.add(0,0,1); -- m = 0; -- m.compress(); -- -- Assert(fabs(m.frobenius_norm())<1e-15, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("64/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- const unsigned int n_dofs=420; -- // check -- // PETScWrappers::SparseMatrix -- PETScWrappers::SparseMatrix -- v1 (n_dofs, n_dofs, 5); -- test (v1); -- -- // check -- // PETScWrappers::MPI::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; -- PETScWrappers::MPI::SparseMatrix -- v2 (mpi_communicator, n_dofs, n_dofs, n_local_dofs, n_local_dofs, 5); -- test (v2); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/65.cc index cb6f453615,cf425c8b45..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/65.cc +++ /dev/null @@@ -1,81 -1,81 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// This test used to fail after upgrading to petsc 2.2.1 -- -- --#include "../tests.h" --#include -- --#include --#include --#include -- -- --void test () --{ -- PETScWrappers::MPI::Vector v(PETSC_COMM_WORLD, 100, 100); -- v(0) = 1; -- v.compress(VectorOperation::insert); -- v = 0; -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("65/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- test (); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/66.cc index 0dbdbdd23c,a921906e92..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/66.cc +++ /dev/null @@@ -1,139 -1,139 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::MatrixBase::clear_row () -- --#include "../tests.h" --#include --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- Assert (m.m() != 0, ExcInternalError()); -- Assert (m.n() != 0, ExcInternalError()); -- -- // build a tri-diagonal pattern -- double norm_sqr = 0; -- unsigned int nnz = 0; -- const unsigned int N = m.m(); -- for (unsigned int i=0; i=5) -- { -- const double s = rand(); -- m.add (i,i-5, s); -- norm_sqr += s*s; -- ++nnz; -- } -- -- if (i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- typedef PETScWrappers::MatrixBase::size_type size_type; -- -- Assert (m.m() != 0, ExcInternalError()); -- Assert (m.n() != 0, ExcInternalError()); -- -- // build a tri-diagonal pattern -- double norm_sqr = 0; -- unsigned int nnz = 0; -- const size_type N = m.m(); -- for (size_type i=0; i=5) -- { -- const double s = rand(); -- m.add (i,i-5, s); -- norm_sqr += s*s; -- ++nnz; -- } -- -- if (i(&rows[0], &rows[2])); -- -- deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) -- << std::endl; -- deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl; -- -- Assert (std::fabs (m.frobenius_norm() - std::sqrt(norm_sqr)) -- < std::fabs (std::sqrt (norm_sqr)), -- ExcInternalError()); -- -- // make sure that zeroing out rows does at -- // least not add new nonzero entries (it -- // may remove some, though) -- Assert (m.n_nonzero_elements() <= nnz, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("67/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::SparseMatrix v (14,14,3); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/68.cc index 9df4c16f06,676a852245..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/68.cc +++ /dev/null @@@ -1,143 -1,143 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PETScWrappers::MatrixBase::clear_row () with used second argument -- --#include "../tests.h" --#include --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- Assert (m.m() != 0, ExcInternalError()); -- Assert (m.n() != 0, ExcInternalError()); -- -- // build a tri-diagonal pattern -- double norm_sqr = 0; -- unsigned int nnz = 0; -- const unsigned int N = m.m(); -- for (unsigned int i=0; i=5) -- { -- const double s = rand(); -- m.add (i,i-5, s); -- norm_sqr += s*s; -- ++nnz; -- } -- -- if (i --#include -- --#include --#include --#include -- -- --void test (PETScWrappers::MatrixBase &m) --{ -- Assert (m.m() != 0, ExcInternalError()); -- Assert (m.n() != 0, ExcInternalError()); -- -- typedef PETScWrappers::MatrixBase::size_type size_type; -- -- // build a tri-diagonal pattern -- double norm_sqr = 0; -- unsigned int nnz = 0; -- const size_type N = m.m(); -- for (size_type i=0; i=5) -- { -- const double s = rand(); -- m.add (i,i-5, s); -- norm_sqr += s*s; -- ++nnz; -- } -- -- if (i(&rows[0], &rows[2]), rnd); -- -- deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) -- << std::endl; -- deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl; -- -- Assert (std::fabs (m.frobenius_norm() - std::sqrt(norm_sqr)) -- < std::fabs (std::sqrt (norm_sqr)), -- ExcInternalError()); -- -- // make sure that zeroing out rows does at -- // least not add new nonzero entries (it -- // may remove some, though) -- Assert (m.n_nonzero_elements() <= nnz, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("69/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::SparseMatrix v (14,14,3); -- test (v); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/70.cc index 7cd3b8b741,bc4132c6be..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/70.cc +++ /dev/null @@@ -1,40 -1,40 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check PetscScalar -- --#include "../tests.h" --#include --#include -- --#include -- --int main () --{ - std::ofstream logfile("70/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- if (typeid(PetscScalar)==typeid(double)) -- deallog << "double" << std::endl; -- else if (typeid(PetscScalar)==typeid(float)) -- deallog << "float" << std::endl; -- else -- Assert(false, ExcNotImplemented()); --} diff --cc tests/petsc/block_vector_iterator_01.cc index cfe7e2171b,e6fa61832a..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/block_vector_iterator_01.cc +++ /dev/null @@@ -1,121 -1,121 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// make sure that block vector iterator allows reading and writing correctly -- --#include "../tests.h" --#include --#include --#include -- -- --void test () --{ -- PETScWrappers::BlockVector v(2,1); -- v(0) = 1; -- v(1) = 2; -- -- // first check reading through a const -- // iterator -- { -- PETScWrappers::BlockVector::const_iterator i=v.begin(); -- Assert (*i == 1, ExcInternalError()); -- ++i; -- Assert (*i == 2, ExcInternalError()); -- } -- -- // same, but create iterator in a different -- // way -- { -- PETScWrappers::BlockVector::const_iterator -- i=const_cast(v).begin(); -- Assert (*i == 1, ExcInternalError()); -- ++i; -- Assert (*i == 2, ExcInternalError()); -- } -- -- // read through a read-write iterator -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- Assert (*i == 1, ExcInternalError()); -- ++i; -- Assert (*i == 2, ExcInternalError()); -- } -- -- // write through a read-write iterator -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- -- *i = 2; -- ++i; -- *i = 3; -- } -- -- // and read again -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- Assert (*i == 2, ExcInternalError()); -- ++i; -- Assert (*i == 3, ExcInternalError()); -- } -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("block_vector_iterator_01/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- test (); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/block_vector_iterator_02.cc index 32e94e2fe0,117bc79696..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/block_vector_iterator_02.cc +++ /dev/null @@@ -1,115 -1,115 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// like _01, except that we use operator[] instead of operator* -- --#include "../tests.h" --#include --#include --#include -- -- --void test () --{ -- PETScWrappers::BlockVector v(2,1); -- v(0) = 1; -- v(1) = 2; -- -- // first check reading through a const -- // iterator -- { -- PETScWrappers::BlockVector::const_iterator i=v.begin(); -- Assert (i[0] == 1, ExcInternalError()); -- Assert (i[1] == 2, ExcInternalError()); -- } -- -- // same, but create iterator in a different -- // way -- { -- PETScWrappers::BlockVector::const_iterator -- i=const_cast(v).begin(); -- Assert (i[0] == 1, ExcInternalError()); -- Assert (i[1] == 2, ExcInternalError()); -- } -- -- // read through a read-write iterator -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- Assert (i[0] == 1, ExcInternalError()); -- Assert (i[1] == 2, ExcInternalError()); -- } -- -- // write through a read-write iterator -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- i[0] = 2; -- i[1] = 3; -- } -- -- // and read again -- { -- PETScWrappers::BlockVector::iterator i = v.begin(); -- Assert (i[0] == 2, ExcInternalError()); -- Assert (i[1] == 3, ExcInternalError()); -- } -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("block_vector_iterator_02/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- test (); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/block_vector_iterator_03.cc index fb1e2a5ea8,8ed06ee623..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/block_vector_iterator_03.cc +++ /dev/null @@@ -1,370 -1,370 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2000 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// this test is an adaptation of lac/block_vector_iterator for PETSc block --// vectors -- --#include "../tests.h" --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --template --bool operator == (const PETScWrappers::BlockVector &v1, -- const PETScWrappers::BlockVector &v2) --{ -- if (v1.size() != v2.size()) -- return false; -- for (unsigned int i=0; i ivector(4); -- ivector[0] = 2; -- ivector[1] = 4; -- ivector[2] = 3; -- ivector[3] = 5; -- -- // Check 1: initialization via -- // iterators -- if (true) -- { -- PETScWrappers::BlockVector v1(ivector); -- PETScWrappers::BlockVector v2(ivector); -- -- // initialize first vector with -- // simple loop -- for (unsigned int i=0; i(v1.size()) ? -- "true" : "false") -- << std::endl; -- -- // check std::copy -- PETScWrappers::BlockVector v2(ivector); -- std::copy (v1.begin(), v1.end(), v2.begin()); -- deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl; -- -- // check std::transform -- std::transform (v1.begin(), v1.end(), v2.begin(), -- std::bind2nd (std::multiplies(), -- 2.0)); -- v2 *= 1./2.; -- deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl; -- -- -- // check operators +/-, +=/-= -- deallog << "Check 8: " -- << (std::distance(v1.begin(), v1.begin()+3) == 3 ? -- "true" : "false") -- << std::endl; -- deallog << "Check 9: " -- << (std::distance(v1.end()-6, v1.end()) == 6 ? -- "true" : "false") -- << std::endl; -- deallog << "Check 10: " -- << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ? -- "true" : "false") -- << std::endl; -- deallog << "Check 11: " -- << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ? -- "true" : "false") -- << std::endl; -- deallog << "Check 12: " -- << (std::distance((v1.end()-=4), v1.end()) == 4 ? -- "true" : "false") -- << std::endl; -- -- // check advance -- PETScWrappers::BlockVector::iterator p2 = v1.begin(); -- std::advance (p2, v1.size()); -- deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl; -- -- PETScWrappers::BlockVector::const_iterator p3 = v1.begin(); -- std::advance (p3, v1.size()); -- deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl; -- }; -- -- // Check 15: initialization through -- // iterators -- if (true) -- { -- PETScWrappers::BlockVector v1(ivector); -- // initialize first vector with -- // simple loop -- for (unsigned int i=0; i v2(v1.begin(), v1.end()); -- -- // and reverse way -- PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); -- deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl; -- }; -- -- // Check 16: initialization through -- // iterators. variant with one -- // constant object -- if (true) -- { -- PETScWrappers::BlockVector v1(ivector); -- // initialize first vector with -- // simple loop -- for (unsigned int i=0; i v2(v1.begin(), v1.end()); -- -- // and reverse way -- PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); -- deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl; -- }; -- -- // Check 17: initialization through -- // iterators. variant with two -- // constant object -- if (true) -- { -- PETScWrappers::BlockVector v1(ivector); -- // initialize first vector with -- // simple loop -- for (unsigned int i=0; i v2(v1.begin(), v1.end()); -- -- // and reverse way -- const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); -- deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl; -- }; -- -- // Check 18: initialization through -- // iterators. variant with three -- // constant object -- if (true) -- { -- PETScWrappers::BlockVector v0(ivector); -- // initialize first vector with -- // simple loop -- for (unsigned int i=0; i v2(v1.begin(), v1.end()); -- -- // and reverse way -- const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); -- deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl; -- }; -- -- // Check 19: operator[] -- if (true) -- { -- PETScWrappers::BlockVector v1(ivector); -- for (unsigned int i=0; i --#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(int argc, char **argv) --{ - std::ofstream logfile("deal_solver_01/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- GrowingVectorMemory mem; -- SolverCG solver(control,mem); -- PreconditionIdentity preconditioner; -- check_solve (solver, A,u,f, preconditioner); -- } -- GrowingVectorMemory::release_unused_memory (); -- --} -- diff --cc tests/petsc/deal_solver_02.cc index a337124044,46f04c6fa5..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/deal_solver_02.cc +++ /dev/null @@@ -1,103 -1,103 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the BiCGStab solver using the PETSc matrix and vector classes -- -- -- --#include "../tests.h" --#include "../lac/testmatrix.h" --#include --#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(int argc, char **argv) --{ - std::ofstream logfile("deal_solver_02/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- SolverControl control(100, 1.e-10); -- -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- GrowingVectorMemory mem; -- SolverBicgstab solver(control,mem); -- PreconditionIdentity preconditioner; -- check_solve (solver, A,u,f, preconditioner); -- } -- GrowingVectorMemory::release_unused_memory (); -- --} -- diff --cc tests/petsc/deal_solver_03.cc index 62abb6bd07,831ebb38ec..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/deal_solver_03.cc +++ /dev/null @@@ -1,103 -1,103 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the GMRES solver using the PETSc matrix and vector classes -- -- -- --#include "../tests.h" --#include "../lac/testmatrix.h" --#include --#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(int argc, char **argv) --{ - std::ofstream logfile("deal_solver_03/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- GrowingVectorMemory mem; -- SolverGMRES solver(control,mem); -- PreconditionIdentity preconditioner; -- check_solve (solver, A,u,f, preconditioner); -- } -- GrowingVectorMemory::release_unused_memory (); -- --} -- diff --cc tests/petsc/deal_solver_04.cc index be1c544a2c,f4a88b8bc4..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/deal_solver_04.cc +++ /dev/null @@@ -1,102 -1,102 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the MINRES solver using the PETSc matrix and vector classes -- -- --#include "../tests.h" --#include "../lac/testmatrix.h" --#include --#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(int argc, char **argv) --{ - std::ofstream logfile("deal_solver_04/output"); - std::ofstream logfile("output"); -- logfile.precision(4); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- GrowingVectorMemory mem; -- SolverMinRes solver(control,mem); -- PreconditionIdentity preconditioner; -- check_solve (solver, A,u,f, preconditioner); -- } -- GrowingVectorMemory::release_unused_memory (); -- --} -- diff --cc tests/petsc/deal_solver_05.cc index 81b77f6e88,033b498db6..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/deal_solver_05.cc +++ /dev/null @@@ -1,101 -1,101 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the QMRS solver using the PETSc matrix and vector classes -- -- --#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(int argc, char **argv) --{ - std::ofstream logfile("deal_solver_05/output"); - std::ofstream logfile("output"); -- logfile.precision(4); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- GrowingVectorMemory mem; -- SolverQMRS solver(control,mem); -- PreconditionIdentity preconditioner; -- check_solve (solver, A,u,f, preconditioner); -- } -- GrowingVectorMemory::release_unused_memory (); -- --} -- diff --cc tests/petsc/full_matrix_01.cc index 1658be2a3a,6125db2d92..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/full_matrix_01.cc +++ /dev/null @@@ -1,97 -1,97 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check setting elements in a petsc matrix using --// PETScWrappers::FullMatrix::set() -- --#include "../tests.h" --#include --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- Assert (m.m() == 5, ExcInternalError()); -- Assert (m.n() == 5, ExcInternalError()); -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("full_matrix_04/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- PETScWrappers::FullMatrix m (5,5); -- test (m); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/full_matrix_05.cc index 592ffb17a1,36851aa8fc..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/full_matrix_05.cc +++ /dev/null @@@ -1,93 -1,93 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check querying the number of nonzero elements in --// PETScWrappers::FullMatrix -- --#include "../tests.h" --#include --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries. count how many -- // entries we have -- unsigned int counter = 0; -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries. count how many -- // entries we have -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries. count how many -- // entries we have -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries. count how many -- // entries we have -- PetscScalar norm = 0; -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries -- for (unsigned int i=0; i --#include --#include -- -- --void test (PETScWrappers::FullMatrix &m) --{ -- // first set a few entries -- for (unsigned int i=0; i --#include --#include -- -- --void test () --{ -- PETScWrappers::FullMatrix m(5,5); -- m.set (0,0,1); -- m.set (1,1,2); -- m.set (1,2,3); -- m.compress (); -- PETScWrappers::FullMatrix::const_iterator i = m.begin(); -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- ++i; -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- i++; -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("full_matrix_iterator_01/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- test (); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/full_matrix_vector_02.cc index eed9d91174,6bf332a6f1..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/full_matrix_vector_02.cc +++ /dev/null @@@ -1,104 -1,104 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check FullMatrix::Tvmult -- --#include "../tests.h" --#include --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i -- const PetscScalar s = m.matrix_scalar_product (w,v); -- -- // make sure we get the expected result -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i -- const PetscScalar s = m.matrix_norm_square (v); -- -- // make sure we get the expected result -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w, -- PETScWrappers::Vector &x) --{ -- PETScWrappers::FullMatrix m(v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#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 () --{ -- typedef PETScWrappers::MPI::SparseMatrix::size_type size_type; -- -- // 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.back()) -- csp.add (i,i-local_rows_per_process.back()); -- } -- -- // here is a sparsity pattern for which no -- // Inodes are used, but it doesn't allocate -- // additional memory --// for (unsigned int bi=0; bi --#include --#include --#include -- --// A variant of the tests/lac/testmatrix.h file that uses the PETSc --// matrix free interface -- -- --/** -- * Finite difference PETSc matrix-free object on uniform grid. -- * Generator for simple 5-point discretization of Laplace problem. -- */ -- --class PetscFDMatrix : public dealii::PETScWrappers::MatrixFree --{ --public: -- /** -- * Constructor specifying grid resolution. -- */ -- PetscFDMatrix(unsigned int size, unsigned int dim); -- -- /** -- * Matrix-vector multiplication: -- * let dst = M*src with -- * M being this matrix. -- * -- * Source and destination must -- * not be the same vector. -- */ -- void vmult (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const; -- -- /** -- * Matrix-vector multiplication: let -- * dst = MT*src with -- * M being this matrix. This -- * function does the same as @p vmult() -- * but takes the transposed matrix. -- * -- * Source and destination must -- * not be the same vector. -- */ -- void Tvmult (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const; -- -- /** -- * Adding Matrix-vector -- * multiplication. Add -- * M*src on dst -- * with M being this -- * matrix. -- * -- * Source and destination must -- * not be the same vector. -- */ -- void vmult_add (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const; -- -- /** -- * Adding Matrix-vector -- * multiplication. Add -- * MT*src to -- * dst with M being -- * this matrix. This function -- * does the same as @p vmult_add() -- * but takes the transposed -- * matrix. -- * -- * Source and destination must -- * not be the same vector. -- */ -- void Tvmult_add (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const; -- --private: -- /** -- * Number of gridpoints in x-direction. -- */ -- unsigned int nx; -- -- /** -- * Number of gridpoints in y-direction. -- */ -- unsigned int ny; --}; -- -- --// --------------- inline and template functions ----------------- -- --inline --PetscFDMatrix::PetscFDMatrix(unsigned int size, unsigned int dim) -- : PETScWrappers::MatrixFree (dim, dim, dim, dim), -- nx (size), ny (size) --{} -- -- -- --inline --void --PetscFDMatrix::vmult_add (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const --{ -- for (unsigned int i=0; i<=ny-2; i++) -- { -- for (unsigned int j=0; j<=nx-2; j++) -- { -- // Number of the row to be entered -- unsigned int row = j+(nx-1)*i; -- -- dst(row) += 4. * src(row); // A.set(row, row, 4.); -- -- if (j>0) -- { -- dst(row-1) += -1. * src(row); // A.set(row-1, row, -1.); -- dst(row) += -1. * src(row-1); // A.set(row, row-1, -1.); -- } -- if (i>0) -- { -- dst(row-(nx-1)) += -1. * src(row); // A.set(row-(nx-1), row, -1.); -- dst(row) += -1. * src(row-(nx-1)); // A.set(row, row-(nx-1), -1.); -- } -- } -- } --} -- -- -- --inline --void --PetscFDMatrix::vmult (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const --{ -- dst = 0; -- vmult_add (dst, src); --} -- -- -- --inline --void --PetscFDMatrix::Tvmult (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const --{ -- dst = 0; -- vmult_add (dst, src); --} -- -- -- --inline --void --PetscFDMatrix::Tvmult_add (dealii::PETScWrappers::VectorBase &dst, -- const dealii::PETScWrappers::VectorBase &src) const --{ -- vmult_add (dst, src); --} -- -- diff --cc tests/petsc/slowness_01.cc index 2a8e0c3101,7290ec6caa..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/slowness_01.cc +++ /dev/null @@@ -1,149 -1,149 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2005 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// this is part of a whole suite of tests that checks the relative speed of --// using PETSc for sparse matrices as compared to the speed of our own --// library. the tests therefore may not all actually use PETSc, but they are --// meant to compare it --// --// the tests build the 5-point stencil matrix for a uniform grid of size N*N -- --#include "../tests.h" --#include --#include --#include --#include --#include -- -- --void test () --{ -- const unsigned int N = 200; -- -- // first build the sparsity pattern -- SparsityPattern sparsity (N*N, N*N, 5); -- for (unsigned int i=0; i0) -- { -- sparsity.add(global-1, global); -- sparsity.add(global, global-1); -- } -- if (j0) -- { -- sparsity.add(global-N, global); -- sparsity.add(global, global-N); -- } -- if (i matrix (sparsity); -- for (unsigned int i=0; i0) -- { -- matrix.add(global-1, global, -1); -- matrix.add(global, global-1, -1); -- } -- if (j0) -- { -- matrix.add(global-N, global, -1); -- matrix.add(global, global-N, -1); -- } -- if (i v1(N*N), v2(N*N); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test () --{ -- const unsigned int N = 200; -- -- // build the sparse matrix -- PETScWrappers::SparseMatrix matrix (N*N, N*N, 5); -- for (unsigned int i=0; i0) -- { -- matrix.add(global-1, global, -1); -- matrix.add(global, global-1, -1); -- } -- if (j0) -- { -- matrix.add(global-N, global, -1); -- matrix.add(global, global-N, -1); -- } -- if (i --#include --#include --#include --#include -- -- --void test () --{ -- const unsigned int N = 200; -- -- // build the sparse matrix -- PETScWrappers::MPI::SparseMatrix matrix (PETSC_COMM_WORLD, -- N*N, N*N, -- N*N, N*N, -- 5); -- for (unsigned int i=0; i0) -- { -- matrix.add(global-1, global, -1); -- matrix.add(global, global-1, -1); -- } -- if (j0) -- { -- matrix.add(global-N, global, -1); -- matrix.add(global, global-N, -1); -- } -- if (i --#include --#include --#include --#include -- -- --void test () --{ -- const unsigned int N = 200; -- -- // first find a random permutation of the -- // indices -- std::vector permutation (N); -- { -- std::vector unused_indices (N); -- for (unsigned int i=0; i0) -- { -- matrix.add(global-1, global, rand()); -- matrix.add(global, global-1, rand()); -- } -- if (j0) -- { -- matrix.add(global-N, global, rand()); -- matrix.add(global, global-N, rand()); -- } -- if (i --#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_03_precondition_boomeramg/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionBoomerAMG preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_boomeramg_symmetric.cc index 709f3e837d,73a442f1a5..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc +++ /dev/null @@@ -1,96 -1,96 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver with the PreconditionBoomerAMG --// preconditioner. allow the preconditioner to exploit symmetry of the --// matrix -- -- --#include "../tests.h" --#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_03_precondition_boomeramg_symmetric/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionBoomerAMG preconditioner(A, true); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_eisenstat.cc index 03e98e0ad4,6551a25c05..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_eisenstat.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_eisenstat/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionEisenstat preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_icc.cc index c5916bc3af,6849d74979..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_icc.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_icc/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionICC preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_ilu.cc index 53edb1a149,faad508f0a..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_ilu.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_ilu/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionILU preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_lu.cc index f0fafbb3b3,beabcf434a..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_lu.cc +++ /dev/null @@@ -1,101 -1,101 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver with the PreconditionLU --// preconditioner. This should converge in exactly one iteration -- -- --#include "../tests.h" --#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; -- -- // we use a direct solver as a -- // preconditioner. this should -- // converge in one step! -- Assert (solver.control().last_step() == 1, -- ExcInternalError()); --} -- -- --int main(int argc, char **argv) --{ - std::ofstream logfile("solver_03_precondition_lu/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionLU preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_parasails.cc index 2bc0ad648c,05ffee26f7..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_parasails.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_parasails/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionParaSails preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_sor.cc index c2e0b8b984,f0700eebc5..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_sor.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_sor/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionSOR preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_03_precondition_ssor.cc index 59f7be8880,67fd339d47..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_03_precondition_ssor.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CG solver -- -- --#include "../tests.h" --#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_03_precondition_ssor/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCG solver(control); -- PETScWrappers::PreconditionSSOR preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_05.cc index 591d86af17,15f6466e8c..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_05.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc GMRES solver -- -- --#include "../tests.h" --#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_05/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverGMRES solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_06.cc index df97600cc7,e19bddaf0c..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_06.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc Bicgstab solver -- -- --#include "../tests.h" --#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_06/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverBicgstab solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_07.cc index 007d238ab2,12d44a6ae2..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_07.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CGS solver -- -- --#include "../tests.h" --#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_07/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCGS solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_08.cc index 8f2c12fa8b,56b38ef60d..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_08.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc TFQMR solver -- -- --#include "../tests.h" --#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_08/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverTFQMR solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_09.cc index 67ab1e62b4,3297bd8fe2..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_09.cc +++ /dev/null @@@ -1,98 -1,98 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc TCQMR solver --// --// note that this test fails on PETSc 2.1.6 due to a bug in the TCQMR --// implementation. this is reported and should be fixed soonish -- -- -- --#include "../tests.h" --#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"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverTCQMR solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_10.cc index 4fdb4c05c3,df81e7dbd2..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_10.cc +++ /dev/null @@@ -1,94 -1,94 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc CR solver -- -- --#include "../tests.h" --#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"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverCR solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_11.cc index c2bc733ad9,a7e585eb33..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_11.cc +++ /dev/null @@@ -1,95 -1,95 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc LSQR solver -- -- --#include "../tests.h" --#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) - catch (dealii::SolverControl::NoConvergence &e) -- { - deallog << e.what() << std::endl; -- // just like for Richardson: expect to -- // get here, don't abort the program - deallog << "Catched exception dealii::SolverControl::NoConvergence" << std::endl; -- } -- -- deallog << "Solver stopped after " << solver.control().last_step() -- << " iterations" << std::endl; --} -- -- --int main(int argc, char **argv) --{ - std::ofstream logfile("solver_11/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverLSQR solver(control); -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_12.cc index 6a99ee2ced,79e44183a9..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_12.cc +++ /dev/null @@@ -1,91 -1,91 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc PreOnly solver -- -- --#include "../tests.h" --#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.; -- -- solver.solve(A,u,f,P); -- -- deallog << "Solver stopped after " << solver.control().last_step() -- << " iterations" << std::endl; --} -- -- --int main(int argc, char **argv) --{ - std::ofstream logfile("solver_12/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- PETScWrappers::SolverPreOnly solver(control); -- -- PETScWrappers::PreconditionJacobi preconditioner(A); -- check_solve (solver, A,u,f, preconditioner); -- -- //run twice because this errored out at some point -- check_solve (solver, A,u,f, preconditioner); -- } -- --} -- diff --cc tests/petsc/solver_13.cc index 4493835626,b28e88cafe..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/solver_13.cc +++ /dev/null @@@ -1,100 -1,100 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETScWrapper::Precondition*::vmult -- -- --#include "../tests.h" --#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; -- -- solver.solve(A,u,f,P); -- -- deallog << "Solver stopped after " << solver.control().last_step() -- << " iterations" << std::endl; --} -- -- --int main(int argc, char **argv) --{ - std::ofstream logfile("solver_13/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- u = 0.; -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- PETScWrappers::Vector t=u; -- -- PETScWrappers::SolverPreOnly solver(control); -- -- PETScWrappers::PreconditionJacobi preconditioner(A); -- -- check_solve (solver, A,u,f, preconditioner); -- -- deallog << u.l2_norm() << std::endl; -- -- check_solve (solver, A,t,u, preconditioner); -- -- deallog << t.l2_norm() << std::endl; -- -- u = 0; -- preconditioner.vmult(u, f); -- deallog << u.l2_norm() << std::endl; -- preconditioner.vmult(t, u); -- deallog << t.l2_norm() << std::endl; -- } -- --} -- diff --cc tests/petsc/sparse_direct_mumps.cc index d6e6fcb728,01956e4e02..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/sparse_direct_mumps.cc +++ /dev/null @@@ -1,98 -1,98 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- --// test the PETSc SparseDirectMumps solver -- -- --#include "../tests.h" --#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("sparse_direct_mumps/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog << std::setprecision(4); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- 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); -- PETScWrappers::SparseMatrix A(dim, dim, 5); -- testproblem.five_point(A); -- -- PETScWrappers::Vector f(dim); -- PETScWrappers::Vector u(dim); -- u = 0.; -- f = 1.; -- A.compress (); -- f.compress (); -- u.compress (); -- -- SolverControl cn; -- PETScWrappers::SparseDirectMUMPS solver(cn); --// solver.set_symmetric_mode(true); -- solver.solve(A,u,f); -- -- PETScWrappers::Vector tmp(dim); -- deallog << "residual = " << A.residual (tmp, u, f) -- << std::endl; -- } -- --} -- diff --cc tests/petsc/sparse_matrix_iterator_01.cc index ccb85230d2,b070cc721c..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/sparse_matrix_iterator_01.cc +++ /dev/null @@@ -1,85 -1,85 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// test PETScWrappers::MatrixBase::const_iterator -- --#include "../tests.h" --#include --#include --#include -- -- --void test () --{ -- PETScWrappers::SparseMatrix m(5,5,5); -- m.set (0,0,1); -- m.set (1,1,2); -- m.set (1,2,3); -- m.compress (); -- PETScWrappers::SparseMatrix::const_iterator i = m.begin(); -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- ++i; -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- i++; -- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl; -- -- deallog << "OK" << std::endl; --} -- -- -- --int main (int argc,char **argv) --{ - std::ofstream logfile("sparse_matrix_iterator_01/output"); - std::ofstream logfile("output"); -- deallog.attach(logfile); -- deallog.depth_console(0); -- deallog.threshold_double(1.e-10); -- -- try -- { -- Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -- { -- test (); -- } -- -- } -- catch (std::exception &exc) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Exception on processing: " << std::endl -- << exc.what() << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- -- return 1; -- } -- catch (...) -- { -- std::cerr << std::endl << std::endl -- << "----------------------------------------------------" -- << std::endl; -- std::cerr << "Unknown exception!" << std::endl -- << "Aborting!" << std::endl -- << "----------------------------------------------------" -- << std::endl; -- return 1; -- }; --} diff --cc tests/petsc/sparse_matrix_vector_01.cc index 89d38a30f5,6562499418..0000000000 deleted file mode 100644,100644 --- a/tests/petsc/sparse_matrix_vector_01.cc +++ /dev/null @@@ -1,104 -1,104 +1,0 @@@ --// --------------------------------------------------------------------- --// $Id$ --// --// Copyright (C) 2004 - 2013 by the deal.II authors --// --// This file is part of the deal.II library. --// --// The deal.II library is free software; you can use it, redistribute --// it, and/or modify it under the terms of the GNU Lesser General --// Public License as published by the Free Software Foundation; either --// version 2.1 of the License, or (at your option) any later version. --// The full text of the license can be found in the file LICENSE at --// the top level of the deal.II distribution. --// --// --------------------------------------------------------------------- -- -- -- --// check SparseMatrix::vmult -- --#include "../tests.h" --#include --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size()); -- for (unsigned int i=0; i --#include --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v) --{ -- PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size()); -- for (unsigned int i=0; i -- const PetscScalar s = m.matrix_norm_square (v); -- -- // make sure we get the expected result -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector -- for (unsigned int i=0; i --#include --#include --#include -- -- --void test (PETScWrappers::Vector &v, -- PETScWrappers::Vector &w) --{ -- // set only certain elements of each -- // vector -- for (unsigned int i=0; i