From: heister Date: Tue, 25 Sep 2012 15:58:47 +0000 (+0000) Subject: test for BlockCompressedSimpleSparsityPattern::column_number() X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65119601bf80d09965c5967d384f72f73edbdb76;p=dealii-svn.git test for BlockCompressedSimpleSparsityPattern::column_number() git-svn-id: https://svn.dealii.org/trunk@26729 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/block_compressed_01.cc b/tests/lac/block_compressed_01.cc new file mode 100644 index 0000000000..d783bc7b41 --- /dev/null +++ b/tests/lac/block_compressed_01.cc @@ -0,0 +1,64 @@ +//---------------------------------------------------------------------- +// $Id: block_compressed_simple_sparsity_pattern_indexset_01.cc 25686 2012-07-04 14:18:43Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2006, 2008 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 BlockCompressedSimpleSparsityPattern column_number + + +#include "../tests.h" +#include +#include + +#include +#include + +int main() +{ + std::ofstream logfile("block_compressed_01/output"); + logfile.setf(std::ios::fixed); + deallog << std::setprecision(2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + BlockCompressedSimpleSparsityPattern csp(2,2); + csp.block(0,0).reinit(2,2); + csp.block(1,0).reinit(1,2); + csp.block(0,1).reinit(2,1); + csp.block(1,1).reinit(1,1); + csp.collect_sizes(); + for (int i=0;i<3;++i) + csp.add(i,i); + csp.add(1,0); + csp.add(1,2); + csp.compress(); + + deallog << "blocks: " << csp.n_block_rows() << "x" << csp.n_block_cols() << std::endl; + deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl; + deallog << "size block(1,0):" << csp.block(1,0).n_rows() << "x" << csp.block(1,0).n_cols() << std::endl; + + csp.print(logfile); + + deallog << std::endl; + for (unsigned int i=0;i<3;++i) + { + deallog << "row " << i << ": "; + + for (unsigned int j=0;j