Subject: [Ufl] UFL and project.py

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 27 Jan 2010 20:34:37 +0000

I'm trying to perform a projection of a function from PyDOLFIN for 
plotting purposes and I'm letting DOLFIN figure out the function space, 
but I get the below error. Has 'extract_functions' been re-named in the 
recent UFL changes?

Garth

Traceback (most recent call last):
   File "solver.py", line 65, in <module>
     eps_file << project(u[0].dx(0) + u[1].dx(1) + u[2].dx(2))
   File 
"/home/garth/code/fenics/dolfin/dolfin-all/local/lib/python2.6/site-packages/dolfin/fem/project.py", 
line 42, in project
     V = _extract_function_space(v)
   File 
"/home/garth/code/fenics/dolfin/dolfin-all/local/lib/python2.6/site-packages/dolfin/fem/project.py", 
line 69, in _extract_function_space
     functions = ufl.algorithms.extract_functions(expression)
AttributeError: 'module' object has no attribute 'extract_functions'

---

From: Anders Logg <[email-masked]>
Date: Wed, 27 Jan 2010 22:00:48 +0100

On Wed, Jan 27, 2010 at 08:34:37PM +0000, Garth N. Wells wrote:
> plotting purposes and I'm letting DOLFIN figure out the function
> space, but I get the below error. Has 'extract_functions' been
> re-named in the recent UFL changes?
>
> Garth
>
>   File "/home/garth/code/fenics/dolfin/dolfin-all/local/lib/python2.6/site-packages/dolfin/fem/project.py",
> line 42, in project
>   File "/home/garth/code/fenics/dolfin/dolfin-all/local/lib/python2.6/site-packages/dolfin/fem/project.py",

Yes, it's now name extract_coefficients.

This was part of the big change from Function to Coefficient inside
UFL.

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 27 Jan 2010 21:33:41 +0000

> Yes, it's now name extract_coefficients.

OK. I just pushed a fix (and changed a demo to help pick up any future
problems).

Garth