]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restrict work on vertices to those that are actually used.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 3 Jul 2017 03:46:49 +0000 (21:46 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 6 Jul 2017 12:56:40 +0000 (06:56 -0600)
source/hp/dof_handler.cc

index ff56aeff390f7d8d3039ed35186e7fdcf547b111..c8f7031e5e50c03886ca3a7352cfd50e0287761f 100644 (file)
@@ -1924,91 +1924,92 @@ namespace hp
     // work on
     for (unsigned int vertex_index=0; vertex_index<get_triangulation().n_vertices();
          ++vertex_index)
-      {
-        const unsigned int n_active_fe_indices
-          = dealii::internal::DoFAccessor::Implementation::
-            n_active_vertex_fe_indices (*this, vertex_index);
-        if (n_active_fe_indices > 1)
-          {
-            const unsigned int
-            first_fe_index
-              = dealii::internal::DoFAccessor::Implementation::
-                nth_active_vertex_fe_index (*this, vertex_index, 0);
-
-            // loop over all the
-            // other FEs with which
-            // we want to identify
-            // the DoF indices of
-            // the first FE of
-            for (unsigned int f=1; f<n_active_fe_indices; ++f)
-              {
-                const unsigned int
-                other_fe_index
-                  = dealii::internal::DoFAccessor::Implementation::
-                    nth_active_vertex_fe_index (*this, vertex_index, f);
-
-                // make sure the
-                // entry in the
-                // equivalence
-                // table exists
-                dealii::internal::hp::ensure_existence_of_dof_identities<0>
-                (get_fe()[first_fe_index],
-                 get_fe()[other_fe_index],
-                 vertex_dof_identities[first_fe_index][other_fe_index]);
-
-                // then loop
-                // through the
-                // identities we
-                // have. first get
-                // the global
-                // numbers of the
-                // dofs we want to
-                // identify and
-                // make sure they
-                // are not yet
-                // constrained to
-                // anything else,
-                // except for to
-                // each other. use
-                // the rule that we
-                // will always
-                // constrain the
-                // dof with the
-                // higher fe
-                // index to the
-                // one with the
-                // lower, to avoid
-                // circular
-                // reasoning.
-                dealii::internal::hp::DoFIdentities &identities
-                  = *vertex_dof_identities[first_fe_index][other_fe_index];
-                for (unsigned int i=0; i<identities.size(); ++i)
-                  {
-                    const types::global_dof_index lower_dof_index
-                      = dealii::internal::DoFAccessor::Implementation::
-                        get_vertex_dof_index (*this,
-                                              vertex_index,
-                                              first_fe_index,
-                                              identities[i].first);
-                    const types::global_dof_index higher_dof_index
-                      = dealii::internal::DoFAccessor::Implementation::
-                        get_vertex_dof_index (*this,
-                                              vertex_index,
-                                              other_fe_index,
-                                              identities[i].second);
-
-                    Assert ((new_dof_indices[higher_dof_index] ==
-                             numbers::invalid_dof_index)
-                            ||
-                            (new_dof_indices[higher_dof_index] ==
-                             lower_dof_index),
-                            ExcInternalError());
-
-                    new_dof_indices[higher_dof_index] = lower_dof_index;
-                  }
-              }
-          }
-      }
+      if (get_triangulation().get_used_vertices()[vertex_index] == true)
+        {
+          const unsigned int n_active_fe_indices
+            = dealii::internal::DoFAccessor::Implementation::
+              n_active_vertex_fe_indices (*this, vertex_index);
+          if (n_active_fe_indices > 1)
+            {
+              const unsigned int
+              first_fe_index
+                = dealii::internal::DoFAccessor::Implementation::
+                  nth_active_vertex_fe_index (*this, vertex_index, 0);
+
+              // loop over all the
+              // other FEs with which
+              // we want to identify
+              // the DoF indices of
+              // the first FE of
+              for (unsigned int f=1; f<n_active_fe_indices; ++f)
+                {
+                  const unsigned int
+                  other_fe_index
+                    = dealii::internal::DoFAccessor::Implementation::
+                      nth_active_vertex_fe_index (*this, vertex_index, f);
+
+                  // make sure the
+                  // entry in the
+                  // equivalence
+                  // table exists
+                  dealii::internal::hp::ensure_existence_of_dof_identities<0>
+                  (get_fe()[first_fe_index],
+                   get_fe()[other_fe_index],
+                   vertex_dof_identities[first_fe_index][other_fe_index]);
+
+                  // then loop
+                  // through the
+                  // identities we
+                  // have. first get
+                  // the global
+                  // numbers of the
+                  // dofs we want to
+                  // identify and
+                  // make sure they
+                  // are not yet
+                  // constrained to
+                  // anything else,
+                  // except for to
+                  // each other. use
+                  // the rule that we
+                  // will always
+                  // constrain the
+                  // dof with the
+                  // higher fe
+                  // index to the
+                  // one with the
+                  // lower, to avoid
+                  // circular
+                  // reasoning.
+                  dealii::internal::hp::DoFIdentities &identities
+                    = *vertex_dof_identities[first_fe_index][other_fe_index];
+                  for (unsigned int i=0; i<identities.size(); ++i)
+                    {
+                      const types::global_dof_index lower_dof_index
+                        = dealii::internal::DoFAccessor::Implementation::
+                          get_vertex_dof_index (*this,
+                                                vertex_index,
+                                                first_fe_index,
+                                                identities[i].first);
+                      const types::global_dof_index higher_dof_index
+                        = dealii::internal::DoFAccessor::Implementation::
+                          get_vertex_dof_index (*this,
+                                                vertex_index,
+                                                other_fe_index,
+                                                identities[i].second);
+
+                      Assert ((new_dof_indices[higher_dof_index] ==
+                               numbers::invalid_dof_index)
+                              ||
+                              (new_dof_indices[higher_dof_index] ==
+                               lower_dof_index),
+                              ExcInternalError());
+
+                      new_dof_indices[higher_dof_index] = lower_dof_index;
+                    }
+                }
+            }
+        }
   }
 
 

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.