[Dune] Usage of EntitySeed to get info about Entities

Dedner, Andreas A.S.Dedner at warwick.ac.uk
Wed Nov 7 12:08:14 CET 2012


Not quite sure if I understand your question - but here is a possible
answer;
each grid should have a method entityPointer which takes a seed and
returns the corresponding EntityPointer so something like
EntityPointer ep = grid.entityPointer( seedVector[i] );
const Entity &entity = *ep;
should do what you want.

If you find the documentation not sufficient, a patch would be welcomed!

Best
Andreas

________________________________
From: dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Sacconi, Andrea [a.sacconi11 at imperial.ac.uk]
Sent: 07 November 2012 10:21
To: dune at dune-project.org
Subject: [Dune] Usage of EntitySeed to get info about Entities

Hi all,

I'd have a question for you about EntitySeed.
In a previous message I was told that the best and most efficient way of storing information about elements is through EntitySeed.
>From what I read from the documentation, they are "seeds" that help you retrieve the necessary information about an element you could need at a later stage, minimising the memory waste. Am I right?

Now, suppose you have classified your elements in two different categories, liquid/solid for example; I can't store the physical Entities in a container, I can only store pointers of them, or seeds of them.
How do I "recreate" the entity, given its seed? Would it be possible to "recreate" an EntityPointer from the EntitySeed?
My question comes from the fact that I need to "filter" the list of elements and discard some of them (e.g., the solid ones), but in order to do that I need to use a method "find" for a STL container, and the operands (element to find and entries of the container) have to be, of course, of the same type.

Thanks a lot in advance!

Andrea
__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20121107/89b114c0/attachment.htm>


More information about the Dune mailing list