How to get the global indices of cells in parallel distributed Triangulation?

34 views
Skip to first unread message

shanglong zhang

unread,
Aug 10, 2015, 2:09:52 PM8/10/15
to deal.II User Group
Hi all,

I am trying to find a way to get the global indices of cells among distributed Triangulation. I have tried active_cell_index(), but it gave me back the indices with respect to current partition.(0~n_local_active_cell instead of 0~n_global_active_cell). Did I miss something? Thank you for your help.

Best,
Shanglong 

Bruno Turcksin

unread,
Aug 10, 2015, 2:48:47 PM8/10/15
to deal.II User Group
Shanglong,


On Monday, August 10, 2015 at 1:09:52 PM UTC-5, shanglong zhang wrote:
I am trying to find a way to get the global indices of cells among distributed Triangulation. I have tried active_cell_index(), but it gave me back the indices with respect to current partition.(0~n_local_active_cell instead of 0~n_global_active_cell). Did I miss something? Thank you for your help.

You can use CellID (https://dealii.org/8.3.0/doxygen/deal.II/classCellId.html) however this does not return a number such as an unsigned int. For example, there is no cell number 4 on a distributed triangulation.

Best,

Bruno

shanglong zhang

unread,
Aug 10, 2015, 3:22:02 PM8/10/15
to deal.II User Group
Hi Bruno,

Thank you for your reply. 

My situation is I have a std::vector has size n_global_active_cell, and every entry in std::vector stores a data for the corresponding cell in the global triangulation.

I guess I might need a map between Cellid and unsigned int to create and store the cell numbering information. Is it the best way to do this?  Thanks.

Best,
Shanglong

在 2015年8月10日星期一 UTC-4下午2:48:47,Bruno Turcksin写道:

Wolfgang Bangerth

unread,
Aug 10, 2015, 4:15:40 PM8/10/15
to dea...@googlegroups.com

> My situation is I have a std::vector has size n_global_active_cell, and every
> entry in std::vector stores a data for the corresponding cell in the global
> triangulation.

That's generally not good design -- you never want one processor to have to
store an amount of data that is proportional to the overall size of the problem.


> I guess I might need a map between Cellid and unsigned int to create and store
> the cell numbering information. Is it the best way to do this? Thanks.

Yes, a map should work.

Best
W.

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

Reply all
Reply to author
Forward
0 new messages