Subject: [Ufl] Change in behaviour of "unknown"

From: "Marie E. Rognes" <[email-masked]>
Date: Tue, 28 Jun 2011 21:50:52 +0200

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

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Wed, 29 Jun 2011 10:51:22 +0200

What has changed?

Martin

On 28 June 2011 21:50, Marie E. Rognes <[email-masked]> 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     : [email-masked]
> Unsubscribe : https://launchpad.net/~ufl
> More help   : https://help.launchpad.net/ListHelp
>

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Wed, 29 Jun 2011 11:06:40 +0200

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)

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.

Martin

---

From: "Marie E. Rognes" <[email-masked]>
Date: Wed, 29 Jun 2011 12:11:13 +0200

> What has changed?

The generated wrapper code for the auto-adaptive-navier-stokes demo (in 
a crucial way).

--
Marie

> Martin
>
>
> On 28 June 2011 21:50, Marie E. Rognes<[email-masked]>  wrote:
>>

---

From: "Marie E. Rognes" <[email-masked]>
Date: Wed, 29 Jun 2011 12:14:47 +0200

> V = FiniteElement("CG", triangle, 1)

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.)

> 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<[email-masked]>  wrote:
>> What has changed?
>>
>> Martin
>>
>>