[Dune] Fwd: Re: get cell from index?
Gregor Corbin
corbin at mathematik.uni-kl.de
Fri Aug 25 15:13:03 CEST 2017
sorry, forgot to reply to the list
-------- Forwarded Message --------
Subject: Re: [Dune] get cell from index?
Date: Fri, 25 Aug 2017 15:11:52 +0200
From: Gregor Corbin <corbin at mathematik.uni-kl.de>
To: Jö Fahlke <jorrit at jorrit.de>
Basically, I want to precompute an extended stencil for each cell for
quick access to its surroundings ( more than just the direct neighbors).
So, having to search is not really an option. I also want to have as
little storage overhead as possible. Its seems like EntitySeeds are the
best option for me. How big are they compared to an int? And how fast is
this grid.entity(entitySeed) method compared to a vector access?
Thanks for the quick reply,
Gregor
On 25.08.2017 14:52, Jö 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ö.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170825/c126861f/attachment.htm>
More information about the Dune
mailing list