]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch by Denis Davydov: Add TableIndices::operator[] in a non-const version. Add...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Jul 2013 18:32:54 +0000 (18:32 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Jul 2013 18:32:54 +0000 (18:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@29916 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/table_indices_01.cc [new file with mode: 0644]
tests/base/table_indices_01/cmp/generic [new file with mode: 0644]
tests/base/work_stream_03.cc

diff --git a/tests/base/table_indices_01.cc b/tests/base/table_indices_01.cc
new file mode 100644 (file)
index 0000000..806a881
--- /dev/null
@@ -0,0 +1,48 @@
+//----------------------------  table_indices_01.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006, 2013 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.
+//
+//----------------------------  table_indices_01.cc  ---------------------------
+
+// check TableIndices in various ways
+
+#include "../tests.h"
+#include <deal.II/base/tensor.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <fstream>
+#include <iomanip>
+
+int main ()
+{
+  std::ofstream logfile("table_indices_01/output");
+  deallog << std::setprecision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const TableIndices<2> t1(84,42);
+  TableIndices<2> t2;
+  t2[0] = 84;
+  t2[1] = 42;
+
+  Assert (t1 == t2, ExcInternalError());
+  Assert (t1[0] == t2[0], ExcInternalError());
+  Assert (t1[1] == t2[1], ExcInternalError());
+
+  Assert (! (t1 != t2), ExcInternalError());
+
+  t2.sort();
+  Assert (t1 != t2, ExcInternalError());
+  Assert (t1[0] == t2[1], ExcInternalError());
+  Assert (t1[1] == t2[0], ExcInternalError());
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/table_indices_01/cmp/generic b/tests/base/table_indices_01/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK
index 0493581e31e029af9c73d7c287923b39bc254c2d..eb6dc88d5c8019ca1e50c889ac2745fbb2de7b61 100644 (file)
@@ -19,7 +19,7 @@
 // the failing tests (deal.II/project_q_01) multiple times and
 // verifying that it indeed works
 
-#include "../tests.h"
+//#include "../tests.h"
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/quadrature_lib.h>
@@ -50,6 +50,8 @@
 #include <fstream>
 #include <vector>
 
+using namespace dealii;
+
 
 char logname[] = "work_stream_03/output";
 
@@ -130,7 +132,7 @@ void test ()
 {
   Triangulation<dim>     triangulation;
   GridGenerator::hyper_cube (triangulation);
-  triangulation.refine_global (3);
+  triangulation.refine_global (2);
 
   Threads::TaskGroup<> g;
   for (unsigned int p=1; p<4; ++p)
@@ -148,9 +150,15 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  test<1>();
-  test<2>();
-  test<3>();
+
+  Threads::TaskGroup<> g;
+  for (unsigned int i=0; i<2; ++i)
+    {
+      g += Threads::new_task (&test<1>);
+      g += Threads::new_task (&test<2>);
+      g += Threads::new_task (&test<3>);
+    }
+  g.join_all ();
 
   deallog << "OK" << std::endl;
 }

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.