From 02796d7a351357d9191c4f60fab6f86f413fd26c Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 7 Jun 2010 21:26:44 +0000 Subject: [PATCH] Merge tests from branch_distributed_grids. git-svn-id: https://svn.dealii.org/trunk@21171 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/index_set_15.cc | 85 +++++++++++++++++++++++++++++ tests/base/index_set_15/cmp/generic | 6 ++ tests/base/index_set_16.cc | 70 ++++++++++++++++++++++++ tests/base/index_set_16/cmp/generic | 6 ++ 4 files changed, 167 insertions(+) create mode 100644 tests/base/index_set_15.cc create mode 100644 tests/base/index_set_15/cmp/generic create mode 100644 tests/base/index_set_16.cc create mode 100644 tests/base/index_set_16/cmp/generic diff --git a/tests/base/index_set_15.cc b/tests/base/index_set_15.cc new file mode 100644 index 0000000000..5b68ab5c79 --- /dev/null +++ b/tests/base/index_set_15.cc @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2010 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. +// +//----------------------------------------------------------------------------- + +// test IndexSet::subtract_set + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + + +void test () +{ + IndexSet is1 (100); + IndexSet is2 (100); + + // randomly add 90 elements to each + // set, some of which may be + // repetitions of previous ones + for (unsigned int i=0; i<9*is1.size()/10; ++i) + { + is1.add_index (rand() % is1.size()); + is2.add_index (rand() % is2.size()); + } + + IndexSet is3 = is1; + is3.subtract_set(is2); + + deallog << "Set sizes: " + << is1.n_elements() << ' ' + << is2.n_elements() << ' ' + << is3.n_elements() << std::endl; + + is1.print(deallog); + is2.print(deallog); + is3.print(deallog); + + + + for (unsigned int i=0; i +#include +#include +#include +#include + +#include + + +void test () +{ + IndexSet is1 (100); + IndexSet is2 (100); + + is1.add_range(0,10); + is1.add_range(20,100); + + is2.add_range(0,50); +// is2.add_range(10,15); + + IndexSet is3 = is1; + is3.subtract_set(is2); + + is1.print(deallog); + is2.print(deallog); + is3.print(deallog); + + for (unsigned int i=0; i