[Dune] Returning Geometries As Objects
Jö Fahlke
jorrit at jorrit.de
Wed Jan 25 11:04:36 CET 2012
Am Wed, 25. Jan 2012, 09:49:01 +0100 schrieb Martin Nolte:
> Dear all,
>
> as announced in December, there is now an implementation returning
> the geometry as an object and all grid implementations in dune-grid
> have been adapted accordingly. Therefore, I think time has come for
> discussion of the outcome.
Nice!
> The changes try to be as uninvasive as possible. However, due to
> code evolution, there are some unnecessary changes left. The
> greatest benefit for a developer is the possibility to create a new
> geometry object whenever the geometry is requested. This gives us
> essentially two types of geometry implementations:
> (a) actually returned geometry implementations,
> (b) references to the actual geometry (as was previously enforced).
So, in essence, Dune::Geometry may (a) store the actual geometry or may (b) be
a wrapper class holding a reference/pointer to the actual geometry?
In case be (b), how long is a geometry object guaranteed to be valid? Until
the entity/intersection object it was obtained from changes it's value or is
destroyed?
This sounds like an application for boost::ref(erence_wrapper) (now also
available as std::ref(erence_wrapper)). But that is a minor implementation
detail.
> Notice that the SPGrid implementation no longer returns the geometry
> by reference, which seems to cause a small performance loss.
> However, this decision is now up to the grid developer!
> Unfortunately, there are some spurious performance gains with
> ALUCubeGrid and SGrid.
Spurious in the sense that you don't have an explanation for them?
> Before doing any changes to the actual trunk, I would like to hear
> the opinion of the developers (and users) on this change. I hope the
> impact of the transition and its most important details became
> clear. Questions, suggestions, and hints will be welcome.
Does this give us a way to get a stable geometry object that can be copied and
stored, regardless of what the grid does?
Regards,
Jö.
--
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884
Interpunktion, Orthographie und Grammatik der Email ist frei erfunden.
Eine Übereinstimmung mit aktuellen oder ehemaligen Regeln wäre rein
zufällig und ist nicht beabsichtigt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120125/66be9503/attachment.sig>
More information about the Dune
mailing list