From: Wolfgang Bangerth Date: Mon, 24 Apr 2006 23:06:30 +0000 (+0000) Subject: New tests X-Git-Tag: v8.0.0~11886 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b104ad965c6ca25082df11d0184a5c69ab165f13;p=dealii.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/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/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/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/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/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.