From: Marc Fehling Date: Wed, 18 Jul 2018 18:43:27 +0000 (-0600) Subject: Force same FE object for transferring data. X-Git-Tag: v9.1.0-rc1~900^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2998cfcf776578f56777facbf6274389a536f080;p=dealii.git Force same FE object for transferring data. --- diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index 349ffbae7a..7341cb6aaf 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -246,8 +246,8 @@ namespace parallel const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; - std::vector<::dealii::Vector> dofvalues = - Utilities::unpack< + const std::vector<::dealii::Vector> + dofvalues = Utilities::unpack< std::vector<::dealii::Vector>>( data_range.begin(), data_range.end(), /*allow_compression=*/false); @@ -259,23 +259,17 @@ namespace parallel for (auto it_dofvalues = dofvalues.begin(); it_dofvalues != dofvalues.end(); ++it_dofvalues) - Assert(dofs_per_cell <= it_dofvalues->size(), - ExcMessage( - "The transferred data was packed on fewer dofs than the" - "currently registered FE object assigned to the DoFHandler.")); + Assert( + dofs_per_cell == it_dofvalues->size(), + ExcMessage( + "The transferred data was packed with a different number of dofs than the" + "currently registered FE object assigned to the DoFHandler has.")); // distribute data for each registered vector on mesh - auto it_input = dofvalues.begin(); + auto it_input = dofvalues.cbegin(); auto it_output = all_out.begin(); - for (; it_input != dofvalues.end(); ++it_input, ++it_output) + for (; it_input != dofvalues.cend(); ++it_input, ++it_output) { - // Adjust size of vector to the order of current FE object - // associated with the registered DofHandler. - // Fixes the following tests: - // - p4est_2d_constraintmatrix_04.*.debug - // - p4est_3d_constraintmatrix_03.*.debug - it_input->reinit(dofs_per_cell, /*omit_zeroing_entries=*/true); - cell->set_dof_values_by_interpolation(*it_input, *(*it_output)); } } diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index c2f7d4bcc2..e708e5cf66 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -237,7 +237,7 @@ test() tr.execute_coarsening_and_refinement(); - static FE_Q fe(1); + static FE_Q fe(2); dofh.distribute_dofs(fe); diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index c205e6aaee..0e206e2f03 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -237,7 +237,7 @@ test() tr.execute_coarsening_and_refinement(); - static FE_Q fe(1); + static FE_Q fe(3); dofh.distribute_dofs(fe);