Skip to content

Commit 8657017

Browse files
committed
improve Q_iso_Q1 test
... and actually test the new local sparsity introduced in dealii#18198 with custom support points
1 parent f808a1a commit 8657017

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

tests/fe/local_sparsity_01.cc

+17-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
template <int dim>
3535
void
36-
test(const FiniteElement<dim> &fe, const unsigned int n_subdivisions = 1)
36+
test(const FiniteElement<dim> &fe)
3737
{
3838
const auto &pattern = fe.get_local_dof_sparsity_pattern();
3939
deallog << fe.get_name() << ":\n";
@@ -56,12 +56,24 @@ main()
5656
initlog();
5757

5858
// The simplest case is a single iso Q1:
59-
test<1>(FE_Q_iso_Q1<1>(2), 1);
59+
test<1>(FE_Q_iso_Q1<1>(2));
60+
test<1>(FE_Q_iso_Q1<1>(3));
61+
62+
// It also works with custom support points:
63+
std::vector<Point<1>> points = {Point<1>(0.0), Point<1>(0.1), Point<1>(1.0)};
64+
test<1>(FE_Q_iso_Q1<1>(points));
65+
66+
std::vector<Point<1>> points2 = {Point<1>(0.0),
67+
Point<1>(0.1),
68+
Point<1>(0.2),
69+
Point<1>(1.0)};
70+
test<1>(FE_Q_iso_Q1<1>(points2));
71+
6072
// The 2 iso Q1 elements couple using their pattern:
61-
test<1>(FESystem<1, 1>(FE_DGQ<1>(1), 1, FE_Q_iso_Q1<1>(2), 2), 1);
73+
test<1>(FESystem<1, 1>(FE_DGQ<1>(1), 1, FE_Q_iso_Q1<1>(2), 2));
6274
// The coupling between the first two to the third copy is a full coupling
6375
// currently, because we don't detect this yet:
64-
test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 2, FE_Q_iso_Q1<1>(2), 1), 1);
76+
test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 2, FE_Q_iso_Q1<1>(2), 1));
6577
// Different iso_Q1 degrees always couple fully (off diagonal blocks):
66-
test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 1, FE_Q_iso_Q1<1>(3), 1), 1);
78+
test<1>(FESystem<1, 1>(FE_Q_iso_Q1<1>(2), 1, FE_Q_iso_Q1<1>(3), 1));
6779
}

tests/fe/local_sparsity_01.output

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ X.X
44
.XX
55
XXX
66

7+
DEAL::FE_Q_iso_Q1<1>(3):
8+
X.X.
9+
.X.X
10+
X.XX
11+
.XXX
12+
13+
DEAL::FE_Q_iso_Q1<1>(2):
14+
X.X
15+
.XX
16+
XXX
17+
18+
DEAL::FE_Q_iso_Q1<1>(3):
19+
X.X.
20+
.X.X
21+
X.XX
22+
.XXX
23+
724
DEAL::FESystem<1>[FE_DGQ<1>(1)-FE_Q_iso_Q1<1>(2)^2]:
825
XX..XXXX
926
XX..XXXX

0 commit comments

Comments
 (0)