]> https://gitweb.dealii.org/ - dealii.git/commitdiff
implement Assembler::Functional::initialize_info
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 15 Feb 2011 17:58:58 +0000 (17:58 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 15 Feb 2011 17:58:58 +0000 (17:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@23368 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/numerics/mesh_worker_assembler.h

index ec991252e6280e0c499d313594e24d8376b6fc5e..b9396c0b7ff5191eaece1cb7470e215eeb6cc835 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2010 by the deal.II authors
+//    Copyright (C) 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
@@ -93,7 +93,10 @@ namespace MeshWorker
       public:
                                         /**
                                          * Initialize local data to
-                                         * store functionals.
+                                         * store functionals. The
+                                         * number <tt>n</tt> is the
+                                         * number of functionals to
+                                         * be computed.
                                          */
        void initialize(unsigned int n);
                                         /**
@@ -102,20 +105,9 @@ namespace MeshWorker
                                          * DoFInfo
                                          * object used later for
                                          * assembling.
-                                         *
-                                         * The second parameter is
-                                         * used to distinguish
-                                         * between the data used on
-                                         * cells and boundary faces
-                                         * on the one hand and
-                                         * interior faces on the
-                                         * other. Interior faces may
-                                         * require additional data
-                                         * being initialized.
                                          */
-       template <int dim>
-       void initialize_info(DoFInfo<dim>& info,
-                            bool interior_face);
+       template <class DOFINFO>
+       void initialize_info(DOFINFO& info, bool interior_face);
        
                                         /**
                                          * Assemble the local values
@@ -1120,6 +1112,16 @@ namespace MeshWorker
     Functional<number>::initialize(unsigned int n)
     {
       results.resize(n);
+      std::fill(results.begin(), results.end(), 0.);
+    }
+    
+    
+    template <typename number>
+    template <class DOFINFO>
+    inline void
+    Functional<number>::initialize_info(DOFINFO& info, bool)
+    {
+      info.initialize_numbers(results.size());
     }
     
     

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.