[Dune] get cell from index?

Jö Fahlke jorrit at jorrit.de
Fri Aug 25 14:52:03 CEST 2017


Am Fr, 25. Aug 2017, 14:44:09 +0200 schrieb Gregor Corbin:
> when I have a mapper (e.g. SCSG) of a GridView, is it possible to get a cell
> from an index?
> 
> To ask differently, if i do this:
> 
>     int idx = mapper.index(cell);
> 
> can i go back like this:
> 
>     auto cell = (elements(grid_view))[idx];

Nope, sorry.  Possible alternatives, depending on what you really want to
achieve:

- iterating through `elements(grid_view)`, search for a cell with
  `mapper.index(cell)==idx`

- copying and storing the cell

- using `EntitySeed`s.

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170825/34c59c84/attachment.sig>


More information about the Dune mailing list