<h3>Specific improvements</h3>
<ol>
+ <li>
+ add has_ghost_elements() for PETScWrappers::MPI::BlockVector and
+ TrilinosWrappers::MPI::BlockVector.
+ <br>
+ (Timo Heister, 2013/08/01)
+ </li>
+
<li>
SparsityTools::distribute_sparsity_pattern did not work correctly for
block systems, this has been fixed (function has a different signature).
*/
void reinit (const unsigned int num_blocks);
+ /**
+ * Returns if this vector is a ghosted vector (and thus read-only).
+ */
+ bool has_ghost_elements() const;
+
/**
* Return a reference to the MPI
* communicator object in use with
return block(0).get_mpi_communicator();
}
+ inline
+ bool
+ BlockVector::has_ghost_elements() const
+ {
+ bool ghosted=block(0).has_ghost_elements();
+#ifdef DEBUG
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ Assert(block(i).has_ghost_elements()==ghosted, ExcInternalError());
+#endif
+ return ghosted;
+ }
inline
explicit BlockVector (const std::vector<IndexSet> ¶llel_partitioning,
const MPI_Comm &communicator = MPI_COMM_WORLD);
+ /**
+ * Creates a BlockVector with ghost elements. @p ghost_values
+ * may contain any elements in @p parallel_partitioning, they will
+ * be ignored.
+ */
+ BlockVector (const std::vector<IndexSet> ¶llel_partitioning,
+ const std::vector<IndexSet> &ghost_values,
+ const MPI_Comm &communicator);
+
+
/**
* Copy-Constructor. Set all the
* properties of the parallel vector
*/
bool is_compressed () const;
+ /**
+ * Returns if this Vector contains ghost elements.
+ */
+ bool has_ghost_elements() const;
+
/**
* Swap the contents of this
* vector and the other vector
}
+ inline
+ BlockVector::BlockVector (const std::vector<IndexSet> ¶llel_partitioning,
+ const std::vector<IndexSet> &ghost_values,
+ const MPI_Comm &communicator)
+ {
+ reinit(parallel_partitioning, ghost_values, communicator);
+ }
+
inline
BlockVector::BlockVector (const size_type num_blocks)
}
+ inline
+ bool
+ BlockVector::has_ghost_elements() const
+ {
+ bool ghosted=block(0).has_ghost_elements();
+#ifdef DEBUG
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ Assert(block(i).has_ghost_elements()==ghosted, ExcInternalError());
+#endif
+ return ghosted;
+ }
+
inline
void
BlockVector::swap (BlockVector &v)