]> https://gitweb.dealii.org/ - dealii.git/commitdiff
prepare for more flexibility in loop
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 24 Feb 2010 17:18:46 +0000 (17:18 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 24 Feb 2010 17:18:46 +0000 (17:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@20686 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a5b1a956d2a53b659b12c95a26031094ef4e95ae..55c3bff7e17ea6587602c2b19c54a33293a5fd89 100644 (file)
@@ -34,17 +34,22 @@ namespace MeshWorker
   void
   DoFInfo<dim,spacedim>::get_indices(const typename DoFHandler<dim, spacedim>::cell_iterator& c)
   {
-    indices.resize(c->get_fe().dofs_per_cell);
-  
-    if (block_info == 0 || block_info->local().size() == 0)
-      c->get_dof_indices(indices);
-    else
+    if (!c->has_children())
       {
-       indices_org.resize(c->get_fe().dofs_per_cell);
-       c->get_dof_indices(indices_org);
-       for (unsigned int i=0;i<indices.size();++i)
-         indices[this->block_info->renumber(i)] = indices_org[i];
+       indices.resize(c->get_fe().dofs_per_cell);
+       
+       if (block_info == 0 || block_info->local().size() == 0)
+         c->get_dof_indices(indices);
+       else
+         {
+           indices_org.resize(c->get_fe().dofs_per_cell);
+           c->get_dof_indices(indices_org);
+           for (unsigned int i=0;i<indices.size();++i)
+             indices[this->block_info->renumber(i)] = indices_org[i];
+         }
       }
+    else
+      indices.resize(0);
   }
 
 
index fe628ed2556ac194515a7a2ce530be93a15c8546..0e63154685bc3f1ba62bcfc7c205d61d20ebf606 100644 (file)
@@ -78,6 +78,10 @@ namespace MeshWorker
  * @param face_worker defines the local action on interior faces.
  * @param cells_first determines, whether faces or cells are to be
  * dealt with first.
+ * @param unique_faces_only determines, that a face between two cells
+ * of the same level is processed only from the cell which is less
+ * than its neighbor. If this parameter is <tt>false</tt> these faces
+ * are processed from both cells.
  *
  * @author Guido Kanschat, 2010
  */
@@ -91,7 +95,8 @@ namespace MeshWorker
     const std_cxx1x::function<void (DoFInfo<dim, spacedim>&, DoFInfo<dim, spacedim>&,
                                    typename INFOBOX::FaceInfo &,
                                    typename INFOBOX::FaceInfo &)> &face_worker,
-    bool cells_first = true)
+    const bool cells_first,
+    const bool unique_faces_only)
   {
     const bool integrate_cell          = (cell_worker != 0);
     const bool integrate_boundary      = (boundary_worker != 0);
@@ -166,7 +171,7 @@ namespace MeshWorker
                                                   // level, but
                                                   // only do this
                                                   // from one side.
-                 if (neighbor < cell) continue;
+                 if (unique_faces_only && (neighbor < cell)) continue;
                  
                                                   // If iterator
                                                   // is active
@@ -250,7 +255,7 @@ namespace MeshWorker
                                     // Loop over all cells
     WorkStream::run(begin, end,
                    std_cxx1x::bind(cell_action<INFOBOX, dim, spacedim, ITERATOR>, _1, _3, _2,
-                                   cell_worker, boundary_worker, face_worker, cells_first),
+                                   cell_worker, boundary_worker, face_worker, cells_first, true),
                    std_cxx1x::bind(internal::assemble<dim,spacedim,ASSEMBLER>, _1, assembler),
                    info, dof_info);
     

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.