Skip to content
Snippets Groups Projects
Commit 481ad413 authored by Oliver Sander's avatar Oliver Sander
Browse files

Be smarter about what parts of the coarse grid matrices to reassemble

In the truncated monotone multigrid method, the coarse grid matrices change from
one iteration to the next.  Therefore, they need to be reassembled before every
iteration.  That is pretty expensive, therefore the MonotoneMG class and
corresponding transfer operators have always included a mechanism to only reassemble
parts of the coarse grid matrices.  That saves quite a bit of time.

Previously, a matrix entry would only be recomputed if the hasObstacle field
was set for its row or column.  That works nicely for contact problems,
where the hasObstacle field has only very few bits set.

However, for problems with many obstacles the coarse matrix reassembly becomes
expensive again.  Therefore, the code is now a bit smarter about what to reassemble.
Matrix entries really only need reassemble if the corresponding dofs changed
from non-critical to critical (or vice versa), or if the next-finer matrix
changed in the corresponding entries.

For my Cosserat shell problem, which has 6x6 blocks and all hasObstacle entries
set, I measure a speedup of about 30% for each MMG iteration.

Note that after this patch, code should yield precisely the same output as before.
If you get different results compare to before, then that's a bug.
parent dcfe5a2f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment