Does MatrixFree need to reinit when boundary_id changes?

90 views
Skip to first unread message

Chengjiang Yin

unread,
Jul 29, 2024, 10:41:34 PM7/29/24
to deal.II User Group
Hi all,

I need to change my boundary id on part of the mesh boundary when evolving the equations. And I also have a boundary operator that acts on specific boundary_id (absorption boundary).

In that case, do I need to reinit my matrix free every time I update the boundary_id? I use tasks_parallel_scheme=none. Does the matrix free only cache the mapping info of boundary face or does it pre partitioned the face it into different groups?

Regards,
Chengjiang Yin

Chengjiang Yin

unread,
Jul 31, 2024, 10:56:49 PM7/31/24
to deal.II User Group
BTW, the changing boundary is not Dirichlet BC so that I do not need to rebuild my AffineConstraints.

Martin Kronbichler

unread,
Aug 1, 2024, 1:43:07 AM8/1/24
to dea...@googlegroups.com

Dear Chengjiang,

Yes, you need to run reinit() again when the boundary id on certain boundaries changes, because the boundary id gets extracted to the data structures of matrix-free face integrals, and faces of the same ID will get grouped together.

Best,
Martin


Am 01.08.24 um 04:56 schrieb Chengjiang Yin:
--
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/0a311f3d-cf29-4582-9a59-30484d1be4d0n%40googlegroups.com.
Message has been deleted

Chengjiang Yin

unread,
Aug 2, 2024, 9:59:41 AM8/2/24
to deal.II User Group
Hi Martin,

Thanks for the quick reply! Not very good news for me :-( since I need to change the boundary condition multiple times during evolution and many reinit is definitely expensive. Is there a better way that I can just change the face group and avoid reinit everything else in the MatrixFree?

I take a look at the MatrixFree impl and it seems that only MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices and FaceSetup<dim>::generate_faces are related to the exact boundary id and partition. Is it possible I only do some part of the internal_reinit during each update?

Regards,
Chengjiang Yin
Reply all
Reply to author
Forward
0 new messages