]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make sure fill is not called if no vectors are selected
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 18 Mar 2010 15:03:08 +0000 (15:03 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 18 Mar 2010 15:03:08 +0000 (15:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@20843 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/mesh_worker_info.h
deal.II/deal.II/include/numerics/mesh_worker_vector_selector.h

index 9b13df27d8ca0d6481319976da5909dfbf22b7d6..5ccd0a3f619a523f987ba34e04f77c8dc3ad0b0b 100644 (file)
@@ -309,7 +309,7 @@ namespace MeshWorker
       DoFInfo(const BlockInfo& block_info);
 
                                       /**
-                                       * Default constructor
+                                       * Constructor
                                        * leaving the #block_info
                                        * pointer empty, but setting
                                        * the #aux_local_indices.
@@ -733,19 +733,22 @@ namespace MeshWorker
       template <class WORKER>
       void initialize(const WORKER&,
                      const FiniteElement<dim, spacedim>& el,
-                     const Mapping<dim, spacedim>& mapping);
+                     const Mapping<dim, spacedim>& mapping,
+                     const BlockInfo* block_info = 0);
 
       template <class WORKER, typename VECTOR>
       void initialize(const WORKER&,
                      const FiniteElement<dim, spacedim>& el,
                      const Mapping<dim, spacedim>& mapping,
-                     const NamedData<VECTOR*>& data);
+                     const NamedData<VECTOR*>& data,
+                     const BlockInfo* block_info = 0);
 
       template <class WORKER, typename VECTOR>
       void initialize(const WORKER&,
                      const FiniteElement<dim, spacedim>& el,
                      const Mapping<dim, spacedim>& mapping,
-                     const NamedData<MGLevelObject<VECTOR>*>& data);
+                     const NamedData<MGLevelObject<VECTOR>*>& data,
+                     const BlockInfo* block_info = 0);
 
       boost::shared_ptr<MeshWorker::VectorDataBase<dim, spacedim> > cell_data;
       boost::shared_ptr<MeshWorker::VectorDataBase<dim, spacedim> > boundary_data;
@@ -851,6 +854,9 @@ namespace MeshWorker
     for (unsigned int i=0;i<M2.size();++i)
       M2[i].matrix.reinit(bi.block_size(M2[i].row),
                          bi.block_size(M2[i].column));
+    for (unsigned int k=0;k<quadrature_values.size();++k)
+      for (unsigned int i=0;i<quadrature_values[k].size();++i)
+       quadrature_values[k][i] = 0.;
   }
 
 
@@ -1218,7 +1224,8 @@ namespace MeshWorker
       }
 
     const bool split_fevalues = info.block_info != 0;
-    fill_local_data(info, split_fevalues);
+    if (!global_data->empty())
+      fill_local_data(info, split_fevalues);
   }
 
 
@@ -1230,18 +1237,19 @@ namespace MeshWorker
   IntegrationInfoBox<dim,sdim>::
   initialize(const WORKER& integrator,
             const FiniteElement<dim,sdim>& el,
-            const Mapping<dim,sdim>& mapping)
+            const Mapping<dim,sdim>& mapping,
+            const BlockInfo* block_info)
   {
     cell.initialize<FEValues<dim,sdim> >(el, mapping, integrator.cell_quadrature,
-                        integrator.cell_flags);
+                                        integrator.cell_flags, block_info);
     boundary.initialize<FEFaceValues<dim,sdim> >(el, mapping, integrator.boundary_quadrature,
-                        integrator.boundary_flags);
+                        integrator.boundary_flags, block_info);
     face.initialize<FEFaceValues<dim,sdim> >(el, mapping, integrator.face_quadrature,
-                        integrator.face_flags);
+                        integrator.face_flags, block_info);
     subface.initialize<FESubfaceValues<dim,sdim> >(el, mapping, integrator.face_quadrature,
-                           integrator.face_flags);
+                           integrator.face_flags, block_info);
     neighbor.initialize<FEFaceValues<dim,sdim> >(el, mapping, integrator.face_quadrature,
-                                                     integrator.neighbor_flags);
+                                                     integrator.neighbor_flags, block_info);
   }
 
 
@@ -1252,9 +1260,10 @@ namespace MeshWorker
     const WORKER& integrator,
     const FiniteElement<dim,sdim>& el,
     const Mapping<dim,sdim>& mapping,
-    const NamedData<VECTOR*>& data)
+    const NamedData<VECTOR*>& data,
+    const BlockInfo* block_info)
   {
-    initialize(integrator, el, mapping);
+    initialize(integrator, el, mapping, block_info);
     boost::shared_ptr<VectorData<VECTOR, dim, sdim> > p;
 
     p = boost::shared_ptr<VectorData<VECTOR, dim, sdim> >(new VectorData<VECTOR, dim, sdim> (integrator.cell_selector));
@@ -1283,9 +1292,10 @@ namespace MeshWorker
     const WORKER& integrator,
     const FiniteElement<dim,sdim>& el,
     const Mapping<dim,sdim>& mapping,
-    const NamedData<MGLevelObject<VECTOR>*>& data)
+    const NamedData<MGLevelObject<VECTOR>*>& data,
+    const BlockInfo* block_info)
   {
-    initialize(integrator, el, mapping);
+    initialize(integrator, el, mapping, block_info);
     boost::shared_ptr<MGVectorData<VECTOR, dim, sdim> > p;
 
     p = boost::shared_ptr<MGVectorData<VECTOR, dim, sdim> >(new MGVectorData<VECTOR, dim, sdim> (integrator.cell_selector));
index 125568eff8f109ff336280fb90d85f6e673356e6..80312e8f881b3932eddea8dfe7642216d32cb558 100644 (file)
@@ -37,6 +37,7 @@ namespace MeshWorker
  * determine which values, derivatives or second derivatives are
  * actually computed.
  *
+ * @ingroup MeshWorker
  * @author Guido Kanschat 2009
  */
   class VectorSelector :
@@ -177,6 +178,7 @@ namespace MeshWorker
  * Based on VectorSelector, this is the class used by IntegrationInfo
  * to compute values of source vectors in quadrature points.
  *
+ * @ingroup MeshWorker
  * @author Guido Kanschat, 2009
  */
   template <int dim, int spacedim = dim>
@@ -308,6 +310,7 @@ namespace MeshWorker
  * function VectorDataBase::fill() for a certain type of vector, using
  * NamedData to identify vectors by name.
  *
+ * @ingroup MeshWorker
  * @author Guido Kanschat, 2009
  */
   template <class VECTOR, int dim, int spacedim = dim>
@@ -373,7 +376,8 @@ namespace MeshWorker
  * function VectorDataBase::fill() for a certain type of multilevel vectors, using
  * NamedData to identify vectors by name.
  *
- * @author Guido Kanschat, 2009
+ * @ingroup MeshWorker
+ * @author Guido Kanschat, 2010
  */
   template <class VECTOR, int dim, int spacedim = dim>
   class MGVectorData :

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.