From 52148c0b5af11e34c3cad073574055372b364fc6 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sat, 23 Mar 2019 11:46:30 +0100 Subject: [PATCH] Fixed typos. --- doc/news/changes/minor/20190323LucaHeltai | 3 +- include/deal.II/meshworker/mesh_loop.h | 31 ++++++++++++++-- tests/meshworker/mesh_loop_class_01.cc | 2 +- tests/meshworker/mesh_loop_class_01.output | 42 +++++++++++----------- 4 files changed, 53 insertions(+), 25 deletions(-) diff --git a/doc/news/changes/minor/20190323LucaHeltai b/doc/news/changes/minor/20190323LucaHeltai index 265ceaaf7c..d4b08ab3de 100644 --- a/doc/news/changes/minor/20190323LucaHeltai +++ b/doc/news/changes/minor/20190323LucaHeltai @@ -1,3 +1,4 @@ -New: Added a variant of mesh_loop that takes a class and its member functions as workers and copiers. +New: Added a variant of MeshWorker::mesh_loop() that takes a class and its member functions as workers +and copiers.
(Luca Heltai, 2019/03/23) diff --git a/include/deal.II/meshworker/mesh_loop.h b/include/deal.II/meshworker/mesh_loop.h index 8589fbba06..8a76d18bc1 100644 --- a/include/deal.II/meshworker/mesh_loop.h +++ b/include/deal.II/meshworker/mesh_loop.h @@ -394,13 +394,13 @@ namespace MeshWorker } /** - * This is a variant of the mesh_loop function, that can be used for worker + * This is a variant of the mesh_loop() function, that can be used for worker * and copier functions that are member functions of a class. * * The argument passed as @p end must be convertible to the same type as @p * begin, but doesn't have to be of the same type itself. This allows to * write code like mesh_loop(dof_handler.begin_active(), - * dof_handler.end(), ... where the first is of type + * dof_handler.end(), ...) where the first is of type * DoFHandler::active_cell_iterator whereas the second is of type * DoFHandler::raw_cell_iterator. * @@ -415,6 +415,33 @@ namespace MeshWorker * queue_length*chunk_size copies of the CopyData object * are generated. * + * An example usage of the function is given by + * @code + * template + * class TestClass + * { + * public: + * void + * cell_worker(const CellIteratorType &cell, ScratchData &, CopyData &); + * + * ... + * }; + * + * ... + * TestClass test_class; + * ScratchData scratch; + * CopyData copy; + * + * mesh_loop(tria.begin_active(), + * tria.end(), + * test_class, + * &TestClass::cell_worker, + * &TestClass::copier, + * scratch, + * copy, + * assemble_own_cells); + * @endcode + * * @ingroup MeshWorker * @author Luca Heltai, 2019 */ diff --git a/tests/meshworker/mesh_loop_class_01.cc b/tests/meshworker/mesh_loop_class_01.cc index bda23d029d..6550600dd6 100644 --- a/tests/meshworker/mesh_loop_class_01.cc +++ b/tests/meshworker/mesh_loop_class_01.cc @@ -45,7 +45,7 @@ public: void cell_worker(const CellIteratorType &cell, ScratchData &, CopyData &) { - deallog << "Workgin on cell " << cell << std::endl; + deallog << "Working on cell " << cell << std::endl; } void diff --git a/tests/meshworker/mesh_loop_class_01.output b/tests/meshworker/mesh_loop_class_01.output index 63a972588d..1aa484b21e 100644 --- a/tests/meshworker/mesh_loop_class_01.output +++ b/tests/meshworker/mesh_loop_class_01.output @@ -1,55 +1,55 @@ DEAL::CELLS ONLY -DEAL::Workgin on cell 1.1 -DEAL::Workgin on cell 1.2 -DEAL::Workgin on cell 1.3 -DEAL::Workgin on cell 2.0 -DEAL::Workgin on cell 2.1 -DEAL::Workgin on cell 2.2 -DEAL::Workgin on cell 2.3 +DEAL::Working on cell 1.1 +DEAL::Working on cell 1.2 +DEAL::Working on cell 1.3 +DEAL::Working on cell 2.0 +DEAL::Working on cell 2.1 +DEAL::Working on cell 2.2 +DEAL::Working on cell 2.3 DEAL::CELLS+BOUNDARY -DEAL::Workgin on cell 1.1 +DEAL::Working on cell 1.1 DEAL::Boundary worker on : 1.1, Face : 1 DEAL::Boundary worker on : 1.1, Face : 2 -DEAL::Workgin on cell 1.2 +DEAL::Working on cell 1.2 DEAL::Boundary worker on : 1.2, Face : 0 DEAL::Boundary worker on : 1.2, Face : 3 -DEAL::Workgin on cell 1.3 +DEAL::Working on cell 1.3 DEAL::Boundary worker on : 1.3, Face : 1 DEAL::Boundary worker on : 1.3, Face : 3 -DEAL::Workgin on cell 2.0 +DEAL::Working on cell 2.0 DEAL::Boundary worker on : 2.0, Face : 0 DEAL::Boundary worker on : 2.0, Face : 2 -DEAL::Workgin on cell 2.1 +DEAL::Working on cell 2.1 DEAL::Boundary worker on : 2.1, Face : 2 -DEAL::Workgin on cell 2.2 +DEAL::Working on cell 2.2 DEAL::Boundary worker on : 2.2, Face : 0 -DEAL::Workgin on cell 2.3 +DEAL::Working on cell 2.3 DEAL::CELLS+BOUNDARY+FACES -DEAL::Workgin on cell 1.1 +DEAL::Working on cell 1.1 DEAL::Boundary worker on : 1.1, Face : 1 DEAL::Boundary worker on : 1.1, Face : 2 DEAL::Face worker on : 1.1, Neighbor cell : 1.3, Face : 3, Neighbor Face : 2, Subface: 4294967295, Neighbor Subface: 4294967295 -DEAL::Workgin on cell 1.2 +DEAL::Working on cell 1.2 DEAL::Boundary worker on : 1.2, Face : 0 DEAL::Face worker on : 1.2, Neighbor cell : 1.3, Face : 1, Neighbor Face : 0, Subface: 4294967295, Neighbor Subface: 4294967295 DEAL::Boundary worker on : 1.2, Face : 3 -DEAL::Workgin on cell 1.3 +DEAL::Working on cell 1.3 DEAL::Boundary worker on : 1.3, Face : 1 DEAL::Boundary worker on : 1.3, Face : 3 -DEAL::Workgin on cell 2.0 +DEAL::Working on cell 2.0 DEAL::Boundary worker on : 2.0, Face : 0 DEAL::Face worker on : 2.0, Neighbor cell : 2.1, Face : 1, Neighbor Face : 0, Subface: 4294967295, Neighbor Subface: 4294967295 DEAL::Boundary worker on : 2.0, Face : 2 DEAL::Face worker on : 2.0, Neighbor cell : 2.2, Face : 3, Neighbor Face : 2, Subface: 4294967295, Neighbor Subface: 4294967295 -DEAL::Workgin on cell 2.1 +DEAL::Working on cell 2.1 DEAL::Face worker on : 2.1, Neighbor cell : 1.1, Face : 1, Neighbor Face : 0, Subface: 4294967295, Neighbor Subface: 0 DEAL::Boundary worker on : 2.1, Face : 2 DEAL::Face worker on : 2.1, Neighbor cell : 2.3, Face : 3, Neighbor Face : 2, Subface: 4294967295, Neighbor Subface: 4294967295 -DEAL::Workgin on cell 2.2 +DEAL::Working on cell 2.2 DEAL::Boundary worker on : 2.2, Face : 0 DEAL::Face worker on : 2.2, Neighbor cell : 2.3, Face : 1, Neighbor Face : 0, Subface: 4294967295, Neighbor Subface: 4294967295 DEAL::Face worker on : 2.2, Neighbor cell : 1.2, Face : 3, Neighbor Face : 2, Subface: 4294967295, Neighbor Subface: 0 -DEAL::Workgin on cell 2.3 +DEAL::Working on cell 2.3 DEAL::Face worker on : 2.3, Neighbor cell : 1.1, Face : 1, Neighbor Face : 0, Subface: 4294967295, Neighbor Subface: 1 DEAL::Face worker on : 2.3, Neighbor cell : 1.2, Face : 3, Neighbor Face : 2, Subface: 4294967295, Neighbor Subface: 1 -- 2.39.5