From e238fbccbef55f04c614c2315bd668195d039eba Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 27 Feb 2004 17:09:31 +0000 Subject: [PATCH] . git-svn-id: https://svn.dealii.org/trunk@8601 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/petsc_52.cc | 95 +++++++++++++++++++ .../bits/petsc_52.output | 2 + 2 files changed, 97 insertions(+) create mode 100644 tests/bits/petsc_52.cc create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/petsc_52.output diff --git a/tests/bits/petsc_52.cc b/tests/bits/petsc_52.cc new file mode 100644 index 0000000000..7f5dad32a2 --- /dev/null +++ b/tests/bits/petsc_52.cc @@ -0,0 +1,95 @@ +//---------------------------- petsc_52.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2004 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- petsc_52.cc --------------------------- + + +// check setting elements in a petsc matrix using +// PETScWrappers::SparseMatrix::set(). like petsc_01, but use a different +// constructor for the sparse matrix + +#include "../tests.h" +#include +#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); + } + PetscFinalize(); + } + 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 --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/petsc_52.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/petsc_52.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/petsc_52.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5