From 2998cfcf776578f56777facbf6274389a536f080 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Wed, 18 Jul 2018 12:43:27 -0600 Subject: [PATCH] Force same FE object for transferring data. --- source/distributed/solution_transfer.cc | 24 +++++++++-------------- tests/mpi/p4est_2d_constraintmatrix_04.cc | 2 +- tests/mpi/p4est_3d_constraintmatrix_03.cc | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) 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); -- 2.39.5