*/
BlockDynamicSparsityPattern (const std::vector<IndexSet> &partitioning);
+ /**
+ * Initialize the pattern with two BlockIndices for the block structures of
+ * matrix rows and columns.
+ */
+ BlockDynamicSparsityPattern (const BlockIndices &row_indices,
+ const BlockIndices &col_indices);
+
+
/**
* Resize the pattern to a tensor product of matrices with dimensions
* defined by the arguments.
*/
void reinit(const std::vector<IndexSet> &partitioning);
+ /**
+ * Resize the matrix to a tensor product of matrices with dimensions defined
+ * by the arguments. The two BlockIndices objects must be initialized and
+ * the sparsity pattern will have the same block structure afterwards.
+ */
+ void reinit (const BlockIndices &row_indices, const BlockIndices &col_indices);
+
/**
* Access to column number field. Return the column number of the @p index
* th entry in row @p row.
}
+BlockDynamicSparsityPattern::
+BlockDynamicSparsityPattern (const BlockIndices &row_indices,
+ const BlockIndices &col_indices)
+{
+ reinit(row_indices, col_indices);
+}
+
void
BlockDynamicSparsityPattern::reinit (
this->collect_sizes();
}
+void
+BlockDynamicSparsityPattern::reinit (
+ const BlockIndices &row_indices,
+ const BlockIndices &col_indices)
+{
+ BlockSparsityPatternBase<DynamicSparsityPattern>::reinit(row_indices.size(),
+ col_indices.size());
+ for (size_type i=0; i<row_indices.size(); ++i)
+ for (size_type j=0; j<col_indices.size(); ++j)
+ this->block(i,j).reinit(row_indices.block_size(i),
+ col_indices.block_size(j));
+ this->collect_sizes();
+}
+
#ifdef DEAL_II_WITH_TRILINOS
namespace TrilinosWrappers