]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add new testcases from the branch that wouldn't let themselves be copied.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 Dec 2008 23:08:08 +0000 (23:08 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 Dec 2008 23:08:08 +0000 (23:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@17870 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/full_matrix_53.cc [new file with mode: 0644]
tests/bits/full_matrix_53/cmp/generic [new file with mode: 0644]
tests/bits/full_matrix_54.cc [new file with mode: 0644]
tests/bits/full_matrix_54/cmp/generic [new file with mode: 0644]
tests/deal.II/iterators_3d.cc [new file with mode: 0644]
tests/deal.II/iterators_3d/cmp/generic [new file with mode: 0644]

diff --git a/tests/bits/full_matrix_53.cc b/tests/bits/full_matrix_53.cc
new file mode 100644 (file)
index 0000000..11002ed
--- /dev/null
@@ -0,0 +1,79 @@
+//----------------------------------------------------------------------
+//    $Id: full_matrix_28.cc 15513 2007-11-18 05:44:22Z bangerth $
+//    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::left_invert and FullMatrix::right_invert
+
+
+#include "../tests.h"
+#include "full_matrix_common.h"
+
+
+std::string output_file_name = "full_matrix_53/output";
+
+template <typename number>
+void
+calculate(const FullMatrix<number> A,
+         const FullMatrix<number> B)
+{
+
+  FullMatrix<number> A_r_inv(A.n(),A.m());
+  FullMatrix<number> identity(A.m(),A.m()); 
+  A_r_inv.right_invert(A);
+  deallog<<"A matrix"<<std::endl;
+  display_matrix(A);
+  deallog<<"Right inverse"<<std::endl;
+  display_matrix(A_r_inv);
+  deallog<<"Identity = A*A_r_inv"<<std::endl;
+  A.mmult(identity,A_r_inv);
+  display_matrix(identity);
+
+  deallog<<std::endl;
+
+  FullMatrix<number> B_l_inv(B.n(),B.m());
+  FullMatrix<number> identity2(B.n(),B.n());
+  B_l_inv.left_invert(B);
+  deallog<<"B matrix"<<std::endl;
+  display_matrix(B);
+  deallog<<"Left inverse"<<std::endl;
+  display_matrix(B_l_inv);
+  deallog<<"Identity = B_l_inv*B"<<std::endl;
+  B_l_inv.mmult(identity2,B);
+  display_matrix(identity2);
+
+}
+
+
+template <typename number>
+void
+check ()
+{
+  
+  FullMatrix<number> A(1,2);
+  fill_matrix(A);  
+
+  FullMatrix<number> B(2,1);
+  fill_matrix(B);
+
+  calculate(A,B); 
+
+  FullMatrix<number> A1(2,3);
+  fill_matrix(A1);  
+
+  FullMatrix<number> B1(3,2);
+  fill_matrix(B1);
+
+  calculate(A1,B1); 
+
+}
+
diff --git a/tests/bits/full_matrix_53/cmp/generic b/tests/bits/full_matrix_53/cmp/generic
new file mode 100644 (file)
index 0000000..c31c01f
--- /dev/null
@@ -0,0 +1,97 @@
+
+DEAL::A matrix
+DEAL::1x2 matrix
+DEAL::1.0 2.0 
+DEAL::Right inverse
+DEAL::2x1 matrix
+DEAL::0.20 
+DEAL::0.40 
+DEAL::Identity = A*A_r_inv
+DEAL::1x1 matrix
+DEAL::1.0 
+DEAL::
+DEAL::B matrix
+DEAL::2x1 matrix
+DEAL::1.0 
+DEAL::2.0 
+DEAL::Left inverse
+DEAL::1x2 matrix
+DEAL::0.20 0.40 
+DEAL::Identity = B_l_inv*B
+DEAL::1x1 matrix
+DEAL::1.0 
+DEAL::A matrix
+DEAL::2x3 matrix
+DEAL::1.0 2.0 3.0 
+DEAL::4.0 5.0 6.0 
+DEAL::Right inverse
+DEAL::3x2 matrix
+DEAL::-0.94 0.44 
+DEAL::-0.11 0.11 
+DEAL::0.72 -0.22 
+DEAL::Identity = A*A_r_inv
+DEAL::2x2 matrix
+DEAL::1.0 0 
+DEAL::0 1.0 
+DEAL::
+DEAL::B matrix
+DEAL::3x2 matrix
+DEAL::1.0 2.0 
+DEAL::3.0 4.0 
+DEAL::5.0 6.0 
+DEAL::Left inverse
+DEAL::2x3 matrix
+DEAL::-1.3 -0.33 0.67 
+DEAL::1.1 0.33 -0.42 
+DEAL::Identity = B_l_inv*B
+DEAL::2x2 matrix
+DEAL::1.0 0 
+DEAL::0 1.0 
+DEAL::A matrix
+DEAL::1x2 matrix
+DEAL::1.0 2.0 
+DEAL::Right inverse
+DEAL::2x1 matrix
+DEAL::0.20 
+DEAL::0.40 
+DEAL::Identity = A*A_r_inv
+DEAL::1x1 matrix
+DEAL::1.0 
+DEAL::
+DEAL::B matrix
+DEAL::2x1 matrix
+DEAL::1.0 
+DEAL::2.0 
+DEAL::Left inverse
+DEAL::1x2 matrix
+DEAL::0.20 0.40 
+DEAL::Identity = B_l_inv*B
+DEAL::1x1 matrix
+DEAL::1.0 
+DEAL::A matrix
+DEAL::2x3 matrix
+DEAL::1.0 2.0 3.0 
+DEAL::4.0 5.0 6.0 
+DEAL::Right inverse
+DEAL::3x2 matrix
+DEAL::-0.94 0.44 
+DEAL::-0.11 0.11 
+DEAL::0.72 -0.22 
+DEAL::Identity = A*A_r_inv
+DEAL::2x2 matrix
+DEAL::1.0 -2.4e-07 
+DEAL::-4.8e-07 1.0 
+DEAL::
+DEAL::B matrix
+DEAL::3x2 matrix
+DEAL::1.0 2.0 
+DEAL::3.0 4.0 
+DEAL::5.0 6.0 
+DEAL::Left inverse
+DEAL::2x3 matrix
+DEAL::-1.3 -0.33 0.67 
+DEAL::1.1 0.33 -0.42 
+DEAL::Identity = B_l_inv*B
+DEAL::2x2 matrix
+DEAL::1.0 7.6e-06 
+DEAL::2.4e-07 1.0 
diff --git a/tests/bits/full_matrix_54.cc b/tests/bits/full_matrix_54.cc
new file mode 100644 (file)
index 0000000..7e21752
--- /dev/null
@@ -0,0 +1,38 @@
+//----------------------------------------------------------------------
+//    $Id: full_matrix_28.cc 15513 2007-11-18 05:44:22Z bangerth $
+//    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.
+//
+//----------------------------------------------------------------------
+
+
+// another check FullMatrix::Tadd
+// proper transposition of rectangular matrices is verified
+
+
+#include "../tests.h"
+#include "full_matrix_common.h"
+
+
+std::string output_file_name = "full_matrix_54/output";
+
+
+template <typename number>
+void
+check ()
+{
+  FullMatrix<number> A(8,9);
+  fill_matrix(A);
+  deallog<<"Given matrix"<<std::endl;
+  display_matrix(A);
+  FullMatrix<number> A_t(A.n(),A.m());
+  A_t.Tadd(A,1);
+  deallog<<"Transposed matrix"<<std::endl;
+  display_matrix(A_t);
+}
diff --git a/tests/bits/full_matrix_54/cmp/generic b/tests/bits/full_matrix_54/cmp/generic
new file mode 100644 (file)
index 0000000..102d628
--- /dev/null
@@ -0,0 +1,43 @@
+
+DEAL::Given matrix
+DEAL::8x9 matrix
+DEAL::1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 
+DEAL::10. 11. 12. 13. 14. 15. 16. 17. 18. 
+DEAL::19. 20. 21. 22. 23. 24. 25. 26. 27. 
+DEAL::28. 29. 30. 31. 32. 33. 34. 35. 36. 
+DEAL::37. 38. 39. 40. 41. 42. 43. 44. 45. 
+DEAL::46. 47. 48. 49. 50. 51. 52. 53. 54. 
+DEAL::55. 56. 57. 58. 59. 60. 61. 62. 63. 
+DEAL::64. 65. 66. 67. 68. 69. 70. 71. 72. 
+DEAL::Transposed matrix
+DEAL::9x8 matrix
+DEAL::1.0 10. 19. 28. 37. 46. 55. 64. 
+DEAL::2.0 11. 20. 29. 38. 47. 56. 65. 
+DEAL::3.0 12. 21. 30. 39. 48. 57. 66. 
+DEAL::4.0 13. 22. 31. 40. 49. 58. 67. 
+DEAL::5.0 14. 23. 32. 41. 50. 59. 68. 
+DEAL::6.0 15. 24. 33. 42. 51. 60. 69. 
+DEAL::7.0 16. 25. 34. 43. 52. 61. 70. 
+DEAL::8.0 17. 26. 35. 44. 53. 62. 71. 
+DEAL::9.0 18. 27. 36. 45. 54. 63. 72. 
+DEAL::Given matrix
+DEAL::8x9 matrix
+DEAL::1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 
+DEAL::10. 11. 12. 13. 14. 15. 16. 17. 18. 
+DEAL::19. 20. 21. 22. 23. 24. 25. 26. 27. 
+DEAL::28. 29. 30. 31. 32. 33. 34. 35. 36. 
+DEAL::37. 38. 39. 40. 41. 42. 43. 44. 45. 
+DEAL::46. 47. 48. 49. 50. 51. 52. 53. 54. 
+DEAL::55. 56. 57. 58. 59. 60. 61. 62. 63. 
+DEAL::64. 65. 66. 67. 68. 69. 70. 71. 72. 
+DEAL::Transposed matrix
+DEAL::9x8 matrix
+DEAL::1.0 10. 19. 28. 37. 46. 55. 64. 
+DEAL::2.0 11. 20. 29. 38. 47. 56. 65. 
+DEAL::3.0 12. 21. 30. 39. 48. 57. 66. 
+DEAL::4.0 13. 22. 31. 40. 49. 58. 67. 
+DEAL::5.0 14. 23. 32. 41. 50. 59. 68. 
+DEAL::6.0 15. 24. 33. 42. 51. 60. 69. 
+DEAL::7.0 16. 25. 34. 43. 52. 61. 70. 
+DEAL::8.0 17. 26. 35. 44. 53. 62. 71. 
+DEAL::9.0 18. 27. 36. 45. 54. 63. 72. 
diff --git a/tests/deal.II/iterators_3d.cc b/tests/deal.II/iterators_3d.cc
new file mode 100644 (file)
index 0000000..276fa9d
--- /dev/null
@@ -0,0 +1,114 @@
+//----------------------------  iterators_3d.cc  ---------------------------
+//    $Id: iterators_3d.cc 17599 2008-11-15 04:06:30Z bangerth $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2008 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.
+//
+//----------------------------  iterators_3d.cc  ---------------------------
+
+
+// a test written in an attempt to figure out where I messed up
+// converting some iterator functions...
+
+#include "../tests.h"
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+#include <base/logstream.h>
+
+#include <fstream>
+#include <iomanip>
+#include <cmath>
+#include <cstdlib>
+
+
+std::ofstream logfile("iterators_3d/output");
+
+
+template <int dim>
+void test () 
+{
+  deallog << dim << std::endl;
+  
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube (tria);
+  tria.refine_global (2);
+
+  {
+    deallog << "Raw iterators" << std::endl;
+    deallog << tria.begin_raw() << std::endl;
+    if (dim > 1)
+      deallog << tria.begin_raw_face() << std::endl;
+    deallog << tria.last_raw() << std::endl;
+    if (dim > 1)
+      deallog << tria.last_raw_face() << std::endl;
+    if (dim > 1)
+      deallog << tria.end_raw_face() << std::endl;
+  }
+  {
+    deallog << "Iterators" << std::endl;
+    deallog << tria.begin() << std::endl;
+    if (dim > 1)
+      deallog << tria.begin_face() << std::endl;
+    deallog << tria.last() << std::endl;
+    if (dim > 1)
+      deallog << tria.last_face() << std::endl;
+    deallog << tria.end() << std::endl;
+    if (dim > 1)
+      deallog << tria.end_face() << std::endl;
+  }
+  {
+    deallog << "Active iterators" << std::endl;
+    deallog << tria.begin_active() << std::endl;
+    if (dim > 1)
+      deallog << tria.begin_active_face() << std::endl;
+    deallog << tria.last_active() << std::endl;
+    if (dim > 1)
+      deallog << tria.last_active_face() << std::endl;
+    if (dim > 1)
+      deallog << tria.end_active_face() << std::endl;
+  }
+
+  for (unsigned int l=0; l<tria.n_levels(); ++l)
+    {
+      {
+       deallog << "Raw iterators" << std::endl;
+       deallog << tria.begin_raw(l) << std::endl;
+       deallog << tria.last_raw(l) << std::endl;
+       deallog << tria.end_raw(l) << std::endl;
+      }
+      {
+       deallog << "Iterators" << std::endl;
+       deallog << tria.begin(l) << std::endl;
+       deallog << tria.last(l) << std::endl;
+       deallog << tria.end(l) << std::endl;
+      }
+      {
+       deallog << "Active iterators" << std::endl;
+       deallog << tria.begin_active(l) << std::endl;
+       deallog << tria.last_active(l) << std::endl;
+       deallog << tria.end_active(l) << std::endl;
+      }
+    }
+}
+
+
+int main ()
+{
+  deallog << std::setprecision (2);
+  logfile << std::setprecision (2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<1> ();
+  test<2> ();
+  test<3> ();
+}
+
diff --git a/tests/deal.II/iterators_3d/cmp/generic b/tests/deal.II/iterators_3d/cmp/generic
new file mode 100644 (file)
index 0000000..2e11cd1
--- /dev/null
@@ -0,0 +1,160 @@
+
+DEAL::1
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::2.3
+DEAL::Iterators
+DEAL::0.0
+DEAL::2.3
+DEAL::-1.-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::2.3
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::1.0
+DEAL::1.1
+DEAL::2.0
+DEAL::Iterators
+DEAL::1.0
+DEAL::1.1
+DEAL::2.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::2.0
+DEAL::2.3
+DEAL::-1.-1
+DEAL::Iterators
+DEAL::2.0
+DEAL::2.3
+DEAL::-1.-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::2.3
+DEAL::-1.-1
+DEAL::2
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::0
+DEAL::2.15
+DEAL::55
+DEAL::-1
+DEAL::Iterators
+DEAL::0.0
+DEAL::0
+DEAL::2.15
+DEAL::55
+DEAL::-1.-1
+DEAL::-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::16
+DEAL::2.15
+DEAL::55
+DEAL::-1
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::1.0
+DEAL::1.3
+DEAL::2.0
+DEAL::Iterators
+DEAL::1.0
+DEAL::1.3
+DEAL::2.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::2.0
+DEAL::2.15
+DEAL::-1.-1
+DEAL::Iterators
+DEAL::2.0
+DEAL::2.15
+DEAL::-1.-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::2.15
+DEAL::-1.-1
+DEAL::3
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::0
+DEAL::2.63
+DEAL::281
+DEAL::-1
+DEAL::Iterators
+DEAL::0.0
+DEAL::0
+DEAL::2.63
+DEAL::281
+DEAL::-1.-1
+DEAL::-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::42
+DEAL::2.63
+DEAL::281
+DEAL::-1
+DEAL::Raw iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Iterators
+DEAL::0.0
+DEAL::0.0
+DEAL::1.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::1.0
+DEAL::1.7
+DEAL::2.0
+DEAL::Iterators
+DEAL::1.0
+DEAL::1.7
+DEAL::2.0
+DEAL::Active iterators
+DEAL::2.0
+DEAL::-1.-1
+DEAL::2.0
+DEAL::Raw iterators
+DEAL::2.0
+DEAL::2.63
+DEAL::-1.-1
+DEAL::Iterators
+DEAL::2.0
+DEAL::2.63
+DEAL::-1.-1
+DEAL::Active iterators
+DEAL::2.0
+DEAL::2.63
+DEAL::-1.-1

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.