Draft: Add support for partial matrix patterns to ISTLMatrixBackend and global assembler
Compare changes
This adds support for assembling into matrices with 'partial' pattern, i.e. matrices, whose pattern do not contain entries for all pairs of basis functions that share an element. To this end it introduces the following:
ISTLMatrixBackend::addToEntry(row,col,value)
.matrixBackend(row,col) += value
, the new
matrixBackend.addToEntry(row,col,value)
can ignore
nonexisting entries to support e.g. DiagonalMatrix
.backend.addToEntry(row, col, value)
instead of backend(row, col) += value
in global assembler.DiagonalMatrix
and ScaledIdentityMatrix
by assembling a mass matrix.This is currently marked WIP, because:
operator()(row, col)
, operator()(row, col) const
,
and addToEntry(row,col,value)
should be documented carefully.An extension to at least technically allow (semi) optimal efficiency would be to let the backend fully handle the distribution of the local matrix. Then one would use something like backend.accumulateEntries(rowIndices, colIndices, localMatrix)
in the global assembler. The default implementation could do what is proposed in the present MR. But one could then provide a custom backend that only touches the needed entries. However, this custom backend would not just be a specialization for the matrix type but also rely on some knowledge of the used index scheme.