On 3/9/20 8:26 AM, Michał Wichrowski wrote:
I've got matrix-free multigrid solver for Stokes problem. The main
bottleneck is solution of coarse problem, so I tried to assemble the
regular sparse matrix and use direct solver. Since the coarse problem is
(relatively) small, I used vmults by unit vector to obtain columns of
the matrix.
This is unrelated to your original question, but worth mentioning
anyway: Conceptually, you are multiplying a unit vector by a sparse
matrix, and what you should get is a vector with nonzero entries in only
those rows for which the matrix has a nonzero entry in the column
corresponding to the unit vector.
This is inefficient, because you will have to do N such matrix-vector
products. But if you know which entries of the matrix are non-zero
(which you do, because you know which DoFs couple with each other), then
you can multiply with a sum of unit vectors, get an output vector, and
you will know which entries of the output vector correspond to the
product with each of these unit vectors. You should be able to get the
number of matrix-vector products down from N to N/100 or N/1000 for
sufficiently large problems -- i.e., *much much faster*.
(In fact, I think that we should at one point add a function that takes
an operator and that computes a matrix representation. If we would also
give that function a SparsityPattern, it could do the algorithm outlined
above automatically. As always, any help would be welcome!)
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/2dd3ce42-2864-cdfa-c364-d41ece7f5eaa%40colostate.edu.