FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
742 stars 178 forks source link

Extend `to_dense` for parallel use cases #3354

Closed schnellerhase closed 3 weeks ago

schnellerhase commented 1 month ago

The (debug) functionality to_dense of the CSR matrix is extended to support the usage in parallel scenarios.

Before it returned the local-local block of the matrix (which in sequential is the whole matrix), i.e. the interaction between local rows and local cols.

In parallel runs, this drops quite a lot of information, especially we loose all interactions across processes. This is now changed, to to_dense returning the full/global dense rows that are owned by the process. This means the previous behavior is still reproducible by filtering for the columns of choice, but if needed the full parallel block is now available in a dense format.

This will be needed to allow for a PR regarding the transfer operators of a multigrid implementation - see here for an example of this use case.

schnellerhase commented 1 month ago

Need to include this in another PR, so I'll squash