]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Remove unnecessary code.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Mar 2009 16:44:47 +0000 (16:44 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Mar 2009 16:44:47 +0000 (16:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@18519 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/constraint_matrix.h
deal.II/lac/include/lac/constraint_matrix.templates.h

index 5a6554064cecca20c019af89cd19be4a08fd3e71..9e3c9cb6a5076bb10e04afe7e59978a9e8c339ec 100644 (file)
@@ -1426,27 +1426,6 @@ class ConstraintMatrix : public Subscriptor
                                      * time.
                                      */
     mutable Threads::ThreadMutex mutex;
-
-                                    /**
-                                     * A temporary array for the function
-                                     * <tt>distribute_local_to_global()</tt>
-                                     * that collects column indices for
-                                     * values that should be written into
-                                     * the same row (so that we can write
-                                     * the values collectively into the
-                                     * sparse matrix, which is faster).
-                                     */
-    mutable std::vector<unsigned int> column_indices;
-
-                                    /**
-                                     * A temporary array for the function
-                                     * <tt>distribute_local_to_global()</tt>
-                                     * that collects values that should be
-                                     * written into the same row (so that
-                                     * we can write them collectively into
-                                     * the sparse matrix, which is faster).
-                                     */
-    mutable std::vector<double> column_values;
 };
 
 
index a9b4d1316ff1f46ac28bb50ddfef175ef1955afa..faa035d7127b4b3d88e8747017dfde5e22c3c6c3 100644 (file)
@@ -738,37 +738,31 @@ distribute_local_to_global (const Vector<double>            &local_vector,
                                    // have a special case where there are no
                                    // constraints at all, since then we can be
                                    // a lot faster
-  if (lines.size() == 0)
-    {
-      for (unsigned int i=0; i<n_local_dofs; ++i)
-        global_vector(local_dof_indices[i]) += local_vector(i);
-    }
-  else
+  Threads::ThreadMutex::ScopedLock lock(mutex);
+  for (unsigned int i=0; i<n_local_dofs; ++i)
     {
-      for (unsigned int i=0; i<n_local_dofs; ++i)
-        {
                                   // let's see if we can use the bool
                                   // vector that tells about whether a
                                   // certain constraint exists.
-         if (constraint_line_exists.size() <= local_dof_indices[i])
-           {
-             global_vector(local_dof_indices[i]) += local_vector(i);
-             continue;
-           }
-         if (constraint_line_exists[local_dof_indices[i]] == false)
-           {
-             global_vector(local_dof_indices[i]) += local_vector(i);
-             continue;
-           }
+      if (constraint_line_exists.size() <= local_dof_indices[i])
+       {
+         global_vector(local_dof_indices[i]) += local_vector(i);
+         continue;
+       }
+      if (constraint_line_exists[local_dof_indices[i]] == false)
+       {
+         global_vector(local_dof_indices[i]) += local_vector(i);
+         continue;
+       }
                                            // first figure out whether this
                                            // dof is constrained
-          ConstraintLine index_comparison;
-          index_comparison.line = local_dof_indices[i];
+      ConstraintLine index_comparison;
+      index_comparison.line = local_dof_indices[i];
 
-          const std::vector<ConstraintLine>::const_iterator
-            position = std::lower_bound (lines.begin(),
-                                         lines.end(),
-                                         index_comparison);
+      const std::vector<ConstraintLine>::const_iterator
+       position = std::lower_bound (lines.begin(),
+                                    lines.end(),
+                                    index_comparison);
 
                                            // if the line is not
                                            // constrained, then simply
@@ -799,12 +793,11 @@ distribute_local_to_global (const Vector<double>            &local_vector,
                                           // the nodes to which it is
                                           // constrained are also
                                           // fixed
-         Assert (position->line == local_dof_indices[i],
-                 ExcInternalError());
-         for (unsigned int j=0; j<position->entries.size(); ++j)
-           global_vector(position->entries[j].first)
-             += local_vector(i) * position->entries[j].second;
-        }
+      Assert (position->line == local_dof_indices[i],
+             ExcInternalError());
+      for (unsigned int j=0; j<position->entries.size(); ++j)
+       global_vector(position->entries[j].first)
+         += local_vector(i) * position->entries[j].second;
     }
 }
 
@@ -1535,8 +1528,9 @@ distribute_local_to_global (const FullMatrix<double>        &local_matrix,
                                   // ints (for global columns) and internal
                                   // data (containing local columns +
                                   // possible jumps from
-                                  // constraints). Choosing an STL map
-                                  // would be much more expensive here!
+                                  // constraints). Choosing an STL map or
+                                  // anything else I know of would be much
+                                  // more expensive here!
   typedef std::vector<std::pair<unsigned int,internals::distributing> > row_data;
   row_data my_indices;
   my_indices.reserve(n_local_dofs);

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.