<h3>Specific improvements</h3>
<ol>
+<li> New: PETScWrappers::MPI::BlockVector now has a constructor and reinit
+that takes a std::vector<IndexSet> (same interface as in Trilinos).
+<br>
+(Timo Heister, 2013/02/19)
+
<li> New: PETScWrappers::*Matrix::add(other, factor) to
add a scaled other matrix to the current matrix.
<br>
const MPI_Comm &communicator,
const std::vector<unsigned int> &local_elements);
+ /**
+ * Create a BlockVector with parallel_partitioning.size() blocks,
+ * each initialized with the given IndexSet.
+ */
+ explicit BlockVector (const std::vector<IndexSet> ¶llel_partitioning,
+ const MPI_Comm &communicator = MPI_COMM_WORLD);
+
/**
* Destructor. Clears memory
*/
void reinit (const BlockVector &V,
const bool fast=false);
+ /**
+ * Reinitialize the BlockVector using IndexSets. See the constructor
+ * with the same arguments for details.
+ */
+ void reinit (const std::vector<IndexSet> ¶llel_partitioning,
+ const MPI_Comm &communicator);
+
/**
* Return a reference to the MPI
* communicator object in use with
this->components[i] = v.components[i];
}
+ inline
+ BlockVector::BlockVector (const std::vector<IndexSet> ¶llel_partitioning,
+ const MPI_Comm &communicator)
+ {
+ reinit(parallel_partitioning, communicator);
+ }
inline
block(i).reinit(v.block(i), fast);
}
+ inline
+ void
+ BlockVector::reinit (const std::vector<IndexSet> ¶llel_partitioning,
+ const MPI_Comm &communicator)
+ {
+ std::vector<unsigned int> sizes(parallel_partitioning.size());
+ for (unsigned int i=0; i<parallel_partitioning.size(); ++i)
+ sizes[i] = parallel_partitioning[i].size();
+
+ this->block_indices.reinit(sizes);
+ if (this->components.size() != this->n_blocks())
+ this->components.resize(this->n_blocks());
+
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ block(i).reinit(communicator, parallel_partitioning[i]);
+ }
inline