*/
std::size_t memory_consumption () const;
+ /**
+ * Return a reference to the MPI
+ * communicator object in use with this
+ * object.
+ */
+ virtual const MPI_Comm &get_mpi_communicator () const;
+
protected:
/**
* A generic vector object in
return operator()(index);
}
+ inline
+ const MPI_Comm &
+ VectorBase::get_mpi_communicator () const
+ {
+ static MPI_Comm comm;
+ PetscObjectGetComm((PetscObject)vector, &comm);
+ return comm;
+ }
#endif // DOXYGEN
}
const PreconditionerBase &preconditioner)
{
int ierr;
+
+ Assert(A.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Matrix need to use the same MPI_Comm."));
+ Assert(x.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Vector need to use the same MPI_Comm."));
+ Assert(b.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Vector need to use the same MPI_Comm."));
+
// first create a solver object if this
// is necessary
if (solver_data.get() == 0)
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