← Back to team overview

ufl team mailing list archive

Re: [Branch ~ufl-core/ufl/main] Rev 967: Update repr string in set_cell and set_degree, fixes strange cache problem.

 

They should be removed. If used on an element used by an expression, subtle
incorrectness issues will appear, sometimes... Cache issues are only a
symptom here, the real problems will be wrong results with no crash.

Martin
Den 12. mars 2011 11.36 skrev "Anders Logg" <logg@xxxxxxxxx> følgende:
> On Sat, Mar 12, 2011 at 11:28:15AM +0100, Martin Sandve Alnæs wrote:
>> Changing repr is incorrect, and the bugs you're finding will never end.
>>
>> It is a fundamental design choice in UFL to make everything
>> immutable, and the repr strings can never change. This is a
>> critical property for lots of things to work, and it is assumed
>> all over the place. It cannot ever be changed.
>>
>> Instead of modifying an UFL object, always create a
>> new one with the changes you want. This is how every
>> algorithm in UFL works, and this is how every future
>> algorithm working on UFL objects must work.
>
> ok, good point.
>
> The reason for these changes are the two functions set_cell and
> set_degree in the finite element classes, which are used to set the
> cell and degree of an element when they are unspecified ("?"). They
> have been around for a long time.
>
> --
> Anders

Follow ups

References