dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

Split pointers for diagonal and off-diagonal parts of MatrixCSR

Open chrisrichardson opened this issue 2 years ago • 6 comments

For better compatibility with 3rd party libraries, it would be better to have the diagonal and off-diagonal blocks of the sparse matrix in MatrixCSR stored separately. The data structures would be the same, just two instead of one, and the storage should not be any more.

chrisrichardson avatar Apr 20 '23 08:04 chrisrichardson

@chrisrichardson has this been completed?

garth-wells avatar Jun 24 '23 09:06 garth-wells

No. I am also not convinced it is always the right solution. Some solvers use a unified format, some split. I have got a working prototype (split format) so maybe we can work on having both available via an option or subclassing.

chrisrichardson avatar Jun 24 '23 10:06 chrisrichardson

https://github.com/FEniCS/dolfinx/tree/chris/matrixcsr-bs-experiment

chrisrichardson avatar Jun 24 '23 10:06 chrisrichardson

Splitting the matrix would make wrapping sparse matrices locally using SciPy more difficult.

garth-wells avatar Jun 30 '23 07:06 garth-wells

I agree. I think we should consider supporting both formats internally.

chrisrichardson avatar Jun 30 '23 08:06 chrisrichardson