]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Force same FE object for transferring data. 6928/head
authorMarc Fehling <marc.fehling@gmx.net>
Wed, 18 Jul 2018 18:43:27 +0000 (12:43 -0600)
committerMarc Fehling <m.fehling@fz-juelich.de>
Wed, 18 Jul 2018 21:44:16 +0000 (15:44 -0600)
source/distributed/solution_transfer.cc
tests/mpi/p4est_2d_constraintmatrix_04.cc
tests/mpi/p4est_3d_constraintmatrix_03.cc

index 349ffbae7a645ff42107038b3c69e895c756c966..7341cb6aaf13a69e1f98faac148886dbf5e0e6cd 100644 (file)
@@ -246,8 +246,8 @@ namespace parallel
 
       const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
 
-      std::vector<::dealii::Vector<typename VectorType::value_type>> dofvalues =
-        Utilities::unpack<
+      const std::vector<::dealii::Vector<typename VectorType::value_type>>
+        dofvalues = Utilities::unpack<
           std::vector<::dealii::Vector<typename VectorType::value_type>>>(
           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));
         }
     }
index c2f7d4bcc2f8e45eddba69efb7bdba62df977e9b..e708e5cf66412eb8e41dadea745c8b399006bdbd 100644 (file)
@@ -237,7 +237,7 @@ test()
 
       tr.execute_coarsening_and_refinement();
 
-      static FE_Q<dim> fe(1);
+      static FE_Q<dim> fe(2);
 
       dofh.distribute_dofs(fe);
 
index c205e6aaeecf391deb0766c651f2f6348b26a8d7..0e206e2f03bbd75d69e3b034827770f97ea4f2c1 100644 (file)
@@ -237,7 +237,7 @@ test()
       tr.execute_coarsening_and_refinement();
 
 
-      static FE_Q<dim> fe(1);
+      static FE_Q<dim> fe(3);
 
       dofh.distribute_dofs(fe);
 

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.