gridap / Gridap.jl

Grid-based approximation of partial differential equations in Julia
MIT License
665 stars 94 forks source link

Matrix assembly rework #1000

Open JordiManyer opened 3 months ago

JordiManyer commented 3 months ago

This relates to what we discussed. @amartinhuertas @fverdugo

A little context:

The current implementation of the sparse matrix assembly is (loosely) done as follows:

We would like to investigate the option of working with COO-type structures. These are more expensive memory-wise, but can save quite a lot of time when re-assembling the matrix.

I've added a MWE on a possible implementation of the latter. Also, here are some results from the benchmarks at the end:

oriolcg commented 3 weeks ago

Hi @JordiManyer , what is the status of this PR? Have you tried the new implementation for Nonlinear/transient problems?

JordiManyer commented 2 weeks ago

@oriolcg I don't have time atm, I'll try to push this further after the summer. I am not focusing complicated problems yet, but obviously anything that assembles repeatedly (like NL or transient) would benefit from this. I am worried about the memory footprint though... I think I can make most of it lazy so that we don't have to keep any Float values in memory, but it will take take some time to work it out.