From: Matthias Maier Date: Mon, 28 May 2018 19:58:42 +0000 (-0500) Subject: Bugfix: Use correct number type in dof_tools_constraints.(cc|inst.in) X-Git-Tag: v9.1.0-rc1~1067^2~26 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d15b6fc8fef3f0361bf3324b80c9f5c16804758d;p=dealii.git Bugfix: Use correct number type in dof_tools_constraints.(cc|inst.in) DoFTools::make_hanging_node_constraints always uses double internally, but is also instantiated for std::complex --- diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index d9d06f5eab..1b055b046e 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -480,13 +480,13 @@ namespace DoFTools * It also suppresses very small entries in the constraint matrix to * avoid making the sparsity pattern fuller than necessary. */ - template + template void filter_constraints( const std::vector &master_dofs, const std::vector &slave_dofs, - const FullMatrix & face_constraints, - AffineConstraints & constraints) + const FullMatrix & face_constraints, + AffineConstraints & constraints) { Assert(face_constraints.n() == master_dofs.size(), ExcDimensionMismatch(master_dofs.size(), face_constraints.n())); @@ -526,7 +526,7 @@ namespace DoFTools { // add up the absolute values of all constraints in this // line to get a measure of their absolute size - number abs_sum = 0; + number1 abs_sum = 0; for (unsigned int i = 0; i < n_master_dofs; ++i) abs_sum += std::abs(face_constraints(row, i)); @@ -1050,7 +1050,7 @@ namespace DoFTools // a matrix to be used for constraints below. declared here and // simply resized down below to avoid permanent re-allocation of // memory - FullMatrix constraint_matrix; + FullMatrix constraint_matrix; // similarly have arrays that will hold master and slave dof numbers, // as well as a scratch array needed for the complicated case below @@ -1062,9 +1062,9 @@ namespace DoFTools // different (or the same) finite elements. we compute them only // once, namely the first time they are needed, and then just reuse // them - Table<2, std::unique_ptr>> face_interpolation_matrices( + Table<2, std::unique_ptr>> face_interpolation_matrices( n_finite_elements(dof_handler), n_finite_elements(dof_handler)); - Table<3, std::unique_ptr>> + Table<3, std::unique_ptr>> subface_interpolation_matrices( n_finite_elements(dof_handler), n_finite_elements(dof_handler), @@ -1075,7 +1075,7 @@ namespace DoFTools // these two matrices are derived from the face interpolation matrix // as described in the @ref hp_paper "hp paper" Table<2, - std::unique_ptr, FullMatrix>>> + std::unique_ptr, FullMatrix>>> split_face_interpolation_matrices(n_finite_elements(dof_handler), n_finite_elements(dof_handler)); @@ -1349,13 +1349,13 @@ namespace DoFTools split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()]); - const FullMatrix + const FullMatrix &restrict_mother_to_virtual_master_inv = (split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()] ->first); - const FullMatrix + const FullMatrix &restrict_mother_to_virtual_slave = (split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()] @@ -1440,7 +1440,7 @@ namespace DoFTools subface_interpolation_matrices [dominating_fe_index][subface_fe_index][sf]); - const FullMatrix + const FullMatrix &restrict_subface_to_virtual = *( subface_interpolation_matrices [dominating_fe_index][subface_fe_index][sf]); @@ -1659,13 +1659,13 @@ namespace DoFTools [dominating_fe_index][cell->active_fe_index()]); const FullMatrix< - number> &restrict_mother_to_virtual_master_inv = + double> &restrict_mother_to_virtual_master_inv = (split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()] ->first); const FullMatrix< - number> &restrict_mother_to_virtual_slave = + double> &restrict_mother_to_virtual_slave = (split_face_interpolation_matrices [dominating_fe_index][cell->active_fe_index()] ->second); @@ -1724,7 +1724,7 @@ namespace DoFTools [dominating_fe_index] [neighbor->active_fe_index()]); - const FullMatrix + const FullMatrix &restrict_secondface_to_virtual = *(face_interpolation_matrices [dominating_fe_index] diff --git a/source/dofs/dof_tools_constraints.inst.in b/source/dofs/dof_tools_constraints.inst.in index 2a6443182c..a9aae2a962 100644 --- a/source/dofs/dof_tools_constraints.inst.in +++ b/source/dofs/dof_tools_constraints.inst.in @@ -20,6 +20,10 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) template void DoFTools::make_hanging_node_constraints( const DoFHandler &, AffineConstraints &); + + template void DoFTools::make_hanging_node_constraints( + const DoFHandler &, + AffineConstraints> &); #endif } @@ -29,6 +33,10 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS) const DH &, AffineConstraints &); + template void DoFTools::make_hanging_node_constraints( + const DH &, + AffineConstraints> &); + #if deal_II_dimension != 1 template void DoFTools::make_periodicity_constraints( const DH::face_iterator &,