From a28e7ad4eab65bf229a66d76746c68f1b58d673d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 14 Sep 2017 16:04:59 -0600 Subject: [PATCH] Add a test. --- tests/fe/system_04.cc | 67 +++++++++++++++++++++++++++++++++++++++ tests/fe/system_04.output | 21 ++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 tests/fe/system_04.cc create mode 100644 tests/fe/system_04.output diff --git a/tests/fe/system_04.cc b/tests/fe/system_04.cc new file mode 100644 index 0000000000..35e508c7c4 --- /dev/null +++ b/tests/fe/system_04.cc @@ -0,0 +1,67 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2003 - 2015 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// like the _03 test, but use the variadic constructor with the +// promotion rule that converts individual elements into pairs of the +// element and multiplicity one + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + +template +void +check(FESystem &fe) +{ + deallog << fe.get_name() << std::endl; + deallog << "components: " << fe.n_components() << std::endl; + deallog << "blocks: " << fe.n_blocks() << std::endl; + deallog << "conforms H1: " << fe.conforms(FiniteElementData::H1) << std::endl; + deallog << "n_base_elements: " << fe.n_base_elements() << std::endl; +} + +int +main() +{ + initlog(); + + { + FESystem<2> fe (FE_Q<2>(1)^2, FE_Q<2>(1)); + check<2>(fe); + } + { + FESystem<2> fe (FE_Q<2>(1)^2, FE_DGQ<2>(2)^0, FE_Q<2>(1)); + check<2>(fe); + } + { + FESystem<2> fe (FESystem<2>(FE_Q<2>(1)^2), FE_Q<2>(1)); + check<2>(fe); + } + { + FESystem<2> fe (FESystem<2>(FE_Q<2>(1)^2)^1, FE_DGQ<2>(2)^0, FE_Q<2>(1)); + check<2>(fe); + } + + return 0; +} + + + diff --git a/tests/fe/system_04.output b/tests/fe/system_04.output new file mode 100644 index 0000000000..bad0cea6dd --- /dev/null +++ b/tests/fe/system_04.output @@ -0,0 +1,21 @@ + +DEAL::FESystem<2>[FE_Q<2>(1)^2-FE_Q<2>(1)] +DEAL::components: 3 +DEAL::blocks: 3 +DEAL::conforms H1: 1 +DEAL::n_base_elements: 2 +DEAL::FESystem<2>[FE_Q<2>(1)^2-FE_Q<2>(1)] +DEAL::components: 3 +DEAL::blocks: 3 +DEAL::conforms H1: 1 +DEAL::n_base_elements: 2 +DEAL::FESystem<2>[FESystem<2>[FE_Q<2>(1)^2]-FE_Q<2>(1)] +DEAL::components: 3 +DEAL::blocks: 2 +DEAL::conforms H1: 1 +DEAL::n_base_elements: 2 +DEAL::FESystem<2>[FESystem<2>[FE_Q<2>(1)^2]-FE_Q<2>(1)] +DEAL::components: 3 +DEAL::blocks: 2 +DEAL::conforms H1: 1 +DEAL::n_base_elements: 2 -- 2.39.5