]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 13:59:37 +0000 (13:59 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 13:59:37 +0000 (13:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@26566 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/fe_collection_03.cc [new file with mode: 0644]
tests/hp/fe_collection_03/cmp/generic [new file with mode: 0644]

diff --git a/tests/hp/fe_collection_03.cc b/tests/hp/fe_collection_03.cc
new file mode 100644 (file)
index 0000000..6c3c2e4
--- /dev/null
@@ -0,0 +1,74 @@
+//----------------------------  fe_collection_03.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2005, 2006, 2012 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.
+//
+//----------------------------  fe_collection_03.cc  ---------------------------
+
+
+// test the results of FECollection::n_blocks()
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/hp/fe_collection.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_raviart_thomas.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+                                  // test things with a collection of
+                                  // primitive elements
+  {
+    hp::FECollection<dim> fe_collection;
+    fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
+    fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
+    Assert (fe_collection.n_components() == dim,
+           ExcInternalError());
+  }
+
+                                  // now the same with one of the elements
+                                  // being non-primitive. the other one can
+                                  // then not simply be a FESystem but must
+                                  // in fact be an FESystem of FESystem to
+                                  // hide multiple components in one block
+  if (dim > 1)
+    {
+      hp::FECollection<dim> fe_collection;
+      fe_collection.push_back (FESystem<dim>(FESystem<dim>(FE_Q<dim>(2),dim),1));
+      fe_collection.push_back (FE_RaviartThomas<dim>(1));
+      Assert (fe_collection.n_blocks() == 1,
+             ExcInternalError());
+    }
+
+  deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("fe_collection_03/output");
+  logfile.precision(2);
+
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<1> ();
+  test<2> ();
+  test<3> ();
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/hp/fe_collection_03/cmp/generic b/tests/hp/fe_collection_03/cmp/generic
new file mode 100644 (file)
index 0000000..5f42bb2
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
+DEAL::OK

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.