]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve Q_iso_Q1 test 18207/head
authorTimo Heister <timo.heister@gmail.com>
Sat, 8 Mar 2025 00:52:10 +0000 (19:52 -0500)
committerTimo Heister <timo.heister@gmail.com>
Sat, 8 Mar 2025 17:22:40 +0000 (12:22 -0500)
... and actually test the new local sparsity introduced in #18198 with custom support points

tests/fe/local_sparsity_01.cc
tests/fe/local_sparsity_01.output

index 7e9396baf009f7a006a399454e9fdb9509f93e30..7025cf011cb84e068a1ab9e0b110db200500a589 100644 (file)
@@ -33,7 +33,7 @@
 
 template <int dim>
 void
-test(const FiniteElement<dim> &fe, const unsigned int n_subdivisions = 1)
+test(const FiniteElement<dim> &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<Point<1>> points = {Point<1>(0.0), Point<1>(0.1), Point<1>(1.0)};
+  test<1>(FE_Q_iso_Q1<1>(points));
+
+  std::vector<Point<1>> 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));
 }
index b5a8236e7ca6ee6ad0d00f45859d0ad5746d719a..50a592b3f739949b86e4962611428967eb9f7dea 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.