*/
void reinit (const MPI_Comm &communicator,
const IndexSet &local,
- const IndexSet &ghost = IndexSet(0));
+ const IndexSet &ghost);
+ /**
+ * Reinit as a vector without ghost elements. See
+ * constructor with same signature
+ * for more detais.
+ */
+ void reinit (const MPI_Comm &communicator,
+ const IndexSet &local);
/**
* Return a reference to the MPI
IndexSet ghost_set = ghost;
ghost_set.subtract_set(local);
- //possible optmization: figure out if
- //there are ghost indices (collective
- //operation!) and then create a
- //non-ghosted vector.
-// Vector::create_vector (local.size(), local.n_elements());
-
Vector::create_vector(local.size(), local.n_elements(), ghost_set);
}
create_vector(local.size(), local.n_elements(), ghost_set);
}
+ void
+ Vector::reinit (const MPI_Comm &comm,
+ const IndexSet &local)
+ {
+ communicator = comm;
+
+ Assert(local.is_contiguous(), ExcNotImplemented());
+ create_vector(local.size(), local.n_elements());
+ }
Vector &
const unsigned int local_size)
{
Assert (local_size <= n, ExcIndexRange (local_size, 0, n));
+ ghosted = false;
const int ierr
= VecCreateMPI (communicator, local_size, PETSC_DETERMINE,