Cannot assemble simple Expression (norm of Expression not working)

Bug #497509 reported by Johan Hake
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Undecided
Unassigned

Bug Description

from dolfin import *
f = Expression("sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2])")
mesh = UnitCube(2,2,2)
n = norm(f, mesh=mesh)

Raise:
UFLException: Unable to extract form data. Reason: Missing cell definition in form.

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 497509] [NEW] Cannot assemble simple Expression (norm of Expression not working)

On Wed, Dec 16, 2009 at 06:59:33PM -0000, Johan Hake wrote:
> Public bug reported:
>
> from dolfin import *
> f = Expression("sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2])")
> mesh = UnitCube(2,2,2)
> n = norm(f, mesh=mesh)
>
> Raise:
> UFLException: Unable to extract form data. Reason: Missing cell definition in form.
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New

I'm on it.

--
Anders

Revision history for this message
Anders Logg (logg) wrote :

I have added an optional argument cell to Expression which means you
can do this:

  from dolfin import *
  f = Expression("sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2])", cell="tetrahedron")
  mesh = UnitCube(2,2,2)
  n = norm(f, mesh=mesh)

But we should ultimately figure out the cell in assemble. The mesh
argument is passed there and it could figure out the cell type and
send that along to the JIT compiler. But that will have to wait until
the new reorganized version of FFC is ready.

--
Anders

On Wed, Dec 16, 2009 at 06:59:33PM -0000, Johan Hake wrote:
> Public bug reported:
>
> from dolfin import *
> f = Expression("sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2])")
> mesh = UnitCube(2,2,2)
> n = norm(f, mesh=mesh)
>
> Raise:
> UFLException: Unable to extract form data. Reason: Missing cell definition in form.
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>

Revision history for this message
Garth Wells (garth-wells) wrote :

Is this bug resolved now?

Revision history for this message
Anders Logg (logg) wrote :

Should be fixed now.

Changed in dolfin:
status: New → Fix Committed
Anders Logg (logg)
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.