]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a test.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 2 Jul 2021 23:26:07 +0000 (17:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 2 Jul 2021 23:28:18 +0000 (17:28 -0600)
tests/hp/vertex_dof_index.cc [new file with mode: 0644]
tests/hp/vertex_dof_index.output [new file with mode: 0644]

diff --git a/tests/hp/vertex_dof_index.cc b/tests/hp/vertex_dof_index.cc
new file mode 100644 (file)
index 0000000..381c61e
--- /dev/null
@@ -0,0 +1,65 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2021 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// check cell->vertex_dof_index() in the hp case when called on a cell
+// where the active_fe_index should be clear.
+
+
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_q.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/tria.h>
+
+#include "../tests.h"
+
+
+
+template <int dim>
+void
+test()
+{
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
+  Triangulation<dim> tria;
+
+  GridGenerator::hyper_cube(tria);
+  tria.refine_global(2);
+
+  hp::FECollection<dim> fe;
+  fe.push_back(FE_Q<dim>(1));
+  fe.push_back(FE_Q<dim>(2));
+  DoFHandler<dim> dh(tria);
+  dh.begin_active()->set_active_fe_index(1);
+  dh.distribute_dofs(fe);
+
+  deallog << dh.begin_active()->vertex_dof_index(0, 0) << std::endl;
+}
+
+
+int
+main()
+{
+  initlog();
+
+  test<1>();
+  test<2>();
+  test<3>();
+}
diff --git a/tests/hp/vertex_dof_index.output b/tests/hp/vertex_dof_index.output
new file mode 100644 (file)
index 0000000..70626d7
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::0
+DEAL::0
+DEAL::0

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.