]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make function call to MeshWorker::integration_loop easier
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Mar 2010 20:06:26 +0000 (20:06 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Mar 2010 20:06:26 +0000 (20:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@20905 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 24f60454eeb82f45b6266eb67d989eef0725458a..291cb80883e258675d06ac8680a5c4e02fdf5cee 100644 (file)
@@ -230,14 +230,14 @@ namespace MeshWorker
  * @ingroup MeshWorker
  * @author Guido Kanschat, 2009
  */
-  template<class DOFINFO, class INFOBOX, int dim, int spacedim, typename ASSEMBLER, class ITERATOR>
+  template<int dim, int spacedim, class DOFINFO, class INFOBOX, typename ASSEMBLER, class ITERATOR>
   void loop(ITERATOR begin,
            typename identity<ITERATOR>::type end,
            DOFINFO& dinfo,
            INFOBOX& info,
-           const std_cxx1x::function<void (DoFInfo<dim, spacedim>&, typename INFOBOX::CellInfo &)> &cell_worker,
-           const std_cxx1x::function<void (DoFInfo<dim, spacedim>&, typename INFOBOX::FaceInfo &)> &boundary_worker,
-           const std_cxx1x::function<void (DoFInfo<dim, spacedim>&, DoFInfo<dim, spacedim>&,
+           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::CellInfo &)> &cell_worker,
+           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::FaceInfo &)> &boundary_worker,
+           const std_cxx1x::function<void (DOFINFO&, DOFINFO&,
                                            typename INFOBOX::FaceInfo &,
                                            typename INFOBOX::FaceInfo &)> &face_worker,
            ASSEMBLER &assembler,
@@ -272,18 +272,20 @@ namespace MeshWorker
  * @ingroup MeshWorker
  * @author Guido Kanschat, 2009
  */
-  template<class CELLINFO, class FACEINFO, class DOFINFO, int dim, class ITERATOR, typename ASSEMBLER>
+  template<int dim, int spacedim, class ITERATOR, class ASSEMBLER>
   void integration_loop(ITERATOR begin,
                        typename identity<ITERATOR>::type end,
-                       DOFINFO& dof_info,
-                       IntegrationInfoBox<dim, dim>& box,
-                       const std_cxx1x::function<void (DoFInfo<dim>&, CELLINFO &)> &cell_worker,
-                       const std_cxx1x::function<void (DoFInfo<dim>&, FACEINFO &)> &boundary_worker,
-                       const std_cxx1x::function<void (DoFInfo<dim>&, DoFInfo<dim>&, FACEINFO &, FACEINFO &)> &face_worker,
+                       DoFInfo<dim, spacedim>& dof_info,
+                       IntegrationInfoBox<dim, spacedim>& box,
+                       const std_cxx1x::function<void (DoFInfo<dim>&, IntegrationInfo<dim, spacedim>&)> &cell_worker,
+                       const std_cxx1x::function<void (DoFInfo<dim>&, IntegrationInfo<dim, spacedim>&)> &boundary_worker,
+                       const std_cxx1x::function<void (DoFInfo<dim>&, DoFInfo<dim>&,
+                                                       IntegrationInfo<dim, spacedim>&,
+                                                       IntegrationInfo<dim, spacedim>&)> &face_worker,
                        ASSEMBLER &assembler,
                        bool cells_first = true)
   {
-    loop<DoFInfo<dim>, IntegrationInfoBox<dim, dim> >
+    loop<dim, dim>
       (begin, end,
        dof_info,
        box,
index 69c8ffdebad6e6708dbeaa9d58b3247fb0ff9850..a14cd67338dc2cc5cfc8aada54db1dba2fbe889c 100644 (file)
@@ -387,7 +387,7 @@ void Step12<dim>::assemble_system ()
                                   // result of std::bind if the local
                                   // integrators were, for example,
                                   // non-static member functions.
-  MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim>, dim, dim>
+  MeshWorker::integration_loop<dim, dim>
     (dof_handler.begin_active(), dof_handler.end(),
      dof_info, info_box,
      &Step12<dim>::integrate_cell_term,
index af2901100924bf15281d008a76a12aa832b1ea30..1c86d1e32de7ba213e326d729ec23398a172a367 100644 (file)
@@ -446,7 +446,7 @@ Step39<dim>::assemble_matrix()
   MeshWorker::IntegrationInfoBox<dim> info_box;
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
   info_box.initialize(integration_worker, fe, mapping);
-  MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim>, dim, dim>(
+  MeshWorker::integration_loop<dim, dim>(
     dof_handler.begin_active(), dof_handler.end(),
     dof_info, info_box,
     &MatrixIntegrator<dim>::cell,
@@ -473,7 +473,7 @@ Step39<dim>::assemble_mg_matrix()
   MeshWorker::IntegrationInfoBox<dim> info_box;
   MeshWorker::DoFInfo<dim> dof_info(mg_dof_handler);
   info_box.initialize(integration_worker, fe, mapping);
-  MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim>, dim, dim> (
+  MeshWorker::integration_loop<dim, dim> (
     mg_dof_handler.begin(), mg_dof_handler.end(),
     dof_info, info_box,
     &MatrixIntegrator<dim>::cell,
@@ -503,7 +503,7 @@ Step39<dim>::assemble_right_hand_side()
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
   info_box.initialize(integration_worker, fe, mapping);
   
-  MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim>, dim, dim>(
+  MeshWorker::integration_loop<dim, dim>(
     dof_handler.begin_active(), dof_handler.end(),
     dof_info, info_box,
     &RHSIntegrator<dim>::cell,
@@ -624,7 +624,7 @@ Step39<dim>::estimate()
   MeshWorker::IntegrationInfoBox<dim> info_box;
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
   info_box.initialize(integration_worker, fe, mapping, solution_data);
-  MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim>, dim, dim> (
+  MeshWorker::integration_loop<dim, dim> (
     dof_handler.begin_active(), dof_handler.end(),
     dof_info, info_box,
     &Estimator<dim>::cell,

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.