]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reverse template arguments to parallel::GridTools::exchange_cell_data_to_ghosts(). 4821/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 13 Aug 2017 21:49:31 +0000 (15:49 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 13 Aug 2017 22:41:30 +0000 (16:41 -0600)
include/deal.II/distributed/grid_tools.h
tests/distributed_grids/grid_tools_exchange_cell_data_01.cc
tests/distributed_grids/grid_tools_exchange_cell_data_02.cc
tests/distributed_grids/grid_tools_exchange_cell_data_03.cc

index 116b40e11639915f52cbbb27d17bf8a11874cb23..1acb5ecfb4a5c41c4468db39d205a9408b60ec90 100644 (file)
@@ -48,7 +48,11 @@ namespace parallel
      * ghost cell as it was given by @p pack on the owning processor.
      *
      * @tparam DataType The type of the data to be communicated. It is assumed
-     * to be serializable by boost::serialization.
+     *   to be serializable by boost::serialization. In many cases, this
+     *   data type can not be deduced by the compiler, e.g., if you provide
+     *   lambda functions for the second and third argument
+     *   to this function. In this case, you have to explicitly specify
+     *   the @p DataType as a template argument to the function call.
      * @tparam MeshType The type of @p mesh.
      *
      * @param mesh A variable of a type that satisfies the requirements of the
@@ -59,7 +63,7 @@ namespace parallel
      * with the data imported from the other procs.
 
      */
-    template <typename MeshType, typename DataType>
+    template <typename DataType, typename MeshType>
     void
     exchange_cell_data_to_ghosts (const MeshType &mesh,
                                   std::function<DataType (const typename MeshType::active_cell_iterator &)> pack,
@@ -191,7 +195,7 @@ namespace parallel
     }
 
 
-    template <typename MeshType, typename DataType>
+    template <typename DataType, typename MeshType>
     void
     exchange_cell_data_to_ghosts (const MeshType &mesh,
                                   std::function<DataType (const typename MeshType::active_cell_iterator &)> pack,
index 39515084121655af383818f6a350b8e68d60d62d..224874cb556885b91536028b7102d747b0f9845c 100644 (file)
@@ -43,9 +43,10 @@ void test ()
   typedef double DT;
   DT counter = 0.0;
   parallel::GridTools::exchange_cell_data_to_ghosts<
-  parallel::distributed::Triangulation<dim>,
-           DT> (tria,
-                [&](const cell_iterator& cell)
+  DT,
+  parallel::distributed::Triangulation<dim>>
+  (tria,
+   [&](const cell_iterator& cell)
   {
     DT value = ++counter;
 
index d66e04d2d4bee644f440e7bfd1fc95b681106b26..fb271676762d9700fb7f103ad2e1347f5d844d03 100644 (file)
@@ -50,9 +50,10 @@ void test ()
   typedef short DT;
   short counter = 0;
   parallel::GridTools::exchange_cell_data_to_ghosts<
-  DoFHandler<dim>,
-             DT> (dofhandler,
-                  [&](const cell_iterator& cell)
+  DT,
+  DoFHandler<dim> >
+  (dofhandler,
+   [&](const cell_iterator& cell)
   {
     DT value = ++counter;
 
index 27559b72630fda558e9327597d3e38261dc86804..f98f540194d3ed5853d2f5eccd16c7cddb796012 100644 (file)
@@ -48,9 +48,9 @@ void test ()
   typedef double DT;
   DT counter = 0.0;
   parallel::GridTools::exchange_cell_data_to_ghosts<
-  parallel::shared::Triangulation<dim>,
-           DT> (tria,
-                [&](const cell_iterator& cell)
+  DT, parallel::shared::Triangulation<dim>>
+                                         (tria,
+                                          [&](const cell_iterator& cell)
   {
     DT value = ++counter;
 

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.