UMFPACK: Use generic flatMatrixForEach routines for arbitrary blocked matrices
My motivation of this MR is to use UMFPACK with MultiTypeBlockMatrix.
This is already possible for symmetric matrices in the class Cholmod.
Here I propose a similar rewriting of the UMFPACK class.
Instead of calling the BCCSMatrixInitializer, we directly parse the matrix into
an UMFPACK compatible form using flatMatrixForEach methods.
This allows us to use almost every blocked matrix structure, such as MultiTypeBlockMatrix.
Moreover, the 'setMatrix' method is extended by a second bitVector argument to handle exclusion of
indices. The old 'setSubMatrix' method is kept. The new interface is inspired by the neighbored Cholmod class.
Things to discuss:
All of the magic happens directly inUMFPACKright now. Should this be exported into theBCCSMatrix/BCCSMatrixInitializerclass?On the other hand: the routines are hard-wired toUMFPACKwith ignore bits. So we should keep them here.- I introduce a new interface with bit-wise "ignore" DOFs. This is inspired from the
dune-solversmodule. - The "old"
setSubMatrixmethod does not fit into the current context: It handles only top-level indices and cannot be used for nested block matrices. Should be keep it? I am no sure how important this method is. One application can be found inDune::Solvers::UMFPackSolver, but a subsequent MR in this module will switch to a bitvector. - Deducing the
domain_typeandrange_typedirectly form theMatrixtype causes problems if the ignore field is present: I want flexibility in the ignored dofs, i.e., disable single bits of a block component. This is easily possible since we store a compressed scalar matrix in theUMFPACKMatrix. However, theapplymethod assumes the arguments to be codensed to the active components. This is in general not compatible with the type of the vectors. InCholmodthis a solved by dropping theMatrixtemplate type and fixing only theVectortype. The matrix type can be arbitrary, since everything is stored in a scalar matrix in the end.
Edited by Patrick Jaap