]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Need to keep constrained entries also when giving both row and column indices if...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 26 Jun 2014 12:05:54 +0000 (12:05 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 26 Jun 2014 12:05:54 +0000 (12:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@33087 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 2cf08a4f3d6ae53d3ae9336dad237707ad31edc4..a1a97f6a953b4100e6e9f479cd1b6e88832fcf69 100644 (file)
@@ -2869,6 +2869,20 @@ add_entries_local_to_global (const std::vector<size_type> &row_indices,
   if (dof_mask.n_rows() == n_local_rows && dof_mask.n_cols() == n_local_cols)
     dof_mask_is_active = true;
 
+  // if constrained entries should be kept, need to add rows and columns of
+  // those to the sparsity pattern
+  if (keep_constrained_entries == true)
+    {
+      for (size_type i=0; i<row_indices.size(); i++)
+        if (is_constrained(row_indices[i]))
+          for (size_type j=0; j<col_indices.size(); j++)
+            sparsity_pattern.add (row_indices[i], col_indices[j]);
+      for (size_type i=0; i<col_indices.size(); i++)
+        if (is_constrained(col_indices[i]))
+          for (size_type j=0; j<row_indices.size(); j++)
+            sparsity_pattern.add (row_indices[j], col_indices[i]);
+    }
+
   // if the dof mask is not active, all we have to do is to add some indices
   // in a matrix format. To do this, we first create an array of all the
   // indices that are to be added. these indices are the local dof indices
@@ -2891,20 +2905,6 @@ add_entries_local_to_global (const std::vector<size_type> &row_indices,
       return;
     }
 
-  // if constrained entries should be kept, need to add rows and columns of
-  // those to the sparsity pattern
-  if (keep_constrained_entries == true)
-    {
-      for (size_type i=0; i<row_indices.size(); i++)
-        if (is_constrained(row_indices[i]))
-          for (size_type j=0; j<col_indices.size(); j++)
-            sparsity_pattern.add (row_indices[i], col_indices[j]);
-      for (size_type i=0; i<col_indices.size(); i++)
-        if (is_constrained(col_indices[i]))
-          for (size_type j=0; j<row_indices.size(); j++)
-            sparsity_pattern.add (row_indices[j], col_indices[i]);
-    }
-
 
   // TODO: implement this
   Assert (false, ExcNotImplemented());

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.