From: Guido Kanschat Date: Thu, 30 Mar 2006 20:58:43 +0000 (+0000) Subject: test for new reinit of BlockSparsityPattern X-Git-Tag: v8.0.0~11937 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5df4d5e644eff6d40adc59256278ea78722928a2;p=dealii.git test for new reinit of BlockSparsityPattern git-svn-id: https://svn.dealii.org/trunk@12783 0785d39b-7218-0410-832d-ea1e28bc413d --- 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