Matrix-based p-multigrid preconditioning

65 views
Skip to first unread message

yy.wayne

unread,
Oct 3, 2022, 5:39:51 AM10/3/22
to deal.II User Group
Hello,

I plan to test the converge of polynomial multigrid preconditioning on a problem, with matrix-based framework. However, step-75 is a bit confusing since I cannot clearly separate classses contributed by matrix-free and p-multigrid. 

Specifically, in step-16 (with MeshWorker) and step-56 (assemble cell_matrix by hand) there are assemble_system() and assemble_multigrid(), while in step-75 there are solve_system() which calls solve_with_gmg and mg_solve. It is due to matrix-free or p-multigrid? By the way, is there a code gallery for matrix-based polynomial-multigrid ? 

Thanks

Marc Fehling

unread,
Oct 3, 2022, 12:11:49 PM10/3/22
to deal.II User Group
Hi!

The "Possibilities for extensions" section of step-75 gives you a few hints on how to achieve p-multigrid preconditioning with matrix-based methods:

If you look for an example implementation, the "hpbox" tool demonstrates both matrix-based and matrix-free implementations of the p-multigrid method.

Best,
Marc

yy.wayne

unread,
Oct 4, 2022, 3:43:18 AM10/4/22
to deal.II User Group
Thank you, I'll read the implmentation in "hpbox" then.

yy.wayne

unread,
Oct 5, 2022, 8:17:03 AM10/5/22
to deal.II User Group
Hello sir,

One thing I'm confused is that why we use "make_hanging_node_constraints" and "interpolate_boundary_values" for a new constraints in solve_with_gmg in step-75, instead of the boundary_constraints as done in previous MG tutorials.

在2022年10月4日星期二 UTC+8 00:11:49<mafe...@gmail.com> 写道:

Peter Munch

unread,
Oct 7, 2022, 1:35:16 AM10/7/22
to deal.II User Group
Hej,

> One thing I'm confused is that why we use "make_hanging_node_constraints" and "interpolate_boundary_values" for a new constraints in solve_with_gmg in step-75, instead of the boundary_constraints as done in previous MG tutorials.

Your observation is correct. It is related to the fact that p-multigrid in deal.II uses the new global-coarsening infrastructure (it was introduced in release 7.3). In the other tutorials, the local-smoothing infrastructure is used. 

In a nutshell, the difference is that local smoothing is working on refinement levels, while global coarsening works on the complete active levels of multiple Triangulation/DoFHandler objects. In the case of h-multigrid, one works on multiple meshes, which are created by globally coarsening the finest mesh (this is the reason for the name "global coarsening"); in the case of p-multigrid, one would work with the same Triangulation but would distribute different FEs on different DoFHandler objects. Since you work on the active level, you can simple use the functions you would use if you don't work on refinement levels.

For more details see our publication: https://arxiv.org/abs/2203.12292

Hope this help,
Peter

yy.wayne

unread,
Oct 7, 2022, 1:44:30 AM10/7/22
to deal.II User Group
I see. So that's why we create a new dof_handlers in solve_with_gmg() function instead of continue using dof_handler as other tutorials. If I want to build mg_matrices and their SparsityPattern, they should based on dof_handlers as well, is it correct?

Thank you

Peter Munch

unread,
Oct 7, 2022, 1:45:41 AM10/7/22
to 'yy.wayne' via deal.II User Group

Yes.

Peter

--
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 dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/55c95bd6-48b2-4dcf-9e6c-6544b85be53en%40googlegroups.com.

yy.wayne

unread,
Oct 8, 2022, 9:40:01 AM10/8/22
to deal.II User Group
I modify step-75 into a matrix-based, basiclly combining the hpbox repo in github. I came across a error while building:

/home/ubuntu/Desktop/my_projects/step-75-matrixbased/source/step-75-mb.cc:710: error: ‘class dealii::hp::FEValues<2, 2>’ has no member named ‘unsubscribe’
In file included from /home/ubuntu/deal.II/installed/include/deal.II/distributed/tria.h:22,
                 from /home/ubuntu/deal.II/installed/include/deal.II/distributed/grid_refinement.h:24,
                 from /home/ubuntu/Desktop/my_projects/step-75-matrixbased/source/step-75-mb.cc:34:
/home/ubuntu/deal.II/installed/include/deal.II/base/smartpointer.h: In instantiation of ‘dealii::SmartPointer<T, P>::~SmartPointer() [with T = dealii::hp::FEValues<2, 2>; P = void]’:
/home/ubuntu/Desktop/my_projects/step-75-matrixbased/source/step-75-mb.cc:220:9:   required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Step75::MatrixBasedOperator<2, double>]’
/usr/include/c++/9/bits/unique_ptr.h:292:17:   required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Step75::MatrixBasedOperator<2, double>; _Dp = std::default_delete<Step75::MatrixBasedOperator<2, double> >]’
/home/ubuntu/Desktop/my_projects/step-75-matrixbased/source/step-75-mb.cc:710:9:   required from here
/home/ubuntu/deal.II/installed/include/deal.II/base/smartpointer.h:277:8: error: ‘class dealii::hp::FEValues<2, 2>’ has no member named ‘unsubscribe’
  277 |     t->unsubscribe(&pointed_to_object_is_alive, id);
      |     ~~~^~~~~~~~~~~

I cannot figure out why this is wrong since it's same as hpbox. Could this be due to different version (mine is 9.3.0)?
step-75-mb.cc

yy.wayne

unread,
Oct 8, 2022, 9:51:56 AM10/8/22
to deal.II User Group
I find the problem, that FEValuesBase is not an accessor of Subscriptor in 9.3.0, while is in 9.4.0. So it's deal.II version making this error.
Reply all
Reply to author
Forward
0 new messages