From: wolf Date: Mon, 24 Apr 2006 23:06:30 +0000 (+0000) Subject: New tests X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6d1478097a0bdb3f0e1bd92d8de78f862be11b8;p=dealii-svn.git New tests git-svn-id: https://svn.dealii.org/trunk@12869 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/Makefile b/tests/lac/Makefile index f432114908..6018121e63 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -27,7 +27,8 @@ tests_x = vector-vector \ block_vector block_vector_* block_matrices \ matrix_lib matrix_out \ solver eigen \ - sparse_ilu sparse_ilu_t lapack lapack_fill block_minres + sparse_ilu sparse_ilu_t lapack lapack_fill block_minres \ + identity_matrix* # from above list of regular expressions, generate the real set of diff --git a/tests/lac/identity_matrix_01.cc b/tests/lac/identity_matrix_01.cc new file mode 100644 index 0000000000..f7a5bad53f --- /dev/null +++ b/tests/lac/identity_matrix_01.cc @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 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. +// +//--------------------------------------------------------------------------- + +// check IdentityMatrix::vmult and friends + + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include + +template +void +check_vmult() +{ + IdentityMatrix M(4); + Vector u(4); + Vector v(4); + + for (unsigned int i=0;i<4;++i) + u(i) = i+1; + + M.vmult(v,u); + Assert (v == u, ExcInternalError()); + for (unsigned int i=0;i(); + check_vmult(); +} diff --git a/tests/lac/identity_matrix_01/.cvsignore b/tests/lac/identity_matrix_01/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/lac/identity_matrix_01/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/lac/identity_matrix_01/cmp/generic b/tests/lac/identity_matrix_01/cmp/generic new file mode 100644 index 0000000000..29bcfce3a3 --- /dev/null +++ b/tests/lac/identity_matrix_01/cmp/generic @@ -0,0 +1,9 @@ + +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. diff --git a/tests/lac/identity_matrix_02.cc b/tests/lac/identity_matrix_02.cc new file mode 100644 index 0000000000..46d825eb50 --- /dev/null +++ b/tests/lac/identity_matrix_02.cc @@ -0,0 +1,77 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 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. +// +//--------------------------------------------------------------------------- + +// check conversion constructor from IdentityMatrix to FullMatrix + + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include +#include + +template +void +check_vmult() +{ + FullMatrix M(IdentityMatrix(4)); + Vector u(4); + Vector v(4); + + for (unsigned int i=0;i<4;++i) + u(i) = i+1; + + M.vmult(v,u); + Assert (v == u, ExcInternalError()); + for (unsigned int i=0;i(); + check_vmult(); +} diff --git a/tests/lac/identity_matrix_02/.cvsignore b/tests/lac/identity_matrix_02/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/lac/identity_matrix_02/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/lac/identity_matrix_02/cmp/generic b/tests/lac/identity_matrix_02/cmp/generic new file mode 100644 index 0000000000..29bcfce3a3 --- /dev/null +++ b/tests/lac/identity_matrix_02/cmp/generic @@ -0,0 +1,9 @@ + +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. diff --git a/tests/lac/identity_matrix_03.cc b/tests/lac/identity_matrix_03.cc new file mode 100644 index 0000000000..09ca305eba --- /dev/null +++ b/tests/lac/identity_matrix_03.cc @@ -0,0 +1,78 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 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. +// +//--------------------------------------------------------------------------- + +// check assignment from IdentityMatrix to FullMatrix + + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include +#include + +template +void +check_vmult() +{ + FullMatrix M; + M = IdentityMatrix(4); + Vector u(4); + Vector v(4); + + for (unsigned int i=0;i<4;++i) + u(i) = i+1; + + M.vmult(v,u); + Assert (v == u, ExcInternalError()); + for (unsigned int i=0;i(); + check_vmult(); +} diff --git a/tests/lac/identity_matrix_03/.cvsignore b/tests/lac/identity_matrix_03/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/lac/identity_matrix_03/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/lac/identity_matrix_03/cmp/generic b/tests/lac/identity_matrix_03/cmp/generic new file mode 100644 index 0000000000..29bcfce3a3 --- /dev/null +++ b/tests/lac/identity_matrix_03/cmp/generic @@ -0,0 +1,9 @@ + +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. diff --git a/tests/lac/identity_matrix_04.cc b/tests/lac/identity_matrix_04.cc new file mode 100644 index 0000000000..46ef4d8faf --- /dev/null +++ b/tests/lac/identity_matrix_04.cc @@ -0,0 +1,82 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 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. +// +//--------------------------------------------------------------------------- + +// check conversion constructor from IdentityMatrix to SparseMatrix + + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include +#include + +template +void +check_vmult() +{ + SparsityPattern sp(4,4,1); + for (unsigned int i=0; i<4; ++i) + sp.add (i,i); + sp.compress (); + + SparseMatrix M(sp, IdentityMatrix(4)); + Vector u(4); + Vector v(4); + + for (unsigned int i=0;i<4;++i) + u(i) = i+1; + + M.vmult(v,u); + Assert (v == u, ExcInternalError()); + for (unsigned int i=0;i(); + check_vmult(); +} diff --git a/tests/lac/identity_matrix_04/.cvsignore b/tests/lac/identity_matrix_04/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/lac/identity_matrix_04/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/lac/identity_matrix_04/cmp/generic b/tests/lac/identity_matrix_04/cmp/generic new file mode 100644 index 0000000000..29bcfce3a3 --- /dev/null +++ b/tests/lac/identity_matrix_04/cmp/generic @@ -0,0 +1,9 @@ + +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. diff --git a/tests/lac/identity_matrix_05.cc b/tests/lac/identity_matrix_05.cc new file mode 100644 index 0000000000..ce38d3005f --- /dev/null +++ b/tests/lac/identity_matrix_05.cc @@ -0,0 +1,83 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 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. +// +//--------------------------------------------------------------------------- + +// check assignment from IdentityMatrix to SparseMatrix + + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include +#include + +template +void +check_vmult() +{ + SparsityPattern sp(4,4,1); + for (unsigned int i=0; i<4; ++i) + sp.add (i,i); + sp.compress (); + + SparseMatrix M(sp); + M = IdentityMatrix(4); + Vector u(4); + Vector v(4); + + for (unsigned int i=0;i<4;++i) + u(i) = i+1; + + M.vmult(v,u); + Assert (v == u, ExcInternalError()); + for (unsigned int i=0;i(); + check_vmult(); +} diff --git a/tests/lac/identity_matrix_05/.cvsignore b/tests/lac/identity_matrix_05/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/lac/identity_matrix_05/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/lac/identity_matrix_05/cmp/generic b/tests/lac/identity_matrix_05/cmp/generic new file mode 100644 index 0000000000..29bcfce3a3 --- /dev/null +++ b/tests/lac/identity_matrix_05/cmp/generic @@ -0,0 +1,9 @@ + +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4. +DEAL:: 1. 2. 3. 4.