Problem in Using SparseVanka as Multigrid Smoother

68 views
Skip to first unread message

Chayapol Chaoveeraprasit

unread,
Jul 14, 2024, 8:24:32 AM7/14/24
to deal.II User Group
Dear all,

I am trying to use SparseVanka as a smoother in multigrid. Below is the part of my code that initializes the multigrid smoother object.

...
MGLevelObject<SparseMatrix<double>> mg_matrices; // already populated with level matrices
SparseVanka<double>::AdditionalData vanka_data(std::vector<bool>{false,true});
MGSmootherPrecondition<SparseMatrix<double>,SparseVanka<double>,Vector<double>> mg_smoother;
mg_smoother.initializes(mg_matrices, vanka_data);
...

When I compiled the code, there was one error: 'SparseVanka<double> has no member named 'clear'. In instantiation of 'void dealii::MGLevelObject<Object>::clear_elements() [with Object = dealii::SparseVanka<double>]', required from 'void dealii::MGSmootherPrecondition<MatrixType, PreconditionType, VectorType>::clear()...

It seems that the SparseVanka class has no clear() method, which is required by MGLevelObject. I speculate that SparseVanka is not ready to be used as multigrid smoother yet, or this is not the correct way to use SparseVanka as multigrid smoother.

Thank you in advance.

Best regards,
Chayapol



Wolfgang Bangerth

unread,
Jul 18, 2024, 3:08:09 PM7/18/24
to dea...@googlegroups.com
On 7/14/24 06:24, Chayapol Chaoveeraprasit wrote:
>
> When I compiled the code, there was one error: 'SparseVanka<double> has no
> member named 'clear'. In instantiation of 'void
> dealii::MGLevelObject<Object>::clear_elements() [with Object =
> dealii::SparseVanka<double>]', required from 'void
> dealii::MGSmootherPrecondition<MatrixType, PreconditionType,
> VectorType>::clear()...
>
> It seems that the SparseVanka class has no clear() method, which is required
> by MGLevelObject. I speculate that SparseVanka is not ready to be used as
> multigrid smoother yet, or this is not the correct way to use SparseVanka as
> multigrid smoother.

Chayapol:
It's possible that nobody has ever used SparseVanka as a preconditioner and
that as a consequence nobody has ever needed the clear() function. But I
suspect it would not be very difficult to implement such a function -- just
take a look at how it is implemented for the other classes typically used as
preconditioners, and see if you can add it to the SparseVanka class as well.

Would you like to see whether you can write such a patch, and contribute it to
the library? We would of course be very happy to give you feedback on your patch!

You might be interested in some of the material here (and linked to from here)
to see what it takes to create patches:
https://dealii.org/participate.html
https://github.com/dealii/dealii/wiki/Contributing

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Chayapol Chaoveeraprasit

unread,
Jul 24, 2024, 10:23:52 AM7/24/24
to deal.II User Group
Dear Wolfgang,

Thank you for your reply. It is indeed not very difficult to implement the clear() function. I have done it and put up a pull request here: https://github.com/dealii/dealii/pull/17383. Hope it works smoothly and can be merged into the main library soon.

Best,
Chayapol

Reply all
Reply to author
Forward
0 new messages