]> https://gitweb.dealii.org/ - dealii.git/commitdiff
First step in getting rid of the AssemblingIntegrator class and splitting its functio...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 Jan 2010 14:51:53 +0000 (14:51 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 Jan 2010 14:51:53 +0000 (14:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@20402 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/mesh_worker_loop.h
deal.II/examples/step-38/step-38.cc

index 59b323ad30cfa130462c219f9f85d9810a454e86..a4ea53d9d167b970e9adbf8ee716376ea1a469ae 100644 (file)
@@ -189,24 +189,23 @@ namespace MeshWorker
  * @ingroup MeshWorker
  * @author Guido Kanschat, 2009
  */
-  template<int dim, class ITERATOR, class LOCALWORKER>
+  template<class CELLINFO, class FACEINFO, int dim, class ITERATOR>
   void integration_loop(ITERATOR begin,
                        typename identity<ITERATOR>::type end,
                        IntegrationInfoBox<dim, dim>& box,
-                       LOCALWORKER& localworker,
+                       const std_cxx1x::function<void (CELLINFO &)> &cell_worker,
+                       const std_cxx1x::function<void (FACEINFO &)> &boundary_worker,
+                       const std_cxx1x::function<void (FACEINFO &, FACEINFO &)> &face_worker,
                        bool cells_first = true)
   {
-    typedef typename IntegrationInfoBox<dim, dim>::CellInfo CELLINFO;
-    typedef typename IntegrationInfoBox<dim, dim>::FaceInfo FACEINFO;
-
     loop<CELLINFO,FACEINFO>
       (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);
   }
 }
index 86af46cb7832c4489f958339893d70d9d5a576cc..ce44f588009ca665f1d3f114a0def2505f48ad66 100644 (file)
@@ -327,13 +327,15 @@ void DGMethod<dim>::assemble_system ()
                                   // result of std::bind if the local
                                   // integrators were, for example,
                                   // non-static member functions.
+  typedef
   MeshWorker::AssemblingIntegrator
     <dim,
      MeshWorker::Assembler::SystemSimple<SparseMatrix<double>,
                                          Vector<double> > >
-    integrator(&DGMethod<dim>::integrate_cell_term,
-              &DGMethod<dim>::integrate_boundary_term,
-              &DGMethod<dim>::integrate_face_term);
+    Integrator;
+  Integrator integrator(&DGMethod<dim>::integrate_cell_term,
+                       &DGMethod<dim>::integrate_boundary_term,
+                       &DGMethod<dim>::integrate_face_term);
 
                                   // First, we initialize the
                                   // quadrature formulae and the
@@ -388,7 +390,12 @@ void DGMethod<dim>::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<CellInfo,FaceInfo>
+    (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));
 }
 
 

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.