]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
ConstraintMatrix can perform distribute_local_to_global also in non-closed form as...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 9 Dec 2012 10:06:32 +0000 (10:06 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 9 Dec 2012 10:06:32 +0000 (10:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@27786 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 938b681f9ea9467a67253ecf7c00900f708ffb53..103433b06882a7763041965919c2fda4bf91e86f 100644 (file)
@@ -1903,6 +1903,15 @@ ConstraintMatrix::set_inhomogeneity (const unsigned int line,
 
 
 
+inline
+unsigned int
+ConstraintMatrix::n_constraints () const
+{
+  return lines.size();
+}
+
+
+
 inline
 bool
 ConstraintMatrix::is_constrained (const unsigned int index) const
@@ -1999,7 +2008,7 @@ void ConstraintMatrix::distribute_local_to_global (
   const double       value,
   VectorType        &global_vector) const
 {
-  Assert (sorted == true, ExcMatrixNotClosed());
+  Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
 
   if (is_constrained(index) == false)
     global_vector(index) += value;
@@ -2023,7 +2032,7 @@ void ConstraintMatrix::distribute_local_to_global (
   ForwardIteratorInd local_indices_begin,
   VectorType        &global_vector) const
 {
-  Assert (sorted == true, ExcMatrixNotClosed());
+  Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
   for ( ; local_vector_begin != local_vector_end;
         ++local_vector_begin, ++local_indices_begin)
     {
@@ -2065,7 +2074,7 @@ void ConstraintMatrix::get_dof_values (const VectorType &global_vector,
                                        ForwardIteratorVec local_vector_begin,
                                        ForwardIteratorVec local_vector_end) const
 {
-  Assert (sorted == true, ExcMatrixNotClosed());
+  Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
   for ( ; local_vector_begin != local_vector_end;
         ++local_vector_begin, ++local_indices_begin)
     {
index d7d0ca75484934fb3e80ffb8f43a359940362071..8d7f1b552a77af9e01e6571dd1fdbd974de96305 100644 (file)
@@ -818,7 +818,7 @@ distribute_local_to_global (const Vector<double>            &local_vector,
   AssertDimension (local_matrix.n(), local_dof_indices.size());
 
   const unsigned int n_local_dofs = local_vector.size();
-  if (lines.size() == 0)
+  if (lines.empty())
     global_vector.add(local_dof_indices, local_vector);
   else
     for (unsigned int i=0; i<n_local_dofs; ++i)
@@ -2312,7 +2312,7 @@ ConstraintMatrix::distribute_local_to_global (
       AssertDimension (local_matrix.m(), local_vector.size());
       AssertDimension (global_matrix.m(), global_vector.size());
     }
-  Assert (sorted == true, ExcMatrixNotClosed());
+  Assert (lines.empty() || sorted == true, ExcMatrixNotClosed());
 
   const unsigned int n_local_dofs = local_dof_indices.size();
   internals::GlobalRowsFromLocal global_rows (n_local_dofs);
index aa0e4f72fa6b909dac681f570ed5452b1159f1cc..550a0a393c23460986d8628aa7b333cbe0c964a1 100644 (file)
@@ -2141,13 +2141,6 @@ ConstraintMatrix::distribute (PETScWrappers::MPI::BlockVector & /*vec*/) const
 
 
 
-unsigned int ConstraintMatrix::n_constraints () const
-{
-  return lines.size();
-}
-
-
-
 bool ConstraintMatrix::is_identity_constrained (const unsigned int index) const
 {
   if (is_constrained(index) == false)

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.