From 50d7681c946c5ab488b93f7d4d200dcb05658ff3 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 6 Feb 2004 23:27:52 +0000 Subject: [PATCH] More tests. git-svn-id: https://svn.dealii.org/trunk@8421 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/Makefile | 14 +++++- tests/bits/petsc_03a.cc | 101 ++++++++++++++++++++++++++++++++++++++ tests/bits/petsc_03b.cc | 106 ++++++++++++++++++++++++++++++++++++++++ tests/bits/petsc_11.cc | 77 +++++++++++++++++++++++++++++ tests/bits/petsc_12.cc | 90 ++++++++++++++++++++++++++++++++++ tests/bits/petsc_13.cc | 90 ++++++++++++++++++++++++++++++++++ tests/bits/petsc_14.cc | 96 ++++++++++++++++++++++++++++++++++++ tests/bits/petsc_15.cc | 93 +++++++++++++++++++++++++++++++++++ tests/bits/petsc_16.cc | 95 +++++++++++++++++++++++++++++++++++ 9 files changed, 760 insertions(+), 2 deletions(-) create mode 100644 tests/bits/petsc_03a.cc create mode 100644 tests/bits/petsc_03b.cc create mode 100644 tests/bits/petsc_11.cc create mode 100644 tests/bits/petsc_12.cc create mode 100644 tests/bits/petsc_13.cc create mode 100644 tests/bits/petsc_14.cc create mode 100644 tests/bits/petsc_15.cc create mode 100644 tests/bits/petsc_16.cc diff --git a/tests/bits/Makefile b/tests/bits/Makefile index ce06817732..02faa5f18e 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -153,6 +153,8 @@ sparse_matrix_10.exe : sparse_matrix_10.g.$(OBJEXT) $(libraries) petsc_01.exe : petsc_01.g.$(OBJEXT) $(libraries) petsc_02.exe : petsc_02.g.$(OBJEXT) $(libraries) petsc_03.exe : petsc_03.g.$(OBJEXT) $(libraries) +petsc_03a.exe : petsc_03a.g.$(OBJEXT) $(libraries) +petsc_03b.exe : petsc_03b.g.$(OBJEXT) $(libraries) petsc_04.exe : petsc_04.g.$(OBJEXT) $(libraries) petsc_05.exe : petsc_05.g.$(OBJEXT) $(libraries) petsc_06.exe : petsc_06.g.$(OBJEXT) $(libraries) @@ -162,6 +164,12 @@ petsc_09.exe : petsc_09.g.$(OBJEXT) $(libraries) petsc_10.exe : petsc_10.g.$(OBJEXT) $(libraries) petsc_11.exe : petsc_11.g.$(OBJEXT) $(libraries) petsc_12.exe : petsc_12.g.$(OBJEXT) $(libraries) +petsc_13.exe : petsc_13.g.$(OBJEXT) $(libraries) +petsc_14.exe : petsc_14.g.$(OBJEXT) $(libraries) +petsc_15.exe : petsc_15.g.$(OBJEXT) $(libraries) +petsc_16.exe : petsc_16.g.$(OBJEXT) $(libraries) +petsc_17.exe : petsc_17.g.$(OBJEXT) $(libraries) +petsc_18.exe : petsc_18.g.$(OBJEXT) $(libraries) tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \ geometry_info_1 point_inside_1 point_inside_2 \ @@ -208,8 +216,10 @@ tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \ sparse_matrix_10 ifeq ($(USE_CONTRIB_HSL),yes) - tests += petsc_01 petsc_02 petsc_03 petsc_04 petsc_05 petsc_06 \ - petsc_07 petsc_08 petsc_09 petsc_10 petsc_11 petsc_12 + tests += petsc_01 petsc_02 petsc_03 petsc_03a petsc_03b \ + petsc_04 petsc_05 petsc_06 \ + petsc_07 petsc_08 petsc_09 petsc_10 petsc_11 petsc_12 \ + petsc_13 petsc_14 petsc_15 petsc_16 petsc_17 petsc_18 endif ############################################################ diff --git a/tests/bits/petsc_03a.cc b/tests/bits/petsc_03a.cc new file mode 100644 index 0000000000..acc9649b60 --- /dev/null +++ b/tests/bits/petsc_03a.cc @@ -0,0 +1,101 @@ +//---------------------------- petsc_03a.cc --------------------------- +// petsc_03a.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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_03a.cc --------------------------- + + +// check setting elements in a petsc matrix using set() and add() +// intermixed. this poses PETSc some problems, since one has to flush some +// buffer in between these two types of operations +// +// in contrast to petsc_03, we set and add the same elements here twice, to +// get double the original value + +#include "../tests.h" +#include +#include +#include + + +void test (petsc_wrappers::SparseMatrix &m) +{ + // first set a few entries + for (unsigned int i=0; i +#include +#include + + +void test (petsc_wrappers::SparseMatrix &m) +{ + // first set a few entries + for (unsigned int i=0; i +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set only certain elements of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::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 (petsc_wrappers::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 (petsc_wrappers::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); + bool flag = false; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::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 (petsc_wrappers::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