From: Wolfgang Bangerth Date: Fri, 2 Jul 2021 23:26:07 +0000 (-0600) Subject: Add a test. X-Git-Tag: v9.4.0-rc1~1162^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=073191fa0b23b562802278438692b5c3bb564fe9;p=dealii.git Add a test. --- 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