From 8ba1f720381925aa919cd5b350ceccb1e8f58b1b Mon Sep 17 00:00:00 2001 From: Winnifried Wollner Date: Thu, 31 Oct 2019 17:59:03 +0100 Subject: [PATCH] Added tests for fix for wrong degree calculation in project_curl_conforming_l2 for FE Systems with FE_Nedelec of different degree --- tests/numerics/project_bv_curl_conf_03.cc | 70 +++++++++++++++++++ tests/numerics/project_bv_curl_conf_03.output | 3 + 2 files changed, 73 insertions(+) create mode 100755 tests/numerics/project_bv_curl_conf_03.cc create mode 100644 tests/numerics/project_bv_curl_conf_03.output diff --git a/tests/numerics/project_bv_curl_conf_03.cc b/tests/numerics/project_bv_curl_conf_03.cc new file mode 100755 index 0000000000..9f7b496801 --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_03.cc @@ -0,0 +1,70 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2014 - 2019 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. +// +// --------------------------------------------------------------------- +// The test checks that project_boundary_values_curl_conforming +// works for FESystems with FE_Nedelec of different order. + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../tests.h" + +using namespace dealii; + +int main(int argc, char **argv) { + initlog(); + const unsigned int dim=3; + + Triangulation triangulation; + GridGenerator::hyper_cube(triangulation, 0, 1, true); + MappingQ mapping(1); + ConstraintMatrix constraints; + + //Testing cases with only Nedelec Elements in FE_System + { + deallog << "Equal order Nedelec degree 0 \t"; + //Equal-order elements + FESystem fe_system(FE_Nedelec(0), 1, FE_Nedelec(0), 1); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe_system); + + constraints.clear(); + VectorTools::project_boundary_values_curl_conforming_l2(dof_handler, dim, + Functions::ZeroFunction(dim + dim), 0, constraints, mapping); + constraints.close(); + deallog << "OK" << std::endl; + } + + { + deallog << "Mixed order Nedelec (degree 1,degree 0) \t"; + //Elements of mixed order + FESystem fe_system(FE_Nedelec(1), 1, FE_Nedelec(0), 1); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe_system); + + constraints.clear(); + VectorTools::project_boundary_values_curl_conforming_l2(dof_handler, dim, + Functions::ZeroFunction(dim + dim), 0, constraints, mapping); + constraints.close(); + deallog << "OK" << std::endl; + } + + return 0; +} diff --git a/tests/numerics/project_bv_curl_conf_03.output b/tests/numerics/project_bv_curl_conf_03.output new file mode 100644 index 0000000000..f544d24c5b --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_03.output @@ -0,0 +1,3 @@ + +DEAL::Equal order Nedelec degree 0 OK +DEAL::Mixed order Nedelec (degree 1,degree 0) OK -- 2.39.5