[Dune] Index to Entity map

Jö Fahlke jorrit at jorrit.de
Mon Apr 24 13:18:21 CEST 2017


Am Mon, 24. Apr 2017, 11:39:14 +0100 schrieb Kristof Cools:
> I am completely new at Dune and after going through the available docs and
> tutorials I have the following general question:
> 
> I understand that the concept of a mapper/indexset is central to dune-grid
> and allows one to get an index (and corresponding attribute values) given
> an entity. It there a reason that the inverse concept is not part of the
> API? in other words, why is the set of entities merely iterable, as opposed
> to indexable?

Dune-grid supports different grid managers, eachs with their particular
strengths, and therefore also weaknesses.  While for some grid managers
(e.g. structured ones) it would be easy to map from entity indices to the
entities themselves, a large portion of grid managers can support this mapping
only in O(log(n)), or even O(n), because internally they organize the
entitities in tree structures or linked lists.  Or it may be the case that the
_leaf_ index cannot easily be constructed and therefore must be stored inside
the entity itself, again requiring O(n) runtime to find it.

So since some of the grid managers we want to support would have trouble
implementing this efficiently, we chose not to make this an API requirement.
And it turned out that we never really needed it, so there was never any real
need to add is as a kind of "optional interface" for grid managers that want
to support it.

Regards,
Jö.

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170424/111a0260/attachment.sig>


More information about the Dune mailing list