From: Timo Heister Date: Sat, 8 Mar 2025 00:52:10 +0000 (-0500) Subject: improve Q_iso_Q1 test X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18207%2Fhead;p=dealii.git improve Q_iso_Q1 test ... and actually test the new local sparsity introduced in #18198 with custom support points --- diff --git a/tests/fe/local_sparsity_01.cc b/tests/fe/local_sparsity_01.cc index 7e9396baf0..7025cf011c 100644 --- a/tests/fe/local_sparsity_01.cc +++ b/tests/fe/local_sparsity_01.cc @@ -33,7 +33,7 @@ template void -test(const FiniteElement &fe, const unsigned int n_subdivisions = 1) +test(const FiniteElement &fe) { const auto &pattern = fe.get_local_dof_sparsity_pattern(); deallog << fe.get_name() << ":\n"; @@ -56,12 +56,24 @@ main() initlog(); // The simplest case is a single iso Q1: - test<1>(FE_Q_iso_Q1<1>(2), 1); + test<1>(FE_Q_iso_Q1<1>(2)); + test<1>(FE_Q_iso_Q1<1>(3)); + + // It also works with custom support points: + std::vector> points = {Point<1>(0.0), Point<1>(0.1), Point<1>(1.0)}; + test<1>(FE_Q_iso_Q1<1>(points)); + + std::vector> points2 = {Point<1>(0.0), + Point<1>(0.1), + Point<1>(0.2), + Point<1>(1.0)}; + test<1>(FE_Q_iso_Q1<1>(points2)); + // The 2 iso Q1 elements couple using their pattern: - test<1>(FESystem<1, 1>(FE_DGQ<1>(1), 1, FE_Q_iso_Q1<1>(2), 2), 1); + test<1>(FESystem<1, 1>(FE_DGQ<1>(1), 1, FE_Q_iso_Q1<1>(2), 2)); // The coupling between the first two to the third copy is a full coupling // currently, because we don't detect this yet: - test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 2, FE_Q_iso_Q1<1>(2), 1), 1); + test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 2, FE_Q_iso_Q1<1>(2), 1)); // Different iso_Q1 degrees always couple fully (off diagonal blocks): - test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 1, FE_Q_iso_Q1<1>(3), 1), 1); + test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 1, FE_Q_iso_Q1<1>(3), 1)); } diff --git a/tests/fe/local_sparsity_01.output b/tests/fe/local_sparsity_01.output index b5a8236e7c..50a592b3f7 100644 --- a/tests/fe/local_sparsity_01.output +++ b/tests/fe/local_sparsity_01.output @@ -4,6 +4,23 @@ X.X .XX XXX +DEAL::FE_Q_iso_Q1<1>(3): +X.X. +.X.X +X.XX +.XXX + +DEAL::FE_Q_iso_Q1<1>(2): +X.X +.XX +XXX + +DEAL::FE_Q_iso_Q1<1>(3): +X.X. +.X.X +X.XX +.XXX + DEAL::FESystem<1>[FE_DGQ<1>(1)-FE_Q_iso_Q1<1>(2)^2]: XX..XXXX XX..XXXX