[Dune] bug in referenceelement.position ??

Aleksejs Fomins aleksejs.fomins at lspr.ch
Wed Mar 4 15:03:33 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Martin,

This is indeed the problem. I was not aware that dim-0 vectors exist. I will make the necessary adjustments to the geometry.

Thanks
Aleksejs

On 04/03/15 14:50, Martin Nolte wrote:
> 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
>>
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJU9xC0AAoJEDkNM7UOEwMZYyMQAMD2mlZL9FAO7krv4+wLDEiE
TMqqJZf6TqciOS4HJXcktoBxQtXEGP+mBB8YGdoXfSeFdkwBhov+vfGpPX9RYR4u
k0EuRM5UPR1bW9os3OXNThie2Usd6hmr/+yEvAgKdf7DVAeWWKuFQDvTICRcm7hu
LHAt17Ki8vb9/yTm5EfFqOybynpv3fFI05G3/cIHXL4IhxC/RtWDFuM4J5nYbJnu
ZQs4dxAR3dXw9iI0iATZ9ywXgp7SkqZZRoM6qcFOQqPrwaQF+rph3rnH7r7y7oKg
iWcajlQQ5MJa68NAEygq0um/MWPho8mStx2vL+nrfcVNF7SVcK146HbdWLLFuFuo
xA46VjXd5Fy81OBQ4cTQ1WSSxeyOD745BW00zPT66RtVHoL4bLpT9NaBrPoX3OWC
aWqmL5dEHztVDLEO9rwc05oqamJn2s6j3ZQfBeyEXJNNEkGT4vZbAimH1S6Ykvg3
HLCYshZ3suDSBBJJuVB9dUoGgbIlkbspHIMbZxPZVp3mRZVn3pGVIuwvtCbnCyK+
BoHTCkVZea+HDPwgKdDr0PualL3awTZl5KQF628pmhL2kDh2vE8AOazL3Gta9Tu1
w0Zv0rMSII+q75us7zGGN4GpWDL2NDCdUFKoc44RjR6m5noGCm05Fz74eqBFxLWk
TwYyOwiV+lA+xuByh4Pu
=zGm3
-----END PGP SIGNATURE-----




More information about the Dune mailing list