From 61b88ce2712f86bda6dc2129c5915b585d9dbb42 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 20 Aug 2021 13:18:43 -0600 Subject: [PATCH] Add a number of tests. --- .../hp_line_dof_identities_mixed_multiway.cc | 76 ++++++++++++++++++ ..._line_dof_identities_mixed_multiway.output | 14 ++++ tests/hp/hp_line_dof_identities_q_multiway.cc | 72 +++++++++++++++++ .../hp_line_dof_identities_q_multiway.output | 16 ++++ ...p_line_dof_identities_q_system_multiway.cc | 74 +++++++++++++++++ ...ne_dof_identities_q_system_multiway.output | 26 ++++++ .../hp_quad_dof_identities_mixed_multiway.cc | 77 ++++++++++++++++++ ..._quad_dof_identities_mixed_multiway.output | 9 +++ tests/hp/hp_quad_dof_identities_q_multiway.cc | 71 +++++++++++++++++ .../hp_quad_dof_identities_q_multiway.output | 9 +++ ...p_quad_dof_identities_q_system_multiway.cc | 73 +++++++++++++++++ ...ad_dof_identities_q_system_multiway.output | 14 ++++ ...hp_vertex_dof_identities_mixed_multiway.cc | 79 +++++++++++++++++++ ...ertex_dof_identities_mixed_multiway.output | 35 ++++++++ .../hp/hp_vertex_dof_identities_q_multiway.cc | 73 +++++++++++++++++ ...hp_vertex_dof_identities_q_multiway.output | 35 ++++++++ ...vertex_dof_identities_q_system_multiway.cc | 75 ++++++++++++++++++ ...ex_dof_identities_q_system_multiway.output | 62 +++++++++++++++ 18 files changed, 890 insertions(+) create mode 100644 tests/hp/hp_line_dof_identities_mixed_multiway.cc create mode 100644 tests/hp/hp_line_dof_identities_mixed_multiway.output create mode 100644 tests/hp/hp_line_dof_identities_q_multiway.cc create mode 100644 tests/hp/hp_line_dof_identities_q_multiway.output create mode 100644 tests/hp/hp_line_dof_identities_q_system_multiway.cc create mode 100644 tests/hp/hp_line_dof_identities_q_system_multiway.output create mode 100644 tests/hp/hp_quad_dof_identities_mixed_multiway.cc create mode 100644 tests/hp/hp_quad_dof_identities_mixed_multiway.output create mode 100644 tests/hp/hp_quad_dof_identities_q_multiway.cc create mode 100644 tests/hp/hp_quad_dof_identities_q_multiway.output create mode 100644 tests/hp/hp_quad_dof_identities_q_system_multiway.cc create mode 100644 tests/hp/hp_quad_dof_identities_q_system_multiway.output create mode 100644 tests/hp/hp_vertex_dof_identities_mixed_multiway.cc create mode 100644 tests/hp/hp_vertex_dof_identities_mixed_multiway.output create mode 100644 tests/hp/hp_vertex_dof_identities_q_multiway.cc create mode 100644 tests/hp/hp_vertex_dof_identities_q_multiway.output create mode 100644 tests/hp/hp_vertex_dof_identities_q_system_multiway.cc create mode 100644 tests/hp/hp_vertex_dof_identities_q_system_multiway.output diff --git a/tests/hp/hp_line_dof_identities_mixed_multiway.cc b/tests/hp/hp_line_dof_identities_mixed_multiway.cc new file mode 100644 index 0000000000..ad54b4c407 --- /dev/null +++ b/tests/hp/hp_line_dof_identities_mixed_multiway.cc @@ -0,0 +1,76 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_line_dof_identities with multiway +// identities for a combination of FE_Q element and FE_DGQ +// elements. Only the FE_Q elements have DoFs on vertices so only they +// will participate in the identities. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + { + fe_collection.push_back(FE_Q(i)); + fe_collection.push_back(FE_DGQ(i)); + } + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_line_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": line dof index " << p.second << std::endl; + } + } +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_line_dof_identities_mixed_multiway.output b/tests/hp/hp_line_dof_identities_mixed_multiway.output new file mode 100644 index 0000000000..a9b6b8c538 --- /dev/null +++ b/tests/hp/hp_line_dof_identities_mixed_multiway.output @@ -0,0 +1,14 @@ + +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FE_Q<2>(2): line dof index 0 +DEAL:: FE_Q<2>(4): line dof index 1 +DEAL:: FE_Q<2>(6): line dof index 2 +DEAL:: FE_Q<2>(8): line dof index 3 +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(2): line dof index 0 +DEAL:: FE_Q<3>(4): line dof index 1 +DEAL:: FE_Q<3>(6): line dof index 2 +DEAL:: FE_Q<3>(8): line dof index 3 +DEAL::OK diff --git a/tests/hp/hp_line_dof_identities_q_multiway.cc b/tests/hp/hp_line_dof_identities_q_multiway.cc new file mode 100644 index 0000000000..a798d3b265 --- /dev/null +++ b/tests/hp/hp_line_dof_identities_q_multiway.cc @@ -0,0 +1,72 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_line_dof_identities with multiway +// identities for the FE_Q element + + +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FE_Q(i)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_line_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": line dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_line_dof_identities_q_multiway.output b/tests/hp/hp_line_dof_identities_q_multiway.output new file mode 100644 index 0000000000..56af1c299e --- /dev/null +++ b/tests/hp/hp_line_dof_identities_q_multiway.output @@ -0,0 +1,16 @@ + +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FE_Q<2>(2): line dof index 0 +DEAL:: FE_Q<2>(4): line dof index 1 +DEAL:: FE_Q<2>(6): line dof index 2 +DEAL:: FE_Q<2>(8): line dof index 3 +DEAL:: +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(2): line dof index 0 +DEAL:: FE_Q<3>(4): line dof index 1 +DEAL:: FE_Q<3>(6): line dof index 2 +DEAL:: FE_Q<3>(8): line dof index 3 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_line_dof_identities_q_system_multiway.cc b/tests/hp/hp_line_dof_identities_q_system_multiway.cc new file mode 100644 index 0000000000..e4f2d82492 --- /dev/null +++ b/tests/hp/hp_line_dof_identities_q_system_multiway.cc @@ -0,0 +1,74 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_line_dof_identities with multiway +// identities for a system of FE_Q elements. Each vector component of +// the system will form its own identity set. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FESystem(FE_Q(i), 2)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_line_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": line dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_line_dof_identities_q_system_multiway.output b/tests/hp/hp_line_dof_identities_q_system_multiway.output new file mode 100644 index 0000000000..08a6618f28 --- /dev/null +++ b/tests/hp/hp_line_dof_identities_q_system_multiway.output @@ -0,0 +1,26 @@ + +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FESystem<2>[FE_Q<2>(2)^2]: line dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(4)^2]: line dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(6)^2]: line dof index 2 +DEAL:: FESystem<2>[FE_Q<2>(8)^2]: line dof index 3 +DEAL::Identity set #1 +DEAL:: FESystem<2>[FE_Q<2>(2)^2]: line dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(4)^2]: line dof index 4 +DEAL:: FESystem<2>[FE_Q<2>(6)^2]: line dof index 7 +DEAL:: FESystem<2>[FE_Q<2>(8)^2]: line dof index 10 +DEAL:: +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: line dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: line dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: line dof index 2 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: line dof index 3 +DEAL::Identity set #1 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: line dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: line dof index 4 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: line dof index 7 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: line dof index 10 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_quad_dof_identities_mixed_multiway.cc b/tests/hp/hp_quad_dof_identities_mixed_multiway.cc new file mode 100644 index 0000000000..0625e92367 --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_mixed_multiway.cc @@ -0,0 +1,77 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_quad_dof_identities with multiway +// identities for a combination of FE_Q element and FE_DGQ +// elements. Only the FE_Q elements have DoFs on vertices so only they +// will participate in the identities. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + { + fe_collection.push_back(FE_Q(i)); + fe_collection.push_back(FE_DGQ(i)); + } + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_quad_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": quad dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_quad_dof_identities_mixed_multiway.output b/tests/hp/hp_quad_dof_identities_mixed_multiway.output new file mode 100644 index 0000000000..751d60b76f --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_mixed_multiway.output @@ -0,0 +1,9 @@ + +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(2): quad dof index 0 +DEAL:: FE_Q<3>(4): quad dof index 4 +DEAL:: FE_Q<3>(6): quad dof index 12 +DEAL:: FE_Q<3>(8): quad dof index 24 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_quad_dof_identities_q_multiway.cc b/tests/hp/hp_quad_dof_identities_q_multiway.cc new file mode 100644 index 0000000000..cbe9380d6d --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_q_multiway.cc @@ -0,0 +1,71 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_quad_dof_identities with multiway +// identities for the FE_Q element + + +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FE_Q(i)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_quad_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": quad dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_quad_dof_identities_q_multiway.output b/tests/hp/hp_quad_dof_identities_q_multiway.output new file mode 100644 index 0000000000..751d60b76f --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_q_multiway.output @@ -0,0 +1,9 @@ + +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(2): quad dof index 0 +DEAL:: FE_Q<3>(4): quad dof index 4 +DEAL:: FE_Q<3>(6): quad dof index 12 +DEAL:: FE_Q<3>(8): quad dof index 24 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_quad_dof_identities_q_system_multiway.cc b/tests/hp/hp_quad_dof_identities_q_system_multiway.cc new file mode 100644 index 0000000000..1ae3ff2a1b --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_q_system_multiway.cc @@ -0,0 +1,73 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_quad_dof_identities with multiway +// identities for a system of FE_Q elements. Each vector component of +// the system will form its own identity set. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FESystem(FE_Q(i), 2)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_quad_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": quad dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_quad_dof_identities_q_system_multiway.output b/tests/hp/hp_quad_dof_identities_q_system_multiway.output new file mode 100644 index 0000000000..55e9527ef8 --- /dev/null +++ b/tests/hp/hp_quad_dof_identities_q_system_multiway.output @@ -0,0 +1,14 @@ + +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: quad dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: quad dof index 4 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: quad dof index 12 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: quad dof index 24 +DEAL::Identity set #1 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: quad dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: quad dof index 13 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: quad dof index 37 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: quad dof index 73 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_vertex_dof_identities_mixed_multiway.cc b/tests/hp/hp_vertex_dof_identities_mixed_multiway.cc new file mode 100644 index 0000000000..54c42fcdb3 --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_mixed_multiway.cc @@ -0,0 +1,79 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_vertex_dof_identities with multiway +// identities for a combination of FE_Q element and FE_DGQ +// elements. Only the FE_Q elements have DoFs on vertices so only they +// will participate in the identities. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + { + fe_collection.push_back(FE_Q(i)); + fe_collection.push_back(FE_DGQ(i)); + } + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_vertex_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": vertex dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<1>(); + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_vertex_dof_identities_mixed_multiway.output b/tests/hp/hp_vertex_dof_identities_mixed_multiway.output new file mode 100644 index 0000000000..4f2ce6ae93 --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_mixed_multiway.output @@ -0,0 +1,35 @@ + +DEAL::dim=1 +DEAL::Identity set #0 +DEAL:: FE_Q<1>(1): vertex dof index 0 +DEAL:: FE_Q<1>(2): vertex dof index 0 +DEAL:: FE_Q<1>(3): vertex dof index 0 +DEAL:: FE_Q<1>(4): vertex dof index 0 +DEAL:: FE_Q<1>(5): vertex dof index 0 +DEAL:: FE_Q<1>(6): vertex dof index 0 +DEAL:: FE_Q<1>(7): vertex dof index 0 +DEAL:: FE_Q<1>(8): vertex dof index 0 +DEAL:: +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FE_Q<2>(1): vertex dof index 0 +DEAL:: FE_Q<2>(2): vertex dof index 0 +DEAL:: FE_Q<2>(3): vertex dof index 0 +DEAL:: FE_Q<2>(4): vertex dof index 0 +DEAL:: FE_Q<2>(5): vertex dof index 0 +DEAL:: FE_Q<2>(6): vertex dof index 0 +DEAL:: FE_Q<2>(7): vertex dof index 0 +DEAL:: FE_Q<2>(8): vertex dof index 0 +DEAL:: +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(1): vertex dof index 0 +DEAL:: FE_Q<3>(2): vertex dof index 0 +DEAL:: FE_Q<3>(3): vertex dof index 0 +DEAL:: FE_Q<3>(4): vertex dof index 0 +DEAL:: FE_Q<3>(5): vertex dof index 0 +DEAL:: FE_Q<3>(6): vertex dof index 0 +DEAL:: FE_Q<3>(7): vertex dof index 0 +DEAL:: FE_Q<3>(8): vertex dof index 0 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_vertex_dof_identities_q_multiway.cc b/tests/hp/hp_vertex_dof_identities_q_multiway.cc new file mode 100644 index 0000000000..ce71968ae8 --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_q_multiway.cc @@ -0,0 +1,73 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_vertex_dof_identities with multiway +// identities for the FE_Q element + + +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FE_Q(i)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_vertex_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": vertex dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<1>(); + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_vertex_dof_identities_q_multiway.output b/tests/hp/hp_vertex_dof_identities_q_multiway.output new file mode 100644 index 0000000000..4f2ce6ae93 --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_q_multiway.output @@ -0,0 +1,35 @@ + +DEAL::dim=1 +DEAL::Identity set #0 +DEAL:: FE_Q<1>(1): vertex dof index 0 +DEAL:: FE_Q<1>(2): vertex dof index 0 +DEAL:: FE_Q<1>(3): vertex dof index 0 +DEAL:: FE_Q<1>(4): vertex dof index 0 +DEAL:: FE_Q<1>(5): vertex dof index 0 +DEAL:: FE_Q<1>(6): vertex dof index 0 +DEAL:: FE_Q<1>(7): vertex dof index 0 +DEAL:: FE_Q<1>(8): vertex dof index 0 +DEAL:: +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FE_Q<2>(1): vertex dof index 0 +DEAL:: FE_Q<2>(2): vertex dof index 0 +DEAL:: FE_Q<2>(3): vertex dof index 0 +DEAL:: FE_Q<2>(4): vertex dof index 0 +DEAL:: FE_Q<2>(5): vertex dof index 0 +DEAL:: FE_Q<2>(6): vertex dof index 0 +DEAL:: FE_Q<2>(7): vertex dof index 0 +DEAL:: FE_Q<2>(8): vertex dof index 0 +DEAL:: +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FE_Q<3>(1): vertex dof index 0 +DEAL:: FE_Q<3>(2): vertex dof index 0 +DEAL:: FE_Q<3>(3): vertex dof index 0 +DEAL:: FE_Q<3>(4): vertex dof index 0 +DEAL:: FE_Q<3>(5): vertex dof index 0 +DEAL:: FE_Q<3>(6): vertex dof index 0 +DEAL:: FE_Q<3>(7): vertex dof index 0 +DEAL:: FE_Q<3>(8): vertex dof index 0 +DEAL:: +DEAL::OK diff --git a/tests/hp/hp_vertex_dof_identities_q_system_multiway.cc b/tests/hp/hp_vertex_dof_identities_q_system_multiway.cc new file mode 100644 index 0000000000..530d5a2179 --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_q_system_multiway.cc @@ -0,0 +1,75 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 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 FE_Collection::hp_vertex_dof_identities with multiway +// identities for a system of FE_Q elements. Each vector component of +// the system will form its own identity set. + + +#include +#include + +#include + +#include "../tests.h" + + + +template +void +test() +{ + deallog << "dim=" << dim << std::endl; + + hp::FECollection fe_collection; + for (unsigned int i = 1; i <= 8; ++i) + fe_collection.push_back(FESystem(FE_Q(i), 2)); + + // construct the complete set of fe indices + std::set fe_indices; + for (unsigned int i = 0; i < fe_collection.size(); ++i) + fe_indices.emplace(i); + + const auto identities = fe_collection.hp_vertex_dof_identities(fe_indices); + + for (unsigned int i = 0; i < identities.size(); ++i) + { + deallog << "Identity set #" << i << std::endl; + for (const auto &p : identities[i]) + { + deallog << " " << fe_collection[p.first].get_name() + << ": vertex dof index " << p.second << std::endl; + } + } + + deallog << std::endl; +} + + + +int +main() +{ + initlog(); + deallog.get_file_stream().precision(2); + + test<1>(); + test<2>(); + test<3>(); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/hp_vertex_dof_identities_q_system_multiway.output b/tests/hp/hp_vertex_dof_identities_q_system_multiway.output new file mode 100644 index 0000000000..f775bff5fa --- /dev/null +++ b/tests/hp/hp_vertex_dof_identities_q_system_multiway.output @@ -0,0 +1,62 @@ + +DEAL::dim=1 +DEAL::Identity set #0 +DEAL:: FESystem<1>[FE_Q<1>(1)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(2)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(3)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(4)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(5)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(6)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(7)^2]: vertex dof index 0 +DEAL:: FESystem<1>[FE_Q<1>(8)^2]: vertex dof index 0 +DEAL::Identity set #1 +DEAL:: FESystem<1>[FE_Q<1>(1)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(2)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(3)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(4)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(5)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(6)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(7)^2]: vertex dof index 1 +DEAL:: FESystem<1>[FE_Q<1>(8)^2]: vertex dof index 1 +DEAL:: +DEAL::dim=2 +DEAL::Identity set #0 +DEAL:: FESystem<2>[FE_Q<2>(1)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(2)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(3)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(4)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(5)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(6)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(7)^2]: vertex dof index 0 +DEAL:: FESystem<2>[FE_Q<2>(8)^2]: vertex dof index 0 +DEAL::Identity set #1 +DEAL:: FESystem<2>[FE_Q<2>(1)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(2)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(3)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(4)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(5)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(6)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(7)^2]: vertex dof index 1 +DEAL:: FESystem<2>[FE_Q<2>(8)^2]: vertex dof index 1 +DEAL:: +DEAL::dim=3 +DEAL::Identity set #0 +DEAL:: FESystem<3>[FE_Q<3>(1)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(3)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(5)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(7)^2]: vertex dof index 0 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: vertex dof index 0 +DEAL::Identity set #1 +DEAL:: FESystem<3>[FE_Q<3>(1)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(2)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(3)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(4)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(5)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(6)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(7)^2]: vertex dof index 1 +DEAL:: FESystem<3>[FE_Q<3>(8)^2]: vertex dof index 1 +DEAL:: +DEAL::OK -- 2.39.5