[Dune] bug in referenceelement.position ??

Martin Nolte nolte at mathematik.uni-freiburg.de
Wed Mar 4 14:50:47 CET 2015


Hi Aleksejs,

you are trying to print a 0-dimenional vector. Obviously, this has zero 
components (whereever the additional space came from).

Moreover, it is perfectly ok to have a 0-dimensional vector in dune. In fact, 
the geometry's global mapping makes only sense for vertices because the local 
vector may be 0-dimensional.

As with all other FieldVectors, you may only access valid components (i.e, 
those where the index i satisfies ((i >= 0) && (i < dimension)). If dimension 
is zero, there is no such index i.

Do you accidentally presume that x[ 0 ] is always valid?

Best,

Martin

On 03/04/2015 02:05 PM, Oliver Sander wrote:
> Am 04.03.2015 um 13:55 schrieb Aleksejs Fomins:
>> Dear Dune,
>>
>> I am encountering another bug with a gridcheck.hh, which I believe may be a fundamental bug.
>
> This test passes for quite a number of grids, so first my first guess is that the bug is in
> your code.  Did you try valgrind?
>
>>
>> The bug:
>> dune/grid/test/checkgeometry.hh
>> uses mydim=0 and calls the method checkGeometry() from
>> dune/geometry/test/checkgeometry.hh
>> which constructs
>> const ReferenceElement< ctype, mydim > &refElement = ReferenceElements< ctype, mydim >::general(type);
>> and then calls
>> refElement.position( i, mydim )
>>
>> If you try to cout the position, you get empty string " ". If you try to access its entities, you get segmentation fault.
>>
>> Is this expected?
>
>
>
>>
>> Regards,
>> Aleksejs
>>
>>
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>
>
>
>
>
> _______________________________________________
> 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