Coarse Cell IDs Distributed Triangulation

27 views
Skip to first unread message

Jonathan Russ

unread,
Nov 11, 2021, 8:30:30 AM11/11/21
to deal.II User Group
Hello -

I really would like to have a unique ID for each coarse cell regardless of the number of MPI processes. I have a distributed (not fullydistributed) triangulation. Testing the coarse_cell->index() method for a simple problem appears to provide exactly what I need but the documentation seems to suggest that this isn't necessarily true.

The function "coarse_cell_id_to_coarse_cell_index" is private for the distributed triangulation but even if it were public I don't think it is what I want, since I am after unique cell identifiers when running the code with a different number of MPI ranks. In other words, I want cell 27 to remain cell 27 whether I run on 1 MPI rank or 10 MPI ranks.

Is this possible to do in deal.II? The only thing I know would work would be to use a unique material_id for each coarse cell in the domain but then I would no longer have the material_id functionality as originally intended.

Thanks in advance for your help,
Jonathan

Marc Fehling

unread,
Nov 11, 2021, 11:18:57 AM11/11/21
to deal.II User Group
Hi Jonathan,

there is a unique way to identify cells, even in parallel::distributed::Triangulation objects! For this, have a look at the CellId class.

You can create an object of this class from a cell accessor using this member function.

Hope this helps,
Marc

Jonathan Russ

unread,
Nov 11, 2021, 3:08:11 PM11/11/21
to deal.II User Group
Hi Marc -

Thank you for your reply. I saw that before and I see why it is useful during a single analysis with a set number of MPI ranks. This seems useful for communicating "ghost cell" data between MPI ranks. However, it doesn't seem to guarantee the following:
For example:
Say you have a square domain in 2D.
Run the analysis with 2 processors: mpirun -np 2 ./executable
Note the CellId corresponding to the cell in the bottom left corner of the domain.
Now run the same analysis with 20 processors: mpirun -np 20 ./executable
Does the same cell in the bottom left corner of the domain have exactly the same CellId as the CellId it had when 2 processors were used?

Thanks again for your help,
Jonathan

Wolfgang Bangerth

unread,
Nov 11, 2021, 4:33:47 PM11/11/21
to dea...@googlegroups.com
On 11/11/21 1:08 PM, Jonathan Russ wrote:
> Does the same cell in the bottom left corner of the domain have exactly
> the same CellId as the CellId it had when 2 processors were used?

Yes :-)

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

Jonathan Russ

unread,
Nov 11, 2021, 7:26:13 PM11/11/21
to deal.II User Group
Amazing. Thank you very much!

Jonathan

Reply all
Reply to author
Forward
0 new messages