Dear Seyed, There are no cell "numbers" in deal.II, only CellIDs <https://www.dealii.org/8.4.1/doxygen/deal.II/classCellId.html> to give some unique identifier to each cell. So its unclear to me as to exactly what you're trying to achieve here.
Are you wanting the fourth cell iterator for the entire triangulation, or the fourth locally owned cell? Either way, you need to increment your cell iterator by however many times you want, taking note that dependent on how you do this you may not end up with a locally owned cell. You can increment iterators by a given number of times using std::advance <http://en.cppreference.com/w/cpp/iterator/advance>, and you may wish to consider using FilteredIterators <https://www.dealii.org/8.4.1/doxygen/deal.II/classFilteredIterator.html> with the LocallyOwned predicate <https://www.dealii.org/8.4.1/doxygen/deal.II/classIteratorFilters_1_1LocallyOwnedCell.html> to ensure that you always end up with a cell thats valid on the given process. I hope that this helps, Jean-Paul On Friday, February 24, 2017 at 11:12:59 AM UTC+1, Seyed Ali Mohseni wrote: > > Hi, > > Is it possible to access a specific element within a parallel distributed > triangulation by means of the following procedure for instance: > > typename DoFHandler<dim>::active_cell_iterator cell = > dof_handler.begin_active(), endc = dof_handler.end(); > > for (; cell != endc; ++cell) > { > if (cell->is_locally_owned()) > { > std::cout << "CELL NUMBER 4 VERTEX 1: " << cell(4)->vertex(0) << > std::endl; > } > } > > The above won't compile. > > How am I able to access for example element number 4 in order to obtain > the coordinates of point 1 within the element. > > Kind regards, > S. A. Mohseni > > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.