From: Matthias Maier Date: Wed, 26 Nov 2014 23:51:46 +0000 (+0100) Subject: Bugfix: adjust rotation for inverted matching X-Git-Tag: v8.2.0-rc1~36^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c5c033002a4f46bca2b65347c6a7bd6a970447f;p=dealii.git 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. --- 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); } }