]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New class IndexSet.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Oct 2009 21:56:14 +0000 (21:56 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Oct 2009 21:56:14 +0000 (21:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@19788 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/Makefile
tests/base/index_set_01.cc [new file with mode: 0644]
tests/base/index_set_01/cmp/generic [new file with mode: 0644]
tests/base/index_set_01/cmp/powerpc-apple-darwin8.10.0+gcc4.0 [new file with mode: 0644]
tests/base/index_set_01/cmp/powerpc-apple-darwin8.8.0+gcc4.0 [new file with mode: 0644]

index 4ccae89d946d3e9c28fa070916f70d9defb168cf..977542d9d26e159e23f8d112b1fa66faab4c2fe2 100644 (file)
@@ -72,6 +72,7 @@ tests_x =  geometry_info_* \
           table \
           tensor \
           tensor_* \
+          index_set_* \
           symmetric_tensor_* \
           full_tensor_* \
            timer \
diff --git a/tests/base/index_set_01.cc b/tests/base/index_set_01.cc
new file mode 100644 (file)
index 0000000..afb7484
--- /dev/null
@@ -0,0 +1,51 @@
+//-----------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2009 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.
+//
+//-----------------------------------------------------------------------------
+
+// test functions in namespace Utilities
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+
+#include <base/index_set.h>
+
+
+void test ()
+{
+  IndexSet index_set (20);
+  index_set.add_range (2,4);
+  index_set.add_range (12,18);
+  index_set.add_index (6);
+  index_set.add_index (8);
+  index_set.add_index (14);
+  index_set.add_index (16);
+
+  for (unsigned int i=0; i<index_set.size(); ++i)
+    deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
+           << std::endl;
+}
+
+
+
+
+int main()
+{
+  std::ofstream logfile("index_set_01/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test ();
+}
diff --git a/tests/base/index_set_01/cmp/generic b/tests/base/index_set_01/cmp/generic
new file mode 100644 (file)
index 0000000..00d6009
--- /dev/null
@@ -0,0 +1,21 @@
+
+DEAL::0 false
+DEAL::1 false
+DEAL::2 true
+DEAL::3 true
+DEAL::4 false
+DEAL::5 false
+DEAL::6 true
+DEAL::7 false
+DEAL::8 true
+DEAL::9 false
+DEAL::10 false
+DEAL::11 false
+DEAL::12 true
+DEAL::13 true
+DEAL::14 true
+DEAL::15 true
+DEAL::16 true
+DEAL::17 true
+DEAL::18 false
+DEAL::19 false
diff --git a/tests/base/index_set_01/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/base/index_set_01/cmp/powerpc-apple-darwin8.10.0+gcc4.0
new file mode 100644 (file)
index 0000000..902f619
--- /dev/null
@@ -0,0 +1,9 @@
+
+DEAL::0042
+DEAL::42
+DEAL::3
+DEAL::413
+DEAL::1
+DEAL::-12
+DEAL::125
+DEAL::-177.002 -36.2427 43.4584 
diff --git a/tests/base/index_set_01/cmp/powerpc-apple-darwin8.8.0+gcc4.0 b/tests/base/index_set_01/cmp/powerpc-apple-darwin8.8.0+gcc4.0
new file mode 100644 (file)
index 0000000..902f619
--- /dev/null
@@ -0,0 +1,9 @@
+
+DEAL::0042
+DEAL::42
+DEAL::3
+DEAL::413
+DEAL::1
+DEAL::-12
+DEAL::125
+DEAL::-177.002 -36.2427 43.4584 

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.