[Dune] Info GeometryGrid and entity seed
Martin Nolte
nolte at mathematik.uni-freiburg.de
Thu Mar 3 20:39:47 CET 2016
Hi Marco,
as I don't know your exact application, I will hardly be a good advisor.
Therefore, I stick to the interface.
The answer to your question is: Yes, there is another way. You can store the
ids, e.g., in a std::set. They are guaranteed to be persistent over grid
modification. On the downside: You need to traverse the grid to get the entities
(or entity seeds) back.
That said, as long as you stick to GeometryGrid and keep a keen eye on changes,
you should be safe reusing the entity seeds after modifying the coordinate function.
Actually, I would not even count on the behavior of an entity. Assume you have
an entity e and then modify the coordinates. What will be the result of
e.geometry() afterwards? Right now, it depends on whether you obtained the
geometry before modifying the coordinate function or not. If you did, you will
get the old geometry, otherwise the new one. Please note that this behavior
conforms to the specification, as you are not allowed to keep entities over any
kind of grid modification.
Best,
Martin
On 03/03/2016 07:48 PM, Agnese, Marco wrote:
> Hi Martin,
>
> thank you for the answer.
>
>
> Right now I am constructing the entity from the entity seed after the
> GeoemtryGrid has been moved and it works perfectly fine.
>
>
> But what is the alternative? I need to store some entities (or a pointer/ an
> iterator to them) and retrieve them after the grid has been moved. I thought the
> only way is to save the relative entity seed. Is there another way to do it?
>
>
> Cheers,
>
> Marco
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
--
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>
Universität Freiburg phone: +49-761-203-5630
Abteilung für angewandte Mathematik fax: +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
More information about the Dune
mailing list