]> https://gitweb.dealii.org/ - dealii.git/commitdiff
remove a problem that bind seems to create a copy of its arguments and does not use...
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 15 Feb 2011 17:52:02 +0000 (17:52 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 15 Feb 2011 17:52:02 +0000 (17:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@23365 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/numerics/mesh_worker_loop.h

index 66ebbb3bc882555f8cf692bc15ba16ef8f920bed..8ad75db23cf31a43538d68b16a3a2f7e79d1dd32 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -44,9 +44,9 @@ namespace internal
   }
 
   template<int dim, class DOFINFO, class A>
-  void assemble(const MeshWorker::DoFInfoBox<dim, DOFINFO>& dinfo, A& assembler)
+  void assemble(const MeshWorker::DoFInfoBox<dim, DOFINFO>& dinfo, A* assembler)
   {
-    dinfo.assemble(assembler);
+    dinfo.assemble(*assembler);
   }
 }
 
@@ -240,12 +240,12 @@ namespace MeshWorker
            typename identity<ITERATOR>::type end,
            DOFINFO& dinfo,
            INFOBOX& info,
-           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::CellInfo&)> &cell_worker,
-           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::CellInfo&)> &boundary_worker,
+           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::CellInfo&)>cell_worker,
+           const std_cxx1x::function<void (DOFINFO&, typename INFOBOX::CellInfo&)>boundary_worker,
            const std_cxx1x::function<void (DOFINFO&, DOFINFO&,
                                            typename INFOBOX::CellInfo&,
-                                           typename INFOBOX::CellInfo&)> &face_worker,
-           ASSEMBLER &assembler,
+                                           typename INFOBOX::CellInfo&)>face_worker,
+           ASSEMBLERassembler,
            bool cells_first = true)
   {
     DoFInfoBox<dim, DOFINFO> dof_info(dinfo);
@@ -262,7 +262,7 @@ namespace MeshWorker
     WorkStream::run(begin, end,
                    std_cxx1x::bind(cell_action<INFOBOX, DOFINFO, dim, spacedim, ITERATOR>, _1, _3, _2,
                                    cell_worker, boundary_worker, face_worker, cells_first, true),
-                   std_cxx1x::bind(internal::assemble<dim,DOFINFO,ASSEMBLER>, _1, assembler),
+                   std_cxx1x::bind(internal::assemble<dim,DOFINFO,ASSEMBLER>, _1, &assembler),
                    info, dof_info);
 #else
     for (ITERATOR cell = begin; cell != end; ++cell)
@@ -275,6 +275,8 @@ namespace MeshWorker
        dof_info.assemble(assembler);
       }
 #endif
+    for (unsigned int i=0;i<3;++i)
+      deallog << '[' << assembler(i) << ']';
   }
 
 /**

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.