]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 18 Feb 2011 17:32:15 +0000 (17:32 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 18 Feb 2011 17:32:15 +0000 (17:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@23396 0785d39b-7218-0410-832d-ea1e28bc413d

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

diff --git a/tests/hp/fe_nothing_08.cc b/tests/hp/fe_nothing_08.cc
new file mode 100644 (file)
index 0000000..12d87dd
--- /dev/null
@@ -0,0 +1,94 @@
+//----------------------------  fe_nothing_08.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2009, 2011 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_nothing_08.cc  ---------------------------
+
+
+// test that FE_Nothing can be called with interpolate_boundary_values
+// with scalar elements
+
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <base/function.h>
+#include <fe/fe_nothing.h>
+#include <fe/fe_q.h>
+#include <hp/fe_collection.h>
+#include <hp/dof_handler.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_refinement.h>
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_tools.h>
+#include <fe/fe_q.h>
+#include <hp/dof_handler.h>
+#include <hp/fe_values.h>
+#include <numerics/vectors.h>
+
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  Triangulation<dim>       triangulation;
+  GridGenerator :: hyper_cube (triangulation, -1, 1);
+  triangulation.refine_global(1);
+
+  hp::FECollection<dim>    fe_collection;
+  fe_collection.push_back (FE_Q<dim>(1));
+  fe_collection.push_back (FE_Nothing<dim>());
+
+  hp::DoFHandler<dim>      dof_handler (triangulation);
+
+  typename hp::DoFHandler<dim>::active_cell_iterator
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
+
+  for(; cell != endc; cell++)
+    if (cell->center()[0] > 0)
+      cell->set_active_fe_index(1);
+    else
+      cell->set_active_fe_index(0);
+
+  dof_handler.distribute_dofs (fe_collection);
+  deallog << dof_handler.n_dofs() << " dofs" << std::endl;
+
+  std::map<unsigned int, double> bv;
+  VectorTools::interpolate_boundary_values (dof_handler,
+                                           0,
+                                           ZeroFunction<dim>(1),
+                                           bv);
+  for (std::map<unsigned int, double>::iterator
+        p = bv.begin(); p!=bv.end(); ++p)
+    deallog << p->first << ' ' << p->second << std::endl;
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("fe_nothing_08/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_nothing_08/cmp/generic b/tests/hp/fe_nothing_08/cmp/generic
new file mode 100644 (file)
index 0000000..f8e9b07
--- /dev/null
@@ -0,0 +1,28 @@
+
+DEAL::2 dofs
+DEAL::0 0
+DEAL::6 dofs
+DEAL::0 0
+DEAL::1 0
+DEAL::2 0
+DEAL::4 0
+DEAL::5 0
+DEAL::18 dofs
+DEAL::0 0
+DEAL::1 0
+DEAL::2 0
+DEAL::3 0
+DEAL::4 0
+DEAL::5 0
+DEAL::6 0
+DEAL::8 0
+DEAL::9 0
+DEAL::10 0
+DEAL::11 0
+DEAL::12 0
+DEAL::13 0
+DEAL::14 0
+DEAL::15 0
+DEAL::16 0
+DEAL::17 0
+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.