[Dune] Default constructor in MultiLinearGeometry
Martin Nolte
nolte at mathematik.uni-freiburg.de
Sun Oct 14 10:55:16 CEST 2012
Hi Oli,
as far as I can see, this would in priciple possible if the corner storage has a
default constructor (like std::vector) and _no_ methods are called on this geometry.
Personally, I feel like the wrong instance to decide upon this question.
Not knowing much about the UGGrid code, I don't see why you ever want an
uninitialized geometry. From my point of view, you either construct the geometry
directly before returning it (not holding a copy on the entity), or you do it
like GeometryGrid and hold a reference counting pointer on the entity. As this
might be a nullptr, you don't need a default constructor, here.
Apart from this, my feeling is that uninitialized objects are a very bad thing.
Especially unexperienced programmers will have a hard time finding bugs caused
by this. A default constructor would, of course, create an "uninitialized"
geometry (in the sense that you may not use it at all).
Should this question be discussed on the FlySpray?
Best,
Martin
PS: Thanks for all the positive feedback. I was not sure whether this change is
the right path or not.
On 10/14/2012 09:03 AM, Oliver Sander wrote:
> Hi Martin,
> last night I tried to switch from BasicGeometry to MultiLinearGeometry
> for various parts of UGGrid. Unfortunately, that didn't work as easily
> as I hoped, because UGGrid expects a default constructor, which
> BasicGeometry has, and MultiLinearGeometry hasn't. Is there any chance
> to get a default constructor in MLG, or should a adjust the UGGrid code?
> best,
> Oliver
>
> _______________________________________________
> 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