From 5df4d5e644eff6d40adc59256278ea78722928a2 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Thu, 30 Mar 2006 20:58:43 +0000 Subject: [PATCH] test for new reinit of BlockSparsityPattern git-svn-id: https://svn.dealii.org/trunk@12783 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/Makefile | 1 + tests/lac/block_sparsity_pattern_01.cc | 77 +++++++++++++++++++ .../lac/block_sparsity_pattern_01/cmp/generic | 18 +++++ 3 files changed, 96 insertions(+) create mode 100644 tests/lac/block_sparsity_pattern_01.cc create mode 100644 tests/lac/block_sparsity_pattern_01/cmp/generic diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 370f5f4fe7..beaca1e4f3 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -23,6 +23,7 @@ default: run-tests tests_x = vector-vector \ full_matrix householder tridiagonal_matrix \ sparsity_pattern sparse_matrices matrices \ + block_sparsity_pattern_01 \ block_vector block_vector_iterator block_matrices \ matrix_lib matrix_out \ solver eigen \ diff --git a/tests/lac/block_sparsity_pattern_01.cc b/tests/lac/block_sparsity_pattern_01.cc new file mode 100644 index 0000000000..b46cdfc66c --- /dev/null +++ b/tests/lac/block_sparsity_pattern_01.cc @@ -0,0 +1,77 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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 reinit(BlockIndices...) + + +#include "../tests.h" +#include +#include + +#include + +int main() +{ + std::ofstream logfile("block_sparsity_pattern_01/output"); + logfile.setf(std::ios::fixed); + logfile.precision(2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + BlockSparsityPattern sparsity; + std::vector row_blocks(4); + row_blocks[0] = 4; + row_blocks[1] = 5; + row_blocks[2] = 1; + row_blocks[3] = 4; + std::vector col_blocks(3); + col_blocks[0] = 2; + col_blocks[1] = 3; + col_blocks[2] = 2; + BlockIndices rows(row_blocks); + BlockIndices cols(col_blocks); + + std::vector > + row_length(cols.size(), + std::vector(rows.total_size())); + for (unsigned int jb=0;jb