void reinit (const BlockVector &v,
const bool import_data = false);
+ /**
+ * Reinit function. Creates a vector
+ * using the IndexSet local as our
+ * own unknowns, add optional ghost
+ * values ghost.
+ */
+ void reinit (const MPI_Comm &communicator,
+ const IndexSet &local,
+ const IndexSet &ghost=IndexSet(0));
+
/**
* Set all components of the
* vector to the given number @p
Vector (const IndexSet ¶llel_partitioning,
const MPI_Comm &communicator = MPI_COMM_WORLD);
+ Vector (const MPI_Comm &communicator,
+ const IndexSet &local,
+ const IndexSet &ghost=IndexSet(0));
+
/**
* Copy constructor from the
* TrilinosWrappers vector
Vector (const IndexSet &partitioning,
const MPI_Comm &communicator = MPI_COMM_WORLD);
+ /**
+ * This constructor creates a vector
+ * using the IndexSet local as our
+ * own unknowns, add optional ghost
+ * values ghost.
+ */
+ Vector (const MPI_Comm &communicator,
+ const IndexSet &local,
+ const IndexSet &ghost);
+
/**
* This constructor takes a
* (possibly parallel) Trilinos
const bool fast = false,
const bool allow_different_maps = false);
+
/**
* Set all components of the
* vector to the given number @p
*/
void ratio (const VectorBase &a,
const VectorBase &b);
+
+
+ /**
+ * Empty function; added to allow
+ * PETSc and Trilinos Vectors to
+ * be used interchangeably
+ */
+ void update_ghost_values() const;
//@}
std::size_t memory_consumption () const;
//@}
+
/**
* Exception
*/
reinit (v, false, true);
}
+ Vector::Vector (const MPI_Comm &communicator,
+ const IndexSet &local,
+ const IndexSet &ghost)
+ :
+ VectorBase()
+ {
+ IndexSet parallel_partitioning = local;
+ parallel_partitioning.add_indices(ghost);
+ reinit(parallel_partitioning, communicator);
+ }
+
Vector::~Vector ()
}
+ void Vector::reinit(const MPI_Comm &communicator, const IndexSet &local, const IndexSet &ghost)
+ {
+ IndexSet parallel_partitioning = local;
+ parallel_partitioning.add_indices(ghost);
+ reinit(parallel_partitioning, communicator);
+ }
+
Vector &
Vector::operator = (const Vector &v)