]> https://gitweb.dealii.org/ - dealii.git/commitdiff
handle artificial cells in DofInfoBox
authorTimo Heister <timo.heister@gmail.com>
Fri, 3 Jan 2014 13:30:18 +0000 (13:30 +0000)
committerTimo Heister <timo.heister@gmail.com>
Fri, 3 Jan 2014 13:30:18 +0000 (13:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@32148 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/meshworker/dof_info.h
deal.II/include/deal.II/meshworker/loop.h

index 402f7822ea1751240586290ddb213f47c8de1c1d..633da8c711d1e84e8b6b54b9b9ef45e3c67ac927 100644 (file)
@@ -280,6 +280,12 @@ namespace MeshWorker
      * face is available.
      */
     bool exterior_face_available[GeometryInfo<dim>::faces_per_cell];
+
+    /**
+     * A flag to specify if the current object has been set to a valid
+     * cell.
+     */
+    bool cell_valid;
   };
 
 //----------------------------------------------------------------------//
@@ -417,7 +423,7 @@ namespace MeshWorker
   inline
   DoFInfoBox<dim, DOFINFO>::DoFInfoBox(const DOFINFO &seed)
     :
-    cell(seed)
+    cell(seed), cell_valid(true)
   {
     for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
       {
@@ -433,7 +439,7 @@ namespace MeshWorker
   inline
   DoFInfoBox<dim, DOFINFO>::DoFInfoBox(const DoFInfoBox<dim, DOFINFO> &other)
     :
-    cell(other.cell)
+    cell(other.cell), cell_valid(other.cell_valid)
   {
     for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
       {
@@ -449,6 +455,7 @@ namespace MeshWorker
   inline void
   DoFInfoBox<dim, DOFINFO>::reset ()
   {
+      cell_valid = false;
     for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
       {
         interior_face_available[i] = false;
@@ -462,6 +469,9 @@ namespace MeshWorker
   inline void
   DoFInfoBox<dim, DOFINFO>::assemble (ASSEMBLER &assembler) const
   {
+    if (!cell_valid)
+      return;
+
     assembler.assemble(cell);
     for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
       {
index 255298ab36532d0e1914065b37dd9a56f9781c15..a8d63b9a501fb26d275d0180ba338fcdfc0d3ac9 100644 (file)
@@ -251,21 +251,20 @@ namespace MeshWorker
                                ? cell->level_subdomain_id()
                                : cell->subdomain_id();
      
-     if ((!ignore_subdomain) && (csid == numbers::artificial_subdomain_id))
-       return;
-     
      const bool own_cell = ignore_subdomain || (csid == cell->get_triangulation().locally_owned_subdomain());
 
      dof_info.reset();
+
+     if ((!ignore_subdomain) && (csid == numbers::artificial_subdomain_id))
+       return;
+
      dof_info.cell.reinit(cell);
+     dof_info.cell_valid = true;
      
     const bool integrate_cell          = (cell_worker != 0);
     const bool integrate_boundary      = (boundary_worker != 0);
     const bool integrate_interior_face = (face_worker != 0);
 
-    dof_info.reset();
-
-    dof_info.cell.reinit(cell);
     if (integrate_cell)
       info.cell.reinit(dof_info.cell);
     // Execute this, if cells

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.