From: Wolfgang Bangerth Date: Mon, 23 Feb 2004 21:39:23 +0000 (+0000) Subject: New tests. X-Git-Tag: v8.0.0~15766 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83881f04f3c2eaa5c43bef585850cb2dad9a6598;p=dealii.git New tests. git-svn-id: https://svn.dealii.org/trunk@8496 0785d39b-7218-0410-832d-ea1e28bc413d --- 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; + }; +}