Hello dealii-team,
I have created a failing test case in serial when hanging nodes+periodic constraints are mixed.
1) Create a hypercube (-20,20) with origin at the center
2) Set periodic boundary conditions on the hypercube
3) Perform two levels of mesh refinement:- a) one step uniform refinement hypercube to get 8 cells ,and b) then pick one of the 8 cells and refine only that cell which creates hanging nodes on the faces. Finally I get 15 cells (see attached image).
4) Create two constraintMatrices: constraints and onlyHangingNodeConstraints.
constraints: both hanging node and periodic constraints
onlyHangingNodeConstraints: just hanging node constraints
5) Create two nodal vectors vec1 and vec2 with nodal value = nodal_coordinate.norm(). Set and distribute vec1 using constraints. Set and distribute vec2 using onlyHangingNodeConstraints.
6) Print l2 norm of vec1 and vec2.
The issue:
Since the nodal value = nodal_coordinate.norm() is intrinsically periodic (the domain being a hypercube with origin at the center), I would expect vec1 and vec2 to have the same l2 norm. However I get different l2 norm values:
L2 Norm vec1 (distributed using combined constraints): 178.494
L2 Norm vec2 (distributed using only hanging node constraints): 176.271
If I modify step 3) to: a) two step uniform refinement hypercube to get 64 cells ,and b) then pick one of the interior cells and refine only that cell which creates hanging nodes only in the interior. Total (71 cells). The l2 norm of vec1 and vec2 matches in this case:
L2 Norm vec1 (distributed using combined constraints): 278.505
L2 Norm vec2 (distributed using only hanging node constraints): 278.505
Thanks,
Sambit