void reinit (const BlockVector<Number2> &V,
const bool fast=false);
+ /**
+ * This function copies the data that has accumulated in the data buffer
+ * for ghost indices to the owning processor. For the meaning of the
+ * argument @p operation, see the entry on @ref GlossCompress
+ * "Compressing distributed vectors and matrices" in the glossary.
+ *
+ * There are two variants for this function. If called with argument @p
+ * VectorOperation::add adds all the data accumulated in ghost elements
+ * to the respective elements on the owning processor and clears the
+ * ghost array afterwards. If called with argument @p
+ * VectorOperation::insert, a set operation is performed. Since setting
+ * elements in a vector with ghost elements is ambiguous (as one can set
+ * both the element on the ghost site as well as the owning site), this
+ * operation makes the assumption that all data is set correctly on the
+ * owning processor. Upon call of compress(VectorOperation::insert), all
+ * ghost entries are therefore simply zeroed out (using
+ * zero_ghost_values()). In debug mode, a check is performed that makes
+ * sure that the data set is actually consistent between processors,
+ * i.e., whenever a non-zero ghost element is found, it is compared to
+ * the value on the owning processor and an exception is thrown if these
+ * elements do not agree.
+ *
+ */
+ void compress (::dealii::VectorOperation::values operation);
+
+ /**
+ * Fills the data field for ghost indices with the values stored in the
+ * respective positions of the owning processor. This function is needed
+ * before reading from ghosts. The function is @p const even though
+ * ghost data is changed. This is needed to allow functions with a @p
+ * const vector to perform the data exchange without creating
+ * temporaries.
+ */
+ void update_ghost_values () const;
+
/**
* Return whether the vector contains only elements with value
* zero. This function is mainly for internal consistency checks and
}
+
+ template <typename Number>
+ inline
+ void
+ BlockVector<Number>::compress (::dealii::VectorOperation::values operation)
+ {
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ this->block(block).compress(operation);
+ }
+
+
+
+ template <typename Number>
+ inline
+ void
+ BlockVector<Number>::update_ghost_values () const
+ {
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ this->block(block).update_ghost_values();
+ }
+
+
+
template <typename Number>
inline
bool