From: Guido Kanschat Date: Tue, 30 Oct 2007 20:23:41 +0000 (+0000) Subject: test FilteredMatrix X-Git-Tag: v8.0.0~9698 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67a777360326a86953fc771e4bd173b01d8bd4c4;p=dealii.git test FilteredMatrix git-svn-id: https://svn.dealii.org/trunk@15398 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 4155942dc4..cc6a7ae70c 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -27,7 +27,7 @@ tests_x = vector-vector \ block_sparsity_pattern_01 \ block_indices block_vector block_vector_* block_matrices \ matrix_lib matrix_out pointer_matrix pointer_matrix_vector \ - solver eigen \ + solver eigen filtered_matrix \ sparse_ilu sparse_ilu_t lapack_fill block_minres \ identity_matrix* trace \ print_formatted_* \ diff --git a/tests/lac/filtered_matrix.cc b/tests/lac/filtered_matrix.cc new file mode 100644 index 0000000000..dfb64b54f6 --- /dev/null +++ b/tests/lac/filtered_matrix.cc @@ -0,0 +1,102 @@ +//---------------------------------------------------------------------- +// $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 properties of FilteredMatrix and iterators + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + + +template +void test (const FilteredMatrix& M) +{ + deallog << "Iterator"; + + unsigned int max = 0; + for (typename FilteredMatrix::const_iterator i= M.begin(); + i != M.end();++i) + { + Assert(i->row() == i->column(), ExcInternalError()); + deallog << ' ' << i->row() << ':' << i->value(); + max = i->row(); + } + VECTOR v(max+1); + VECTOR w(max+1); + + for (unsigned int i=0;i > s(identity, 3.); + + FilteredMatrix > f; + f.initialize(s, false); + test(f); + + for (unsigned int i=0;i<5;++i) + f.add_constraint(i*i,i/2.); + test(f); + + f.initialize(s, true); + test(f); + +} diff --git a/tests/lac/filtered_matrix/cmp/generic b/tests/lac/filtered_matrix/cmp/generic new file mode 100644 index 0000000000..cf24a40a22 --- /dev/null +++ b/tests/lac/filtered_matrix/cmp/generic @@ -0,0 +1,19 @@ + +DEAL::Iterator +DEAL::vmult 93.0000 +DEAL::Tvmult 93.0000 +DEAL::vmult_add 186.000 +DEAL::boundary 186.000 +DEAL::boundary 186.000 +DEAL::Iterator 0:0 1:0.500000 4:1.00000 9:1.50000 16:2.00000 +DEAL::vmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000 +DEAL::Tvmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000 +DEAL::vmult_add 31.0000 32.0000 198.000 204.000 35.0000 216.000 222.000 228.000 234.000 40.0000 246.000 252.000 258.000 264.000 270.000 276.000 47.0000 +DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000 +DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000 +DEAL::Iterator 0:0 1:0.500000 4:1.00000 9:1.50000 16:2.00000 +DEAL::vmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000 +DEAL::Tvmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000 +DEAL::vmult_add 31.0000 32.0000 198.000 204.000 35.0000 216.000 222.000 228.000 234.000 40.0000 246.000 252.000 258.000 264.000 270.000 276.000 47.0000 +DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000 +DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000