set cell.pid < 0 in multigrid

38 views
Skip to first unread message

Won JOON Choi

unread,
Aug 29, 2025, 4:04:46 AM (9 days ago) Aug 29
to basilisk-fr

Dear all,

I found that there is a mask() function which literally masks out regions where computations are removed.
It sets the status of the cells in that region as cell.pid < 0, resulting in inactivation of computations.

However, as far as I understand, mask() is only available for Tree domains.
So I have two questions:


Q1.
Is there any way to easily set cell.pid < 0 in Multigrid domains?

Q2.
When we use embed, (as I understand it) the purpose is also to exclude a region from being computed.
Then why don’t we simply set the cells in the embed region as cell.pid < 0?
Are there intended cases where we still want the embed region to remain part of the computation?

Many Thanks in advance!
(I am newbie in Basilisk 😊)

Best regards,
Joon

Spencer Schwartz

unread,
Aug 29, 2025, 4:29:24 PM (9 days ago) Aug 29
to basilisk-fr
Hi Joon,

> Q2.
> When we use embed, (as I understand it) the purpose is also to exclude a region from being computed.
> Then why don’t we simply set the cells in the embed region as cell.pid < 0?
> Are there intended cases where we still want the embed region to remain part of the computation?

I can make an educated guess for your Q2. To my knowledge, mask() does not work with MPI. Im sure its possible, but it would probably complicate the already complicated MPI code even more if the MPI ranks need to treat these masked regions with care. Therefore, it would be safest to still include the embedded region but with a trivial solution, i.e. 0 for every variable, especially for the multigrid solver. This is achieved by setting the metric fields, fm and cm, based on the liquid volume fraction.

So, in short, it's probably because of how Basilisk's MPI implementation is that it makes setting cell.pid < 0 not desirable. But, this is just my guess!

Best,
Spencer
Reply all
Reply to author
Forward
0 new messages