From: Marc Fehling Date: Wed, 13 Jan 2021 18:01:15 +0000 (-0700) Subject: simplex: hanging node tests X-Git-Tag: v9.3.0-rc1~612^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11548%2Fhead;p=dealii.git simplex: hanging node tests --- diff --git a/tests/simplex/hanging_nodes_01.cc b/tests/simplex/hanging_nodes_01.cc new file mode 100644 index 0000000000..753ecdf45e --- /dev/null +++ b/tests/simplex/hanging_nodes_01.cc @@ -0,0 +1,71 @@ +// --------------------------------------------------------------------- +// +// 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. +// +// --------------------------------------------------------------------- + + + +// verify hanging node constraints on locally h-refined simplex mesh + +#include +#include + +#include +#include + +#include + +#include +#include + +#include "../tests.h" + + +template +void +test() +{ + // setup grid + Triangulation tria; + GridGenerator::subdivided_hyper_cube_with_simplices(tria, 1); + + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement(); + +#if false + GridOut grid_out; + grid_out.write_vtk(tria, deallog.get_file_stream()); +#endif + + DoFHandler dofh(tria); + dofh.distribute_dofs(Simplex::FE_P(1)); + deallog << "ndofs: " << dofh.n_dofs() << std::endl; + + // hanging node constraints + AffineConstraints constraints; + // DoFTools::make_hanging_node_constraints(dofh, constraints); + constraints.print(deallog.get_file_stream()); + + deallog << "OK" << std::endl; +} + + +int +main() +{ + initlog(); + + deallog.push("2d"); + test<2>(); + deallog.pop(); +} diff --git a/tests/simplex/hanging_nodes_01.with_simplex_support=on.output b/tests/simplex/hanging_nodes_01.with_simplex_support=on.output new file mode 100644 index 0000000000..1f03256372 --- /dev/null +++ b/tests/simplex/hanging_nodes_01.with_simplex_support=on.output @@ -0,0 +1,3 @@ + +DEAL:2d::ndofs: 7 +DEAL:2d::OK diff --git a/tests/simplex/hanging_nodes_02.cc b/tests/simplex/hanging_nodes_02.cc new file mode 100644 index 0000000000..d3816830b1 --- /dev/null +++ b/tests/simplex/hanging_nodes_02.cc @@ -0,0 +1,67 @@ +// --------------------------------------------------------------------- +// +// 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. +// +// --------------------------------------------------------------------- + + + +// verify hanging node constraints on locally p-refined simplex mesh + +#include +#include + +#include + +#include + +#include + +#include +#include + +#include "../tests.h" + + +template +void +test(const hp::FECollection &fes) +{ + // setup grid + Triangulation tria; + GridGenerator::subdivided_hyper_cube_with_simplices(tria, 1); + + DoFHandler dofh(tria); + dofh.begin_active()->set_active_fe_index(1); + + dofh.distribute_dofs(fes); + deallog << "ndofs: " << dofh.n_dofs() << std::endl; + + // hanging node constraints + AffineConstraints constraints; + // DoFTools::make_hanging_node_constraints(dofh, constraints); + constraints.print(deallog.get_file_stream()); + + deallog << "OK" << std::endl; +} + + +int +main() +{ + initlog(); + + deallog.push("2d"); + test<2>(hp::FECollection<2>(Simplex::FE_P<2>(1), Simplex::FE_P<2>(2))); + test<2>(hp::FECollection<2>(Simplex::FE_P<2>(2), Simplex::FE_P<2>(1))); + deallog.pop(); +} diff --git a/tests/simplex/hanging_nodes_02.with_simplex_support=on.output b/tests/simplex/hanging_nodes_02.with_simplex_support=on.output new file mode 100644 index 0000000000..b905ef0c4e --- /dev/null +++ b/tests/simplex/hanging_nodes_02.with_simplex_support=on.output @@ -0,0 +1,5 @@ + +DEAL:2d::ndofs: 7 +DEAL:2d::OK +DEAL:2d::ndofs: 7 +DEAL:2d::OK