]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: adjust rotation for inverted matching
authorMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 26 Nov 2014 23:51:46 +0000 (00:51 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Sun, 30 Nov 2014 14:42:53 +0000 (15:42 +0100)
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

index 2d1f8f22b7e6e90bd21c29b05e3b1aaeecc78152..cf1832a4940e9c5487d582a54fd379e7c0ca3cba 100644 (file)
@@ -2133,6 +2133,7 @@ namespace DoFTools
           {
             FullMatrix<double> 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);
           }
       }

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.