]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make mesh_loop CopyData and ScratchData args const refs 4960/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 25 Aug 2017 17:45:38 +0000 (13:45 -0400)
committerTimo Heister <timo.heister@gmail.com>
Fri, 25 Aug 2017 18:11:03 +0000 (14:11 -0400)
include/deal.II/meshworker/mesh_loop.h

index c2f0b99dbb920812f37c64c2d385d465577bce13..256f1a8834e7596acccda33424ec03fe687151b2 100644 (file)
@@ -119,8 +119,8 @@ namespace MeshWorker
                  const typename identity<std::function<void (const CellIteratorType &, ScratchData &, CopyData &)>>::type &cell_worker,
                  const typename identity<std::function<void (const CopyData &)>>::type &copier,
 
-                 ScratchData &scratch_data,
-                 CopyData &copy_data,
+                 const ScratchData &sample_scratch_data,
+                 const CopyData &sample_copy_data,
 
                  const AssembleFlags flags = assemble_own_cells,
 
@@ -161,7 +161,7 @@ namespace MeshWorker
     auto cell_action = [&] (const CellIteratorType &cell, ScratchData &scratch, CopyData &copy)
     {
       // First reset the CopyData class to the empty copy_data given by the user.
-      copy = copy_data;
+      copy = sample_copy_data;
 
       const bool ignore_subdomain = (cell->get_triangulation().locally_owned_subdomain()
                                      == numbers::invalid_subdomain_id);
@@ -306,7 +306,7 @@ namespace MeshWorker
     // Submit to workstream
     WorkStream::run(begin, end,
                     cell_action, copier,
-                    scratch_data, copy_data,
+                    sample_scratch_data, sample_copy_data,
                     queue_length, chunk_size);
   }
 }

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.