]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement 'keep_constrained_entries' part in add_entries_local_to_global for non...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 27 Aug 2010 15:40:07 +0000 (15:40 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 27 Aug 2010 15:40:07 +0000 (15:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@21754 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 4717cfa796628da9b3437fa176c391ebb7ccecf0..f14e65de34fe9a317849344d368650d4d8e73f2d 100644 (file)
@@ -2636,7 +2636,6 @@ add_entries_local_to_global (const std::vector<unsigned int> &row_indices,
   const unsigned int n_local_rows = row_indices.size();
   const unsigned int n_local_cols = col_indices.size();
   bool dof_mask_is_active = false;
-  Assert (keep_constrained_entries == false, ExcNotImplemented());
   if (dof_mask.n_rows() == n_local_rows && dof_mask.n_cols() == n_local_cols)
     dof_mask_is_active = true;
 
@@ -2667,6 +2666,23 @@ add_entries_local_to_global (const std::vector<unsigned int> &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 (unsigned int i=0; i<row_indices.size(); i++)
+       if (is_constrained(row_indices[i]))
+         sparsity_pattern.add_entries (row_indices[i],
+                                       col_indices.begin(),
+                                       col_indices.end(), false);
+      for (unsigned int i=0; i<col_indices.size(); i++)
+       if (is_constrained(col_indices[i]))
+         for (unsigned int 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.