From 86185c74a1d70104962cb9367fb378dcbc775c52 Mon Sep 17 00:00:00 2001 From: young Date: Tue, 4 Feb 2014 11:27:44 +0000 Subject: [PATCH] Test PETSc FullMatrix reinit function. git-svn-id: https://svn.dealii.org/trunk@32400 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/petsc/full_matrix_00.cc | 122 ++++++++++++++++++++++++++++++ tests/petsc/full_matrix_00.output | 14 ++++ 2 files changed, 136 insertions(+) create mode 100644 tests/petsc/full_matrix_00.cc create mode 100644 tests/petsc/full_matrix_00.output diff --git a/tests/petsc/full_matrix_00.cc b/tests/petsc/full_matrix_00.cc new file mode 100644 index 0000000000..cbdde4b883 --- /dev/null +++ b/tests/petsc/full_matrix_00.cc @@ -0,0 +1,122 @@ +// --------------------------------------------------------------------- +// $Id: full_matrix_01.cc 31602 2013-11-09 15:38:36Z young $ +// +// Copyright (C) 2014 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 initialiser (aka do_reinit). . +// +// PETScWrappers::FullMatrix::reinit () + +#include "../tests.h" +#include +#include +#include + +// Simply take an already intialised full matrix, fill in some of the +// elements, reinitialise it to a different size and fill in some +// elements again. To be sure this generates the correct results the +// test is verbose (and uses tiny matrices). +void test (PETScWrappers::FullMatrix &m) +{ + // asign some matrix elements + for (unsigned int i=0; i