[Dune] get cell from index?

Christian Engwer christian.engwer at uni-muenster.de
Fri Aug 25 23:41:02 CEST 2017


Perhaps one important additional notice...

depending one which implementation you are using the seed is as simple
as an index. In general it will be the cheapest (memory wise) way to
recreate an entity.

For YaspGrid it is basically the index, level, etc. For UGGrid it is a
pointer.

So the seed might work well for you...

best
Christian

On Fri, Aug 25, 2017 at 02:52:03PM +0200, Jorrit Fahlke wrote:
> 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ö.




More information about the Dune mailing list