bool
has_ghost_elements() const;
+ /**
+ * This method copies the data in the locally owned range from another
+ * distributed vector @p src into the calling vector. As opposed to
+ * operator= that also includes ghost entries, this operation ignores
+ * the ghost range. The only prerequisite is that the local range on the
+ * calling vector and the given vector @p src are the same on all
+ * processors. It is explicitly allowed that the two vectors have
+ * different ghost elements that might or might not be related to each
+ * other.
+ *
+ * Since no data exchange is performed, make sure that neither @p src
+ * nor the calling vector have pending communications in order to obtain
+ * correct results.
+ */
+ template <typename Number2>
+ void
+ copy_locally_owned_data_from(const BlockVector<Number2> &src);
+
/**
* This is a collective add operation that adds a whole set of values
* stored in @p values to the vector components specified by @p indices.
+ template <typename Number>
+ template <typename Number2>
+ void
+ BlockVector<Number>::copy_locally_owned_data_from(
+ const BlockVector<Number2> &v)
+ {
+ AssertDimension(this->n_blocks(), v.n_blocks());
+
+ for (unsigned int b = 0; b < this->n_blocks(); ++b)
+ this->block(b).copy_locally_owned_data_from(v.block(b));
+ }
+
+
+
#ifdef DEAL_II_WITH_PETSC
namespace petsc_helpers
template void
BlockVector<S1>::reinit<S2>(const BlockVector<S2> &, const bool);
template void
+ BlockVector<S1>::copy_locally_owned_data_from<S2>(
+ const BlockVector<S2> &);
+ template void
BlockVector<S1>::add<S2>(const std::vector<size_type> &,
const ::dealii::Vector<S2> &);
\}
template void
BlockVector<S1>::reinit<S2>(const BlockVector<S2> &, const bool);
template void
+ BlockVector<S1>::copy_locally_owned_data_from<S2>(
+ const BlockVector<S2> &);
+ template void
BlockVector<S1>::add<S2>(const std::vector<size_type> &,
const ::dealii::Vector<S2> &);
\}