From 4b368f4b7ad3e6f33cb65464bc1bab42c6653e0a Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 26 Nov 2014 23:30:22 +0100 Subject: [PATCH] Use spacedim in compute_transformation instead of incorrect dim --- source/dofs/dof_tools_constraints.cc | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 489c4f150d..2d1f8f22b7 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -1878,11 +1878,11 @@ namespace DoFTools // Build up a (possibly rotated) interpolation matrix that is used in // set_periodicity_constraints with the help of user supplied matrix // and first_vector_components. - template + template FullMatrix compute_transformation( - const FiniteElement &fe, - const FullMatrix &matrix, - const std::vector &first_vector_components) + const FiniteElement &fe, + const FullMatrix &matrix, + const std::vector &first_vector_components) { Assert(matrix.m() == matrix.n(), ExcInternalError()); @@ -1905,14 +1905,14 @@ namespace DoFTools // transformation matrix, we assume that for a 0° rotation // we would have to build the identity matrix - Assert(matrix.m() == (int)dim, ExcInternalError()) + Assert(matrix.m() == (int)spacedim, ExcInternalError()) Quadrature quadrature (fe.get_unit_face_support_points()); FEFaceValues fe_face_values (fe, quadrature, update_q_points); // have an array that stores the location of each vector-dof tuple // we want to rotate. - typedef std_cxx1x::array DoFTuple; + typedef std_cxx1x::array DoFTuple; // start with a pristine interpolation matrix... FullMatrix transformation = IdentityMatrix(n_dofs); @@ -1931,11 +1931,11 @@ namespace DoFTools DoFTuple vector_dofs; vector_dofs[0] = i; - Assert(*comp_it + dim <= fe.n_components(), + Assert(*comp_it + spacedim <= fe.n_components(), ExcMessage("Error: the finite element does not have enough components " "to define rotated periodic boundaries.")); - for (unsigned int k=0; k < n_dofs; ++k) + for (unsigned int k = 0; k < n_dofs; ++k) if ((k != i) && (quadrature.point(k) == quadrature.point(i)) @@ -1944,18 +1944,18 @@ namespace DoFTools first_vector_component) && (fe.face_system_to_component_index(k).first < - first_vector_component + dim)) + first_vector_component + spacedim)) vector_dofs[fe.face_system_to_component_index(k).first - first_vector_component] = k; // ... and rotate all dofs belonging to vector valued // components that are selected by first_vector_components: - for (int i=0; ihas_children()) @@ -2022,9 +2023,9 @@ namespace DoFTools face_1->get_fe(face_1->nth_active_fe_index(0)).dofs_per_face; Assert(matrix.m() == 0 || matrix.m() == n_dofs || - matrix.m() == (int)dim, - ExcMessage ("matrix must have either size 0 or dim or the size " - "must be equal to the number of DoFs on the face")); + matrix.m() == (int)spacedim, + ExcMessage ("matrix must have either size 0 or spacedim or the " + "size must be equal to the # of DoFs on the face")); } if (!face_2->has_children()) @@ -2034,9 +2035,9 @@ namespace DoFTools face_2->get_fe(face_2->nth_active_fe_index(0)).dofs_per_face; Assert(matrix.m() == 0 || matrix.m() == n_dofs || - matrix.m() == (int)dim, - ExcMessage ("matrix must have either size 0 or dim or the size " - "must be equal to the number of DoFs on the face")); + matrix.m() == (int)spacedim, + ExcMessage ("matrix must have either size 0 or spacedim or the " + "size must be equal to the # of DoFs on the face")); } #endif @@ -2112,7 +2113,7 @@ namespace DoFTools // we need to do some work and enter the constraints! // The finite element that matters is the one on the active face: - const FiniteElement &fe = + const FiniteElement &fe = face_1->has_children() ? face_2->get_fe(face_2->nth_active_fe_index(0)) : face_1->get_fe(face_1->nth_active_fe_index(0)); -- 2.39.5