From 155bfb99ed66e1e41d31fb287b9e9a9a4bdc6c21 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 13 Aug 2017 15:49:31 -0600 Subject: [PATCH] Reverse template arguments to parallel::GridTools::exchange_cell_data_to_ghosts(). --- include/deal.II/distributed/grid_tools.h | 10 +++++++--- .../grid_tools_exchange_cell_data_01.cc | 7 ++++--- .../grid_tools_exchange_cell_data_02.cc | 7 ++++--- .../grid_tools_exchange_cell_data_03.cc | 6 +++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/include/deal.II/distributed/grid_tools.h b/include/deal.II/distributed/grid_tools.h index 116b40e116..1acb5ecfb4 100644 --- a/include/deal.II/distributed/grid_tools.h +++ b/include/deal.II/distributed/grid_tools.h @@ -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 + template void exchange_cell_data_to_ghosts (const MeshType &mesh, std::function pack, @@ -191,7 +195,7 @@ namespace parallel } - template + template void exchange_cell_data_to_ghosts (const MeshType &mesh, std::function pack, diff --git a/tests/distributed_grids/grid_tools_exchange_cell_data_01.cc b/tests/distributed_grids/grid_tools_exchange_cell_data_01.cc index 3951508412..224874cb55 100644 --- a/tests/distributed_grids/grid_tools_exchange_cell_data_01.cc +++ b/tests/distributed_grids/grid_tools_exchange_cell_data_01.cc @@ -43,9 +43,10 @@ void test () typedef double DT; DT counter = 0.0; parallel::GridTools::exchange_cell_data_to_ghosts< - parallel::distributed::Triangulation, - DT> (tria, - [&](const cell_iterator& cell) + DT, + parallel::distributed::Triangulation> + (tria, + [&](const cell_iterator& cell) { DT value = ++counter; diff --git a/tests/distributed_grids/grid_tools_exchange_cell_data_02.cc b/tests/distributed_grids/grid_tools_exchange_cell_data_02.cc index d66e04d2d4..fb27167676 100644 --- a/tests/distributed_grids/grid_tools_exchange_cell_data_02.cc +++ b/tests/distributed_grids/grid_tools_exchange_cell_data_02.cc @@ -50,9 +50,10 @@ void test () typedef short DT; short counter = 0; parallel::GridTools::exchange_cell_data_to_ghosts< - DoFHandler, - DT> (dofhandler, - [&](const cell_iterator& cell) + DT, + DoFHandler > + (dofhandler, + [&](const cell_iterator& cell) { DT value = ++counter; diff --git a/tests/distributed_grids/grid_tools_exchange_cell_data_03.cc b/tests/distributed_grids/grid_tools_exchange_cell_data_03.cc index 27559b7263..f98f540194 100644 --- a/tests/distributed_grids/grid_tools_exchange_cell_data_03.cc +++ b/tests/distributed_grids/grid_tools_exchange_cell_data_03.cc @@ -48,9 +48,9 @@ void test () typedef double DT; DT counter = 0.0; parallel::GridTools::exchange_cell_data_to_ghosts< - parallel::shared::Triangulation, - DT> (tria, - [&](const cell_iterator& cell) + DT, parallel::shared::Triangulation> + (tria, + [&](const cell_iterator& cell) { DT value = ++counter; -- 2.39.5