From 4c5c033002a4f46bca2b65347c6a7bd6a970447f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 27 Nov 2014 00:51:46 +0100 Subject: [PATCH] Bugfix: adjust rotation for inverted matching When constraining from face_1 to face_2 we have to use an (orientation, flip, rotation) bitset that actually gives the relative orientation of face_2 to face_1 (and not as specified face_1 to face_2). This worked by accident because the constraining direction face_2 to face_1 is accidentally almost always used in all test cases. --- source/dofs/dof_tools_constraints.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 2d1f8f22b7..cf1832a494 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -2133,6 +2133,7 @@ namespace DoFTools { FullMatrix inverse(transformation.m()); inverse.invert(transformation); + set_periodicity_constraints(face_2, face_1, inverse, @@ -2146,13 +2147,22 @@ namespace DoFTools { Assert(!face_1->has_children(), ExcInternalError()); + // Important note: + // In 3D we have to take care of the fact that face_rotation + // gives the relative rotation of face_1 to face_2, i.e. we + // have to invert the rotation when constraining face_2 to + // face_1. Therefore face_flip has to be toggled if + // face_rotation is true: + // In case of inverted orientation, nothing has to be done. set_periodicity_constraints(face_1, face_2, transformation, constraint_matrix, component_mask, face_orientation, - face_flip, + face_orientation + ? face_rotation ^ face_flip + : face_flip, face_rotation); } } -- 2.39.5