From 073191fa0b23b562802278438692b5c3bb564fe9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 2 Jul 2021 17:26:07 -0600 Subject: [PATCH] Add a test. --- tests/hp/vertex_dof_index.cc | 65 ++++++++++++++++++++++++++++++++ tests/hp/vertex_dof_index.output | 4 ++ 2 files changed, 69 insertions(+) create mode 100644 tests/hp/vertex_dof_index.cc create mode 100644 tests/hp/vertex_dof_index.output diff --git a/tests/hp/vertex_dof_index.cc b/tests/hp/vertex_dof_index.cc new file mode 100644 index 0000000000..381c61e0a0 --- /dev/null +++ b/tests/hp/vertex_dof_index.cc @@ -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 +#include + +#include + +#include +#include +#include + +#include "../tests.h" + + + +template +void +test() +{ + // create 2 triangulations with the + // same coarse grid, and refine + // them differently + Triangulation tria; + + GridGenerator::hyper_cube(tria); + tria.refine_global(2); + + hp::FECollection fe; + fe.push_back(FE_Q(1)); + fe.push_back(FE_Q(2)); + DoFHandler 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 index 0000000000..70626d7e3f --- /dev/null +++ b/tests/hp/vertex_dof_index.output @@ -0,0 +1,4 @@ + +DEAL::0 +DEAL::0 +DEAL::0 -- 2.39.5