← Back to team overview

ufl team mailing list archive

Re: Change in behaviour of "unknown"

 

On 06/29/11 11:06, Martin Sandve Alnæs wrote:
I did some changes and want FFC to be updated to follow this, but I
did it in a non-breaking way. Let me explain.


test.ufl:
V = FiniteElement("CG", triangle, 1)
unknown = Coefficient(V)



This is not what the reserved name unknown was "designed" for and has been used for. (It was intended for answering "which Coefficient is the unknown?" and automated derivatives with respect to that.)



Interactive python session:

In [1]: from ufl.algorithms import load_ufl_file

In [2]: filedata = load_ufl_file("test.ufl")

In [3]: filedata.object_names
Out[3]:
{24282848: 'V',
  24339344: 'unknown',
  'unknown': Coefficient(FiniteElement('Lagrange', Cell('triangle',
Space(2)), 1, None), 0)}

In [4]: filedata.reserved_objects
Out[4]: {'unknown': Coefficient(FiniteElement('Lagrange',
Cell('triangle', Space(2)), 1, None), 0)}

In [5]: filedata.object_by_name
Out[5]:
{'V': FiniteElement('Lagrange', Cell('triangle', Space(2)), 1, None),
  'unknown': Coefficient(FiniteElement('Lagrange', Cell('triangle',
Space(2)), 1, None), 0)}


I want to remove 'unknown' from the 'object_names' so that
it is in fact a mapping from id(object) to name of object.
I have not removed it as you can see above, but have added
another dict 'reserved_objects' which currently only holds
'unknown' if it is present. There is a list of reserved names
that can easily be extended. It would be nice if FFC could
update to this change so I can remove 'unknown' from object_names.


Ok, stop by and let's sort out something sensible quickly :-)

--
Marie


Martin


On 29 June 2011 10:51, Martin Sandve Alnæs<martinal@xxxxxxxxx>  wrote:
What has changed?

Martin


On 28 June 2011 21:50, Marie E. Rognes<meg@xxxxxxxxx>  wrote:

Sometime between Tuesday 11-06-07 at approx 02.20 and now it seems that the
handling of the reserved variable name "unknown" in form files has changed.
Does anyone know anything about this?

--
Marie

_______________________________________________
Mailing list: https://launchpad.net/~ufl
Post to     : ufl@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ufl
More help   : https://help.launchpad.net/ListHelp




References