]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Neighborship information is unreliable in the codim-1 case for 1d
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Dec 2010 00:26:45 +0000 (00:26 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Dec 2010 00:26:45 +0000 (00:26 +0000)
meshes. Avoid using it.

git-svn-id: https://svn.dealii.org/trunk@22921 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_handler_policy.cc

index 5e56150a946cff21f5fcd7b6cd8d937341f1545b..8f2e46db9a2fd6403a108676440e34baa44f8496 100644 (file)
@@ -65,43 +65,26 @@ namespace internal
            {
 
                                               // distribute dofs of vertices
-             for (unsigned int v=0; v<GeometryInfo<1>::vertices_per_cell; ++v)
-               {
-                 typename DoFHandler<1,spacedim>::cell_iterator
-                   neighbor = cell->neighbor(v);
-
-                 if (neighbor.state() == IteratorState::valid)
-                   {
-                                                      // find true neighbor; may be its
-                                                      // a child of @p{neighbor}
-                     while (neighbor->has_children())
-                       neighbor = neighbor->child(v==0 ? 1 : 0);
-
-                                                      // has neighbor already been processed?
-                     if (neighbor->user_flag_set())
-                                                        // copy dofs
+             if (dof_handler.get_fe().dofs_per_vertex > 0)
+               for (unsigned int v=0; v<GeometryInfo<1>::vertices_per_cell; ++v)
+                 {
+                   if (cell->vertex_dof_index (v,0) ==
+                       DoFHandler<1,spacedim>::invalid_dof_index)
+                     for (unsigned int d=0;
+                          d<dof_handler.get_fe().dofs_per_vertex; ++d)
                        {
-                         if (v==0)
-                           for (unsigned int d=0;
-                                d<dof_handler.get_fe().dofs_per_vertex; ++d)
-                             cell->set_vertex_dof_index (0, d,
-                                                         neighbor->vertex_dof_index (1, d));
-                         else
-                           for (unsigned int d=0;
-                                d<dof_handler.get_fe().dofs_per_vertex; ++d)
-                             cell->set_vertex_dof_index (1, d,
-                                                         neighbor->vertex_dof_index (0, d));
-
-                                                          // next neighbor
-                         continue;
+                         Assert ((cell->vertex_dof_index (v,d) ==
+                                  DoFHandler<1,spacedim>::invalid_dof_index),
+                                 ExcInternalError());
+                         cell->set_vertex_dof_index (v, d, next_free_dof++);
                        }
-                   }
-
-                                                  // otherwise: create dofs newly
-                 for (unsigned int d=0;
-                      d<dof_handler.get_fe().dofs_per_vertex; ++d)
-                   cell->set_vertex_dof_index (v, d, next_free_dof++);
-               }
+                   else
+                     for (unsigned int d=0;
+                          d<dof_handler.get_fe().dofs_per_vertex; ++d)
+                       Assert ((cell->vertex_dof_index (v,d) !=
+                                DoFHandler<1,spacedim>::invalid_dof_index),
+                               ExcInternalError());
+                 }
 
                                               // dofs of line
              for (unsigned int d=0;
@@ -1558,7 +1541,7 @@ namespace internal
                               &number_cache
                               .n_locally_owned_dofs_per_processor[n_cpus],
                               0 );
-         
+
          tr->load_user_flags(user_flags);
        }
 #endif

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.