How to create sparse pattern for PBC function space

Hello, this is a continuous question of this post:

I’m wondering that is it possible to create the sparse pattern for a function space using the current functions in DOLFINX, I can see that the MPC library has seperate functions for the sparse pattern.

Or, can I do something when I assemble the matrix, such that I can break the sparse pattern to get the mass matrix, assuming my dofmap is correct. (Sorry I’m not familer with PETsc stuff, so this question maybe a little bit naive).

Thanks very much!

See dolfinx/cpp/dolfinx/fem/utils.h at main · FEniCS/dolfinx · GitHub for the function that creates the sparsity pattern.

In principle, you can customize it, for instance multiphenicsx/multiphenicsx/cpp/multiphenicsx/fem/utils.h at main · multiphenics/multiphenicsx · GitHub is how customized it in multiphenicsx (note the additional arguments in the signature. The code itself is vastly a copy and paste off the original implementation, so you may want to make a diff to understand where the differences are).

If you are not familiar with petsc, the task will probably be hard, and should not be taken lightly.

1 Like