From: Matthias Maier Date: Thu, 31 Aug 2017 16:40:30 +0000 (-0500) Subject: add a test X-Git-Tag: v9.0.0-rc1~1140^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4993%2Fhead;p=dealii.git add a test --- diff --git a/tests/fe/fe_system_generalized_support_points.cc b/tests/fe/fe_system_generalized_support_points.cc new file mode 100644 index 0000000000..447bdd6d03 --- /dev/null +++ b/tests/fe/fe_system_generalized_support_points.cc @@ -0,0 +1,64 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 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. +// +// --------------------------------------------------------------------- + +// Check that FiniteElement::get_generalized_support_points() returns a +// vector of unique generalized support points. + +#include "../tests.h" + +#include +#include +#include +#include + +#include + +using namespace dealii; + +template +void test() +{ + const auto print = [](const FiniteElement &fe) + { + deallog << fe.get_name() << std::endl; + for (auto it : fe.get_generalized_support_points()) + { + deallog << "(" << it[0] << "," << it[1] << ") "; + } + deallog << std::endl; + }; + + deallog << "dim " << dim << " lowest order" << std::endl; + print(FE_Q(1)); + print(FE_RaviartThomas(0)); + print(FE_Nedelec(0)); + print(FESystem(FE_RaviartThomas(0), 3, FE_Nedelec(0), 3)); + print(FESystem(FESystem(FE_RaviartThomas(0), 3, FE_Nedelec(0), 3), 2, FE_Q(1), 3, FE_Q(1), 3)); + + deallog << "dim " << dim << " higher order" << std::endl; + print(FE_Q(2)); + print(FE_RaviartThomas(1)); + print(FE_Nedelec(1)); + print(FESystem(FE_RaviartThomas(1), 3, FE_Nedelec(1), 3)); + print(FESystem(FESystem(FE_RaviartThomas(1), 3, FE_Nedelec(1), 3), 2, FE_Q(2), 3, FE_Q(1), 3)); +} + +int main () +{ + initlog(); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/fe_system_generalized_support_points.output b/tests/fe/fe_system_generalized_support_points.output new file mode 100644 index 0000000000..de5c4d3cf8 --- /dev/null +++ b/tests/fe/fe_system_generalized_support_points.output @@ -0,0 +1,45 @@ + +DEAL::dim 2 lowest order +DEAL::FE_Q<2>(1) +DEAL::(0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::FE_RaviartThomas<2>(0) +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) +DEAL::FE_Nedelec<2>(0) +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) +DEAL::FESystem<2>[FE_RaviartThomas<2>(0)^3-FE_Nedelec<2>(0)^3] +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) +DEAL::FESystem<2>[FESystem<2>[FE_RaviartThomas<2>(0)^3-FE_Nedelec<2>(0)^3]^2-FE_Q<2>(1)^3-FE_Q<2>(1)^3] +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::dim 2 higher order +DEAL::FE_Q<2>(2) +DEAL::(0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) +DEAL::FE_RaviartThomas<2>(1) +DEAL::(0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) +DEAL::FE_Nedelec<2>(1) +DEAL::(0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) +DEAL::FESystem<2>[FE_RaviartThomas<2>(1)^3-FE_Nedelec<2>(1)^3] +DEAL::(0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) +DEAL::FESystem<2>[FESystem<2>[FE_RaviartThomas<2>(1)^3-FE_Nedelec<2>(1)^3]^2-FE_Q<2>(2)^3-FE_Q<2>(1)^3] +DEAL::(0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) +DEAL::dim 3 lowest order +DEAL::FE_Q<3>(1) +DEAL::(0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::FE_RaviartThomas<3>(0) +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) (0.500000,0.500000) +DEAL::FE_Nedelec<3>(0) +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::FESystem<3>[FE_RaviartThomas<3>(0)^3-FE_Nedelec<3>(0)^3] +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) (0.500000,0.500000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::FESystem<3>[FESystem<3>[FE_RaviartThomas<3>(0)^3-FE_Nedelec<3>(0)^3]^2-FE_Q<3>(1)^3-FE_Q<3>(1)^3] +DEAL::(0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) (0.500000,0.500000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) +DEAL::dim 3 higher order +DEAL::FE_Q<3>(2) +DEAL::(0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) (0.500000,0.500000) (0.500000,0.500000) +DEAL::FE_RaviartThomas<3>(1) +DEAL::(0.00000,0.211325) (0.00000,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.211325,0.00000) (0.788675,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.211325,1.00000) (0.788675,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) +DEAL::FE_Nedelec<3>(1) +DEAL::(0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.00000) (0.00000,0.00000) (1.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (0.00000,1.00000) (1.00000,1.00000) (1.00000,1.00000) (0.00000,0.211325) (0.00000,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.211325,0.00000) (0.788675,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.211325,1.00000) (0.788675,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) +DEAL::FESystem<3>[FE_RaviartThomas<3>(1)^3-FE_Nedelec<3>(1)^3] +DEAL::(0.00000,0.211325) (0.00000,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.211325,0.00000) (0.788675,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.211325,1.00000) (0.788675,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.00000) (0.00000,0.00000) (1.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (0.00000,1.00000) (1.00000,1.00000) (1.00000,1.00000) +DEAL::FESystem<3>[FESystem<3>[FE_RaviartThomas<3>(1)^3-FE_Nedelec<3>(1)^3]^2-FE_Q<3>(2)^3-FE_Q<3>(1)^3] +DEAL::(0.00000,0.211325) (0.00000,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.211325,0.00000) (0.788675,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.211325,1.00000) (0.788675,1.00000) (0.788675,1.00000) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.211325,0.211325) (0.788675,0.211325) (0.211325,0.788675) (0.788675,0.788675) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.211325) (0.00000,0.788675) (1.00000,0.211325) (1.00000,0.788675) (0.211325,0.00000) (0.788675,0.00000) (0.211325,1.00000) (0.788675,1.00000) (0.00000,0.00000) (0.00000,0.00000) (1.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (0.00000,1.00000) (1.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.00000,0.00000) (1.00000,0.00000) (0.00000,1.00000) (1.00000,1.00000) (0.00000,0.500000) (1.00000,0.500000) (0.500000,0.00000) (0.500000,1.00000) (0.500000,0.500000) (0.500000,0.500000) (0.500000,0.500000)