]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a test that currently fails so that I can look at it at home.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 24 Feb 2011 02:38:22 +0000 (02:38 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 24 Feb 2011 02:38:22 +0000 (02:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@23443 0785d39b-7218-0410-832d-ea1e28bc413d

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

diff --git a/tests/hp/fe_nothing_12.cc b/tests/hp/fe_nothing_12.cc
new file mode 100644 (file)
index 0000000..db420b4
--- /dev/null
@@ -0,0 +1,126 @@
+//----------------------------  fe_nothing_12.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_12.cc  ---------------------------
+
+
+// check the case where the two children on a face with a hanging node
+// have different FENothing structure:
+
+// active_fe_index
+// *-----*--*--*
+// |     | 1| 1|
+// |  0  *--*--*
+// |     | 0| 0|
+// *-----*--*--*
+
+
+#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 <fe/fe_system.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;
+  std::vector<unsigned int> sub(dim, 1);
+  sub[dim-1] = 2;
+
+  GridGenerator::subdivided_hyper_rectangle (triangulation, sub, Point<dim>(), Point<dim>());
+  triangulation.begin_active()->set_refine_flag();
+  triangulation.execute_coarsening_and_refinement();
+
+  hp::FECollection<dim>    fe_collection;
+  fe_collection.push_back (FESystem<dim>(FE_Q<dim>(1), 1,
+                                        FE_Nothing<dim>(), 1));
+  fe_collection.push_back (FESystem<dim>(FE_Nothing<dim>(), 1,
+                                        FE_Q<dim>(1), 1));
+
+  hp::DoFHandler<dim>      dof_handler (triangulation);
+
+  dof_handler.begin_active()->set_active_fe_index(1);
+  typename hp::DoFHandler<dim>::active_cell_iterator
+    cell = dof_handler.begin_active(1),
+    endc = dof_handler.end();
+  for (; cell!=endc; ++cell)
+    if (cell->index() % 2 == 0)
+      cell->set_active_fe_index (0);
+    else
+      cell->set_active_fe_index (1);
+
+  dof_handler.distribute_dofs (fe_collection);
+
+  ConstraintMatrix constraints;
+
+  DoFTools::make_hanging_node_constraints (dof_handler, constraints);
+
+  constraints.close();
+
+  deallog << "   Number of constraints:        "
+          << constraints.n_constraints()
+          << std::endl;
+  {
+    typename hp::DoFHandler<dim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
+
+    for(; cell != endc; cell++)
+      {
+       deallog << cell << ' ' << cell->active_fe_index() << std::endl
+               << "   ";
+       std::vector<unsigned int> local_dof_indices (cell->get_fe().dofs_per_cell);
+       cell->get_dof_indices (local_dof_indices);
+
+       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+         deallog << local_dof_indices[i]
+                 << (constraints.is_constrained(local_dof_indices[i]) ?
+                     "*" : "")
+                 << ' ';
+       deallog << std::endl;
+      }
+  }
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("fe_nothing_12/output");
+  logfile.precision(2);
+
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<2> ();
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/hp/fe_nothing_12/cmp/generic b/tests/hp/fe_nothing_12/cmp/generic
new file mode 100644 (file)
index 0000000..a048c60
--- /dev/null
@@ -0,0 +1,95 @@
+
+DEAL::8 dofs
+DEAL::0 0
+DEAL::1 0
+DEAL::24 dofs
+DEAL::0 0
+DEAL::1 0
+DEAL::2 0
+DEAL::3 0
+DEAL::4 0
+DEAL::5 0
+DEAL::8 0
+DEAL::9 0
+DEAL::10 0
+DEAL::11 0
+DEAL::14 0
+DEAL::15 0
+DEAL::16 0
+DEAL::17 0
+DEAL::18 0
+DEAL::19 0
+DEAL::20 0
+DEAL::21 0
+DEAL::22 0
+DEAL::23 0
+DEAL::72 dofs
+DEAL::0 0
+DEAL::1 0
+DEAL::2 0
+DEAL::3 0
+DEAL::4 0
+DEAL::5 0
+DEAL::6 0
+DEAL::7 0
+DEAL::8 0
+DEAL::9 0
+DEAL::10 0
+DEAL::11 0
+DEAL::12 0
+DEAL::13 0
+DEAL::16 0
+DEAL::17 0
+DEAL::18 0
+DEAL::19 0
+DEAL::20 0
+DEAL::21 0
+DEAL::22 0
+DEAL::23 0
+DEAL::24 0
+DEAL::25 0
+DEAL::26 0
+DEAL::27 0
+DEAL::30 0
+DEAL::31 0
+DEAL::32 0
+DEAL::33 0
+DEAL::34 0
+DEAL::35 0
+DEAL::36 0
+DEAL::37 0
+DEAL::38 0
+DEAL::39 0
+DEAL::40 0
+DEAL::41 0
+DEAL::42 0
+DEAL::43 0
+DEAL::44 0
+DEAL::45 0
+DEAL::46 0
+DEAL::47 0
+DEAL::48 0
+DEAL::49 0
+DEAL::50 0
+DEAL::51 0
+DEAL::52 0
+DEAL::53 0
+DEAL::54 0
+DEAL::55 0
+DEAL::56 0
+DEAL::57 0
+DEAL::58 0
+DEAL::59 0
+DEAL::60 0
+DEAL::61 0
+DEAL::62 0
+DEAL::63 0
+DEAL::64 0
+DEAL::65 0
+DEAL::66 0
+DEAL::67 0
+DEAL::68 0
+DEAL::69 0
+DEAL::70 0
+DEAL::71 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.