From a1f565dcafebcbfe5ed4bfbc86c7dc907702974d Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 23 Feb 2004 21:39:23 +0000 Subject: [PATCH] New tests. git-svn-id: https://svn.dealii.org/trunk@8496 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/Makefile | 3 +- tests/bits/full_matrix_vector_01.cc | 94 ++++++++++++++++ tests/bits/full_matrix_vector_02.cc | 94 ++++++++++++++++ tests/bits/full_matrix_vector_05.cc | 100 +++++++++++++++++ tests/bits/full_matrix_vector_06.cc | 91 ++++++++++++++++ tests/bits/full_matrix_vector_07.cc | 103 ++++++++++++++++++ .../bits/full_matrix_vector_01.output | 2 + .../bits/full_matrix_vector_02.output | 2 + .../bits/full_matrix_vector_05.output | 2 + .../bits/full_matrix_vector_06.output | 2 + .../bits/full_matrix_vector_07.output | 2 + 11 files changed, 494 insertions(+), 1 deletion(-) create mode 100644 tests/bits/full_matrix_vector_01.cc create mode 100644 tests/bits/full_matrix_vector_02.cc create mode 100644 tests/bits/full_matrix_vector_05.cc create mode 100644 tests/bits/full_matrix_vector_06.cc create mode 100644 tests/bits/full_matrix_vector_07.cc create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_01.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_02.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_05.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_06.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_07.output diff --git a/tests/bits/Makefile b/tests/bits/Makefile index e44d116e2b..f57862e88b 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -46,7 +46,8 @@ tests_x = anna_? \ mapping_q4_3d \ q_points \ find_cell_* \ - sparse_matrix_* + sparse_matrix_* \ + full_matrix_vector_* ifeq ($(USE_CONTRIB_PETSC),yes) tests_x += petsc_* diff --git a/tests/bits/full_matrix_vector_01.cc b/tests/bits/full_matrix_vector_01.cc new file mode 100644 index 0000000000..cad36315ef --- /dev/null +++ b/tests/bits/full_matrix_vector_01.cc @@ -0,0 +1,94 @@ +//---------------------------- full_matrix_vector_01.cc --------------------------- +// $Id$ +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- full_matrix_vector_01.cc --------------------------- + + +// check FullMatrix::vmult + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + FullMatrix m(v.size(), v.size()); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/full_matrix_vector_02.cc b/tests/bits/full_matrix_vector_02.cc new file mode 100644 index 0000000000..722757b43a --- /dev/null +++ b/tests/bits/full_matrix_vector_02.cc @@ -0,0 +1,94 @@ +//---------------------------- full_matrix_vector_02.cc --------------------------- +// $Id$ +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- full_matrix_vector_02.cc --------------------------- + + +// check FullMatrix::Tvmult + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + FullMatrix m(v.size(), v.size()); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/full_matrix_vector_05.cc b/tests/bits/full_matrix_vector_05.cc new file mode 100644 index 0000000000..b7d53001f3 --- /dev/null +++ b/tests/bits/full_matrix_vector_05.cc @@ -0,0 +1,100 @@ +//---------------------------- full_matrix_vector_05.cc --------------------------- +// $Id$ +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- full_matrix_vector_05.cc --------------------------- + + +// check FullMatrix::matrix_scalar_product + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + FullMatrix m(v.size(), v.size()); + for (unsigned int i=0; i + const double s = m.matrix_scalar_product (w,v); + + // make sure we get the expected result + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/full_matrix_vector_06.cc b/tests/bits/full_matrix_vector_06.cc new file mode 100644 index 0000000000..887cf32ce4 --- /dev/null +++ b/tests/bits/full_matrix_vector_06.cc @@ -0,0 +1,91 @@ +//---------------------------- full_matrix_vector_06.cc --------------------------- +// $Id$ +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- full_matrix_vector_06.cc --------------------------- + + +// check FullMatrix::matrix_norm_square + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v) +{ + FullMatrix m(v.size(), v.size()); + for (unsigned int i=0; i + const double s = m.matrix_norm_square (v); + + // make sure we get the expected result + for (unsigned int i=0; i v (100); + test (v); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/full_matrix_vector_07.cc b/tests/bits/full_matrix_vector_07.cc new file mode 100644 index 0000000000..36ae540727 --- /dev/null +++ b/tests/bits/full_matrix_vector_07.cc @@ -0,0 +1,103 @@ +//---------------------------- full_matrix_vector_07.cc --------------------------- +// $Id$ +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- full_matrix_vector_07.cc --------------------------- + + +// check FullMatrix::matrix_norm_square + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + FullMatrix m(v.size(), v.size()); + for (unsigned int i=0; i v (100); + Vector w (100); + Vector x (100); + test (v,w,x); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_01.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_01.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_01.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_02.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_02.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_02.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_05.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_05.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_05.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_06.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_06.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_06.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_07.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_07.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_vector_07.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5