From 6d415f0b637b685c8405bb03287c0ccef5faf368 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 30 Oct 2007 16:31:19 +0000 Subject: [PATCH] test BlockIndices git-svn-id: https://svn.dealii.org/trunk@15394 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/Makefile | 2 +- tests/lac/block_indices.cc | 74 +++++++++++++++++++++++++++++ tests/lac/block_indices/cmp/generic | 19 ++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/lac/block_indices.cc create mode 100644 tests/lac/block_indices/cmp/generic diff --git a/tests/lac/Makefile b/tests/lac/Makefile index a6912fcbd5..4155942dc4 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -25,7 +25,7 @@ tests_x = vector-vector \ tridiagonal_matrix tridiagonal_matrix_sym \ sparsity_pattern sparse_matrices matrices \ block_sparsity_pattern_01 \ - block_vector block_vector_* block_matrices \ + block_indices block_vector block_vector_* block_matrices \ matrix_lib matrix_out pointer_matrix pointer_matrix_vector \ solver eigen \ sparse_ilu sparse_ilu_t lapack_fill block_minres \ diff --git a/tests/lac/block_indices.cc b/tests/lac/block_indices.cc new file mode 100644 index 0000000000..e907b5c1dc --- /dev/null +++ b/tests/lac/block_indices.cc @@ -0,0 +1,74 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007 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 if block indices are handled properly + +#include "../tests.h" +#include +#include + +#include + + +void test (const BlockIndices& idx) +{ + const unsigned int n = idx.size(); + deallog << "blocks " << idx.size() << std::endl + << "elements " << idx.total_size() << std::endl + << "block sizes "; + for (unsigned i=0;i v(4); + for (unsigned int i=0;i