To add to this, there might also be no reason for cell "4" (whatever
that means) to be available on the current processor. The mesh in a
parallel computation is "distributed" after all.

On Fri, Feb 24, 2017 at 8:01 AM, Jean-Paul Pelteret
<jppelte...@gmail.com> wrote:
> Dear Seyed,
>
> There are no cell "numbers" in deal.II, only CellIDs 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, and you may wish to
> consider using FilteredIterators with the LocallyOwned predicate 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 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=fmFEEI3Kq19LfHmpN-c61No1dYXeRRPQnotNi7PL4Po&s=kB0zzWe3cVJaujXkNnKZL0WfssR0O3dkB99s0iqyBFs&e=
>  
> For mailing list/forum options, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=fmFEEI3Kq19LfHmpN-c61No1dYXeRRPQnotNi7PL4Po&s=TkHRRnwbkhay8yAMwTsfS0HHpyj3IqU-AHr0x54Dw2k&e=
>  
> ---
> 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://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=fmFEEI3Kq19LfHmpN-c61No1dYXeRRPQnotNi7PL4Po&s=3z0U2_GKFXAOvrHFb6Q6f62Nq_MTxwhLVG7vR48J2yg&e=
>  .



-- 
Timo Heister
http://www.math.clemson.edu/~heister/

-- 
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.

Reply via email to