[Dune] dune-geometry r44

Jö Fahlke jorrit at jorrit.de
Mon Feb 20 17:27:03 CET 2012


Am Mon, 20. Feb 2012, 16:37:56 +0100 schrieb Martin Nolte:
> no, that was indeed not intended and is hopefully fixed. All I
> wanted is to use a Dune::array to store the reference elements
> instead of a C array, so I could provide iterators without
> additional work.
> 
> Originally, this Dune::array stored GenericReferenceElement< ... >
> and, hence, its value_type was exactly what we wanted to export.
> Unfortunately, the constructor (and destructor) of
> GenericReferenceElement is private and, hence, the Dune::array had
> no constructor. To circumvent this, I added a nasty hack: The
> Dune::array now actually stores a derived type with a public
> constructor / desctructor. If anyone knows a better trick, I'd be
> thankful.

Well, for instance you could use C-pointers as iterators, which is perfectly
legal.  This way you could go with the original C-array.

Or make the constructors public.  I mean, it is a nice idea to guide the users
into not writing inefficient code by preventing them from recreating reference
elements that already exist as singletons.  But when I look at the hoops the
code has to jump through to prevent this, I wonder whether it is worth it.

Bye,
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

Der Horizont vieler Menschen ist ein Kreis mit Radius Null - und das
nennen sie ihren Standpunkt.
-- A. Einstein
-------------- 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/20120220/0b3f10f4/attachment.sig>


More information about the Dune mailing list