From 2f1faa5e1da22fd72cbba2c5fda5280895d6cc75 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 18 Nov 2007 05:53:38 +0000 Subject: [PATCH] More tests git-svn-id: https://svn.dealii.org/trunk@15514 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/full_matrix_37.cc | 36 +++++++++ tests/bits/full_matrix_37/cmp/generic | 51 ++++++++++++ tests/bits/full_matrix_38.cc | 36 +++++++++ tests/bits/full_matrix_38/cmp/generic | 51 ++++++++++++ tests/bits/full_matrix_39.cc | 37 +++++++++ tests/bits/full_matrix_39/cmp/generic | 51 ++++++++++++ tests/bits/full_matrix_40.cc | 34 ++++++++ tests/bits/full_matrix_40/cmp/generic | 51 ++++++++++++ tests/bits/full_matrix_41.cc | 35 ++++++++ tests/bits/full_matrix_41/cmp/generic | 51 ++++++++++++ tests/bits/full_matrix_42.cc | 42 ++++++++++ tests/bits/full_matrix_42/cmp/generic | 111 ++++++++++++++++++++++++++ 12 files changed, 586 insertions(+) create mode 100644 tests/bits/full_matrix_37.cc create mode 100644 tests/bits/full_matrix_37/cmp/generic create mode 100644 tests/bits/full_matrix_38.cc create mode 100644 tests/bits/full_matrix_38/cmp/generic create mode 100644 tests/bits/full_matrix_39.cc create mode 100644 tests/bits/full_matrix_39/cmp/generic create mode 100644 tests/bits/full_matrix_40.cc create mode 100644 tests/bits/full_matrix_40/cmp/generic create mode 100644 tests/bits/full_matrix_41.cc create mode 100644 tests/bits/full_matrix_41/cmp/generic create mode 100644 tests/bits/full_matrix_42.cc create mode 100644 tests/bits/full_matrix_42/cmp/generic diff --git a/tests/bits/full_matrix_37.cc b/tests/bits/full_matrix_37.cc new file mode 100644 index 0000000000..1a86fd62be --- /dev/null +++ b/tests/bits/full_matrix_37.cc @@ -0,0 +1,36 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::equ + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_37/output"; + + +template +void +check () +{ + FullMatrix m,n; + make_matrix (m); + make_matrix (n); + m.equ (3.14159, n); + + print_matrix (m); +} + diff --git a/tests/bits/full_matrix_37/cmp/generic b/tests/bits/full_matrix_37/cmp/generic new file mode 100644 index 0000000000..f94e065a5b --- /dev/null +++ b/tests/bits/full_matrix_37/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::0 0 6.3 +DEAL::0 1 9.4 +DEAL::0 2 13. +DEAL::0 3 16. +DEAL::0 4 19. +DEAL::1 0 13. +DEAL::1 1 19. +DEAL::1 2 25. +DEAL::1 3 31. +DEAL::1 4 38. +DEAL::2 0 19. +DEAL::2 1 28. +DEAL::2 2 38. +DEAL::2 3 47. +DEAL::2 4 57. +DEAL::3 0 25. +DEAL::3 1 38. +DEAL::3 2 50. +DEAL::3 3 63. +DEAL::3 4 75. +DEAL::4 0 31. +DEAL::4 1 47. +DEAL::4 2 63. +DEAL::4 3 79. +DEAL::4 4 94. +DEAL::0 0 6.3 +DEAL::0 1 9.4 +DEAL::0 2 13. +DEAL::0 3 16. +DEAL::0 4 19. +DEAL::1 0 13. +DEAL::1 1 19. +DEAL::1 2 25. +DEAL::1 3 31. +DEAL::1 4 38. +DEAL::2 0 19. +DEAL::2 1 28. +DEAL::2 2 38. +DEAL::2 3 47. +DEAL::2 4 57. +DEAL::3 0 25. +DEAL::3 1 38. +DEAL::3 2 50. +DEAL::3 3 63. +DEAL::3 4 75. +DEAL::4 0 31. +DEAL::4 1 47. +DEAL::4 2 63. +DEAL::4 3 79. +DEAL::4 4 94. diff --git a/tests/bits/full_matrix_38.cc b/tests/bits/full_matrix_38.cc new file mode 100644 index 0000000000..ee6efa72e1 --- /dev/null +++ b/tests/bits/full_matrix_38.cc @@ -0,0 +1,36 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::equ(4) + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_38/output"; + + +template +void +check () +{ + FullMatrix m,n,o; + make_matrix (m); + make_matrix (n); + make_matrix (o); + m.equ (3.1415, n, 2.718, o); + print_matrix (m); +} + diff --git a/tests/bits/full_matrix_38/cmp/generic b/tests/bits/full_matrix_38/cmp/generic new file mode 100644 index 0000000000..dc241844de --- /dev/null +++ b/tests/bits/full_matrix_38/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::0 0 12. +DEAL::0 1 18. +DEAL::0 2 23. +DEAL::0 3 29. +DEAL::0 4 35. +DEAL::1 0 23. +DEAL::1 1 35. +DEAL::1 2 47. +DEAL::1 3 59. +DEAL::1 4 70. +DEAL::2 0 35. +DEAL::2 1 53. +DEAL::2 2 70. +DEAL::2 3 88. +DEAL::2 4 1.1e+02 +DEAL::3 0 47. +DEAL::3 1 70. +DEAL::3 2 94. +DEAL::3 3 1.2e+02 +DEAL::3 4 1.4e+02 +DEAL::4 0 59. +DEAL::4 1 88. +DEAL::4 2 1.2e+02 +DEAL::4 3 1.5e+02 +DEAL::4 4 1.8e+02 +DEAL::0 0 12. +DEAL::0 1 18. +DEAL::0 2 23. +DEAL::0 3 29. +DEAL::0 4 35. +DEAL::1 0 23. +DEAL::1 1 35. +DEAL::1 2 47. +DEAL::1 3 59. +DEAL::1 4 70. +DEAL::2 0 35. +DEAL::2 1 53. +DEAL::2 2 70. +DEAL::2 3 88. +DEAL::2 4 1.1e+02 +DEAL::3 0 47. +DEAL::3 1 70. +DEAL::3 2 94. +DEAL::3 3 1.2e+02 +DEAL::3 4 1.4e+02 +DEAL::4 0 59. +DEAL::4 1 88. +DEAL::4 2 1.2e+02 +DEAL::4 3 1.5e+02 +DEAL::4 4 1.8e+02 diff --git a/tests/bits/full_matrix_39.cc b/tests/bits/full_matrix_39.cc new file mode 100644 index 0000000000..6e6b30f526 --- /dev/null +++ b/tests/bits/full_matrix_39.cc @@ -0,0 +1,37 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::equ (6) + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_39/output"; + + +template +void +check () +{ + FullMatrix m,n,o,p; + make_matrix (m); + make_matrix (n); + make_matrix (o); + make_matrix (p); + m.equ (3.1415, n, 2.718, o, 1.414, p); + print_matrix (m); +} + diff --git a/tests/bits/full_matrix_39/cmp/generic b/tests/bits/full_matrix_39/cmp/generic new file mode 100644 index 0000000000..f1baf770d7 --- /dev/null +++ b/tests/bits/full_matrix_39/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::0 0 15. +DEAL::0 1 22. +DEAL::0 2 29. +DEAL::0 3 36. +DEAL::0 4 44. +DEAL::1 0 29. +DEAL::1 1 44. +DEAL::1 2 58. +DEAL::1 3 73. +DEAL::1 4 87. +DEAL::2 0 44. +DEAL::2 1 65. +DEAL::2 2 87. +DEAL::2 3 1.1e+02 +DEAL::2 4 1.3e+02 +DEAL::3 0 58. +DEAL::3 1 87. +DEAL::3 2 1.2e+02 +DEAL::3 3 1.5e+02 +DEAL::3 4 1.7e+02 +DEAL::4 0 73. +DEAL::4 1 1.1e+02 +DEAL::4 2 1.5e+02 +DEAL::4 3 1.8e+02 +DEAL::4 4 2.2e+02 +DEAL::0 0 15. +DEAL::0 1 22. +DEAL::0 2 29. +DEAL::0 3 36. +DEAL::0 4 44. +DEAL::1 0 29. +DEAL::1 1 44. +DEAL::1 2 58. +DEAL::1 3 73. +DEAL::1 4 87. +DEAL::2 0 44. +DEAL::2 1 65. +DEAL::2 2 87. +DEAL::2 3 1.1e+02 +DEAL::2 4 1.3e+02 +DEAL::3 0 58. +DEAL::3 1 87. +DEAL::3 2 1.2e+02 +DEAL::3 3 1.5e+02 +DEAL::3 4 1.7e+02 +DEAL::4 0 73. +DEAL::4 1 1.1e+02 +DEAL::4 2 1.5e+02 +DEAL::4 3 1.8e+02 +DEAL::4 4 2.2e+02 diff --git a/tests/bits/full_matrix_40.cc b/tests/bits/full_matrix_40.cc new file mode 100644 index 0000000000..02a02e4648 --- /dev/null +++ b/tests/bits/full_matrix_40.cc @@ -0,0 +1,34 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::symmetrize + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_40/output"; + + +template +void +check () +{ + FullMatrix m; + make_matrix (m); + m.symmetrize (); + print_matrix (m); +} + diff --git a/tests/bits/full_matrix_40/cmp/generic b/tests/bits/full_matrix_40/cmp/generic new file mode 100644 index 0000000000..12c286e6ac --- /dev/null +++ b/tests/bits/full_matrix_40/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::0 0 2.0 +DEAL::0 1 3.5 +DEAL::0 2 5.0 +DEAL::0 3 6.5 +DEAL::0 4 8.0 +DEAL::1 0 3.5 +DEAL::1 1 6.0 +DEAL::1 2 8.5 +DEAL::1 3 11. +DEAL::1 4 14. +DEAL::2 0 5.0 +DEAL::2 1 8.5 +DEAL::2 2 12. +DEAL::2 3 16. +DEAL::2 4 19. +DEAL::3 0 6.5 +DEAL::3 1 11. +DEAL::3 2 16. +DEAL::3 3 20. +DEAL::3 4 24. +DEAL::4 0 8.0 +DEAL::4 1 14. +DEAL::4 2 19. +DEAL::4 3 24. +DEAL::4 4 30. +DEAL::0 0 2.0 +DEAL::0 1 3.5 +DEAL::0 2 5.0 +DEAL::0 3 6.5 +DEAL::0 4 8.0 +DEAL::1 0 3.5 +DEAL::1 1 6.0 +DEAL::1 2 8.5 +DEAL::1 3 11. +DEAL::1 4 14. +DEAL::2 0 5.0 +DEAL::2 1 8.5 +DEAL::2 2 12. +DEAL::2 3 16. +DEAL::2 4 19. +DEAL::3 0 6.5 +DEAL::3 1 11. +DEAL::3 2 16. +DEAL::3 3 20. +DEAL::3 4 24. +DEAL::4 0 8.0 +DEAL::4 1 14. +DEAL::4 2 19. +DEAL::4 3 24. +DEAL::4 4 30. diff --git a/tests/bits/full_matrix_41.cc b/tests/bits/full_matrix_41.cc new file mode 100644 index 0000000000..67547f8e6a --- /dev/null +++ b/tests/bits/full_matrix_41.cc @@ -0,0 +1,35 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::gauss_jordan + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_41/output"; + + +template +void +check () +{ + FullMatrix m; + make_matrix (m); + m(0,0) = m(1,1) = m(2,2) = m(3,3) = m(4,4) = 50; + m.gauss_jordan (); + print_matrix (m); +} + diff --git a/tests/bits/full_matrix_41/cmp/generic b/tests/bits/full_matrix_41/cmp/generic new file mode 100644 index 0000000000..eb194de2ea --- /dev/null +++ b/tests/bits/full_matrix_41/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::0 0 0.021 +DEAL::0 1 0.00039 +DEAL::0 2 0.00060 +DEAL::0 3 0.00095 +DEAL::0 4 0.0017 +DEAL::1 0 0.00052 +DEAL::1 1 0.022 +DEAL::1 2 0.0013 +DEAL::1 3 0.0021 +DEAL::1 4 0.0037 +DEAL::2 0 0.00090 +DEAL::2 1 0.0015 +DEAL::2 2 0.024 +DEAL::2 3 0.0036 +DEAL::2 4 0.0065 +DEAL::3 0 0.0015 +DEAL::3 1 0.0025 +DEAL::3 2 0.0038 +DEAL::3 3 0.027 +DEAL::3 4 -0.011 +DEAL::4 0 0.0028 +DEAL::4 1 0.0047 +DEAL::4 2 0.0072 +DEAL::4 3 -0.011 +DEAL::4 4 0.030 +DEAL::0 0 0.021 +DEAL::0 1 0.00039 +DEAL::0 2 0.00060 +DEAL::0 3 0.00095 +DEAL::0 4 0.0017 +DEAL::1 0 0.00052 +DEAL::1 1 0.022 +DEAL::1 2 0.0013 +DEAL::1 3 0.0021 +DEAL::1 4 0.0037 +DEAL::2 0 0.00090 +DEAL::2 1 0.0015 +DEAL::2 2 0.024 +DEAL::2 3 0.0036 +DEAL::2 4 0.0065 +DEAL::3 0 0.0015 +DEAL::3 1 0.0025 +DEAL::3 2 0.0038 +DEAL::3 3 0.027 +DEAL::3 4 -0.011 +DEAL::4 0 0.0028 +DEAL::4 1 0.0047 +DEAL::4 2 0.0072 +DEAL::4 3 -0.011 +DEAL::4 4 0.030 diff --git a/tests/bits/full_matrix_42.cc b/tests/bits/full_matrix_42.cc new file mode 100644 index 0000000000..fb4a9356cb --- /dev/null +++ b/tests/bits/full_matrix_42.cc @@ -0,0 +1,42 @@ +//---------------------------------------------------------------------- +// $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. +// +//---------------------------------------------------------------------- + + +// check FullMatrix::invert + + +#include "../tests.h" +#include "full_matrix_common.h" + + +std::string output_file_name = "full_matrix_42/output"; + + +template +void +check () +{ + for (unsigned int n=1; n<=5; ++n) + { + const number array[] = { 50, 2, 3, 4, 5, + 6, 50, 8, 9, 0, + 1, 2, 50, 4, 5, + 6, 7, 8, 50, 0, + 1, 2, 3, 4, 50 }; + + FullMatrix m (n,n,array), p(n,n); + p.invert (m); + print_matrix (p); + } +} + diff --git a/tests/bits/full_matrix_42/cmp/generic b/tests/bits/full_matrix_42/cmp/generic new file mode 100644 index 0000000000..035b441f6b --- /dev/null +++ b/tests/bits/full_matrix_42/cmp/generic @@ -0,0 +1,111 @@ + +DEAL::0 0 0.020 +DEAL::0 0 0.021 +DEAL::0 1 -0.010 +DEAL::1 0 -0.015 +DEAL::1 1 0.26 +DEAL::0 0 0.011 +DEAL::0 1 -0.022 +DEAL::0 2 0.011 +DEAL::1 0 -0.96 +DEAL::1 1 -1.1 +DEAL::1 2 1.0 +DEAL::2 0 0.79 +DEAL::2 1 1.1 +DEAL::2 2 -0.88 +DEAL::0 0 0.049 +DEAL::0 1 0 +DEAL::0 2 -0.024 +DEAL::0 3 -0.024 +DEAL::1 0 -0.32 +DEAL::1 1 -0.012 +DEAL::1 2 -0.60 +DEAL::1 3 0.43 +DEAL::2 0 0.074 +DEAL::2 1 0.023 +DEAL::2 2 -0.026 +DEAL::2 3 -0.072 +DEAL::3 0 -0.26 +DEAL::3 1 -0.012 +DEAL::3 2 0.62 +DEAL::3 3 0.15 +DEAL::0 0 0.020 +DEAL::0 1 0.00052 +DEAL::0 2 0.00081 +DEAL::0 3 0.0013 +DEAL::0 4 0.0019 +DEAL::1 0 0.0020 +DEAL::1 1 0.021 +DEAL::1 2 0.0027 +DEAL::1 3 0.0034 +DEAL::1 4 0.00047 +DEAL::2 0 0.00014 +DEAL::2 1 0.00054 +DEAL::2 2 0.020 +DEAL::2 3 0.0014 +DEAL::2 4 0.0020 +DEAL::3 0 0.0021 +DEAL::3 1 0.0027 +DEAL::3 2 0.0028 +DEAL::3 3 0.021 +DEAL::3 4 0.00049 +DEAL::4 0 0.00015 +DEAL::4 1 0.00056 +DEAL::4 2 0.00088 +DEAL::4 3 0.0014 +DEAL::4 4 0.020 +DEAL::0 0 0.020 +DEAL::0 0 0.021 +DEAL::0 1 -0.010 +DEAL::1 0 -0.015 +DEAL::1 1 0.26 +DEAL::0 0 0.011 +DEAL::0 1 -0.022 +DEAL::0 2 0.011 +DEAL::1 0 -0.96 +DEAL::1 1 -1.1 +DEAL::1 2 1.0 +DEAL::2 0 0.79 +DEAL::2 1 1.1 +DEAL::2 2 -0.88 +DEAL::0 0 0.049 +DEAL::0 1 0.0 +DEAL::0 2 -0.024 +DEAL::0 3 -0.024 +DEAL::1 0 -0.32 +DEAL::1 1 -0.012 +DEAL::1 2 -0.60 +DEAL::1 3 0.43 +DEAL::2 0 0.074 +DEAL::2 1 0.023 +DEAL::2 2 -0.026 +DEAL::2 3 -0.072 +DEAL::3 0 -0.26 +DEAL::3 1 -0.012 +DEAL::3 2 0.62 +DEAL::3 3 0.15 +DEAL::0 0 0.020 +DEAL::0 1 0.00052 +DEAL::0 2 0.00081 +DEAL::0 3 0.0013 +DEAL::0 4 0.0019 +DEAL::1 0 0.0020 +DEAL::1 1 0.021 +DEAL::1 2 0.0027 +DEAL::1 3 0.0034 +DEAL::1 4 0.00047 +DEAL::2 0 0.00014 +DEAL::2 1 0.00054 +DEAL::2 2 0.020 +DEAL::2 3 0.0014 +DEAL::2 4 0.0020 +DEAL::3 0 0.0021 +DEAL::3 1 0.0027 +DEAL::3 2 0.0028 +DEAL::3 3 0.021 +DEAL::3 4 0.00049 +DEAL::4 0 0.00015 +DEAL::4 1 0.00056 +DEAL::4 2 0.00088 +DEAL::4 3 0.0014 +DEAL::4 4 0.020 -- 2.39.5