#include <deal.II/base/config.h>
#include <deal.II/base/complex_overloads.h>
+#include <deal.II/base/mpi_stub.h>
#include <deal.II/base/std_cxx20/type_traits.h>
#include <complex>
{
U.all_zero()
} -> std::same_as<bool>;
+
+ {
+ U.get_mpi_communicator()
+ } -> std::same_as<MPI_Comm>;
};
void
update_ghost_values() const;
+ /**
+ * This function returns the MPI communicator of the vector in the
+ * underlying blocks or, if the vector has not been initialized, the empty
+ * MPI_COMM_SELF.
+ */
+ MPI_Comm
+ get_mpi_communicator() const;
+
/**
* Determine an estimate for the memory consumption (in bytes) of this
* object.
+template <typename VectorType>
+MPI_Comm
+BlockVectorBase<VectorType>::get_mpi_communicator() const
+{
+ if (n_blocks() > 0)
+ return block(0).get_mpi_communicator();
+ else
+ return MPI_COMM_SELF;
+}
+
+
+
template <typename VectorType>
BlockVectorBase<VectorType> &
BlockVectorBase<VectorType>::operator=(const value_type s)
*/
void
zero_out_ghost_values() const;
+
+ /**
+ * This function returns the empty object MPI_COMM_SELF that does not signal
+ * any parallel communication model, as this vector is in fact serial with
+ * respect to the message passing interface (MPI). The function exists for
+ * compatibility with the @p parallel vector classes (e.g.,
+ * LinearAlgebra::distributed::Vector class).
+ */
+ MPI_Comm
+ get_mpi_communicator() const;
/** @} */
private:
+template <typename Number>
+inline MPI_Comm
+Vector<Number>::get_mpi_communicator() const
+{
+ return MPI_COMM_SELF;
+}
+
+
template <typename Number>
template <typename Number2>
inline void