From: bangerth Date: Wed, 20 Jan 2010 14:51:53 +0000 (+0000) Subject: First step in getting rid of the AssemblingIntegrator class and splitting its functio... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f97bc8a8f54986e492e9fa4a896eb082cb2c6e57;p=dealii-svn.git First step in getting rid of the AssemblingIntegrator class and splitting its functionality into two parts. git-svn-id: https://svn.dealii.org/trunk@20402 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/mesh_worker_loop.h b/deal.II/deal.II/include/numerics/mesh_worker_loop.h index 59b323ad30..a4ea53d9d1 100644 --- a/deal.II/deal.II/include/numerics/mesh_worker_loop.h +++ b/deal.II/deal.II/include/numerics/mesh_worker_loop.h @@ -189,24 +189,23 @@ namespace MeshWorker * @ingroup MeshWorker * @author Guido Kanschat, 2009 */ - template + template void integration_loop(ITERATOR begin, typename identity::type end, IntegrationInfoBox& box, - LOCALWORKER& localworker, + const std_cxx1x::function &cell_worker, + const std_cxx1x::function &boundary_worker, + const std_cxx1x::function &face_worker, bool cells_first = true) { - typedef typename IntegrationInfoBox::CellInfo CELLINFO; - typedef typename IntegrationInfoBox::FaceInfo FACEINFO; - loop (begin, end, box.cell_info, box.bdry_info, box.face_info, box.subface_info, box.neighbor_info, - std_cxx1x::bind (&LOCALWORKER::cell, localworker, _1), - std_cxx1x::bind (&LOCALWORKER::bdry, localworker, _1), - std_cxx1x::bind (&LOCALWORKER::face, localworker, _1, _2), + cell_worker, + boundary_worker, + face_worker, cells_first); } } diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index 86af46cb78..ce44f58800 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -327,13 +327,15 @@ void DGMethod::assemble_system () // result of std::bind if the local // integrators were, for example, // non-static member functions. + typedef MeshWorker::AssemblingIntegrator , Vector > > - integrator(&DGMethod::integrate_cell_term, - &DGMethod::integrate_boundary_term, - &DGMethod::integrate_face_term); + Integrator; + Integrator integrator(&DGMethod::integrate_cell_term, + &DGMethod::integrate_boundary_term, + &DGMethod::integrate_face_term); // First, we initialize the // quadrature formulae and the @@ -388,7 +390,12 @@ void DGMethod::assemble_system () // over all active cells // (determined by the first // argument, which is an active iterator). - MeshWorker::integration_loop(dof_handler.begin_active(), dof_handler.end(), info_box, integrator); + MeshWorker::integration_loop + (dof_handler.begin_active(), dof_handler.end(), + info_box, + std_cxx1x::bind (&Integrator::cell, integrator, _1), + std_cxx1x::bind (&Integrator::bdry, integrator, _1), + std_cxx1x::bind (&Integrator::face, integrator, _1, _2)); }