]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check if the global vector in distribute_local_to_global has ghost elements. 16490/head
authorSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Thu, 18 Jan 2024 10:10:27 +0000 (11:10 +0100)
committerSebastian Kinnewig <kinnewig@ifam.uni-hannover.de>
Thu, 18 Jan 2024 10:10:27 +0000 (11:10 +0100)
include/deal.II/lac/affine_constraints.h
include/deal.II/lac/affine_constraints.templates.h

index 8dde2feb57cefa5acf8145e1e9bddf0237bc1800..305a39828cc1fdac92588aa69af2ba8bcf5a2b24 100644 (file)
@@ -2629,6 +2629,7 @@ AffineConstraints<number>::distribute_local_to_global(
   const std::vector<size_type> &local_dof_indices,
   OutVector                    &global_vector) const
 {
+  Assert(global_vector.has_ghost_elements() == false, ExcGhostsPresent());
   Assert(local_vector.size() == local_dof_indices.size(),
          ExcDimensionMismatch(local_vector.size(), local_dof_indices.size()));
   distribute_local_to_global(local_vector.begin(),
index cb51e1acf947f265546ef89f2f958fc00479c400..e027a8d58e968dda6469b0d2d590a2cf64df49c5 100644 (file)
@@ -2531,6 +2531,7 @@ AffineConstraints<number>::distribute_local_to_global(
   AssertDimension(local_vector.size(), local_dof_indices_row.size());
   AssertDimension(local_matrix.m(), local_dof_indices_row.size());
   AssertDimension(local_matrix.n(), local_dof_indices_col.size());
+  Assert(global_vector.has_ghost_elements() == false, ExcGhostsPresent());
 
   // diagonal checks if we have only one index set (if both are equal
   // diagonal should be set to true).
@@ -4210,6 +4211,7 @@ AffineConstraints<number>::distribute_local_to_global(
 
   AssertDimension(local_matrix.n(), local_dof_indices.size());
   AssertDimension(local_matrix.m(), local_dof_indices.size());
+  Assert(global_vector.has_ghost_elements() == false, ExcGhostsPresent());
   Assert(global_matrix.m() == global_matrix.n(), ExcNotQuadratic());
   if (use_vectors == true)
     {
@@ -4367,6 +4369,7 @@ AffineConstraints<number>::distribute_local_to_global(
 
   AssertDimension(local_matrix.n(), local_dof_indices.size());
   AssertDimension(local_matrix.m(), local_dof_indices.size());
+  Assert(global_vector.has_ghost_elements() == false, ExcGhostsPresent());
   Assert(global_matrix.m() == global_matrix.n(), ExcNotQuadratic());
   Assert(global_matrix.n_block_rows() == global_matrix.n_block_cols(),
          ExcNotQuadratic());

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.