Subject: [FEniCS-users] "Expecting integrand to be an Expr instance." error

From: phil marinier <[email-masked]>
Date: Mon, 16 Nov 2009 13:20:11 -0500

I need to define a neumann bc on one edgeof a 2d rectangular domain. When I try to compile my .ufl file, I get this error message:

This is FFC, the FEniCS Form Compiler, version 0.6.2.
For further information, visit http://www.fenics.org/ffc/.

Preprocessing form file: Laplace.ufl --> Laplace.py

Expecting integrand to be an Expr instance.

*** FFC: Expecting integrand to be an Expr instance.
*** FFC: To get more information about this error, rerun FFC with --debug

My .ufl file is as follows:

element = FiniteElement("Lagrange", triangle, 1)

v = TestFunction(element)
u = TrialFunction(element)
f = Function(element)
g = Function(element)

ds0 = Integral("exterior facet", 0)

a = inner(grad(v), grad(u))*dx + v*g*ds0
L = v*f*dx

I explicity defined ds0 so that I can specify which subdomain to define the BC on. I assumed that if I used the default "ds" it would define the BC over the entire circumferance. 
Any help would be appreciated. Thank you

Phil

---

From: Murtazo Nazarov <[email-masked]>
Date: Tue, 17 Nov 2009 01:05:17 +0100

phil marinier wrote:
> **I need to define a neumann bc on one edgeof a 2d rectangular domain. 
> When I try to compile my .ufl file, I get this error message:
>
>
> I explicity defined ds0 so that I can specify which subdomain to 
> define the BC on. I assumed that if I used the default "ds" it would 
> define the BC over the entire circumferance.
You can you the default "ds" only for the subdomain you want to impose
the BC. Take a look to this demo:

demo/pde/elastodynamics/cpp

or this thread:

http://www.fenics.org/pipermail/fenics-users/2009-October/000169.html

murtazo

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 16 Nov 2009 23:23:42 +0000

> a = inner(grad(v), grad(u))*dx + v*g*ds0

This form is not bilinear. The boundary term should be moved to L.

> L = v*f*dx
> 
> 
> I explicity defined ds0 so that I can specify which subdomain to define 
> the BC on. I assumed that if I used the default "ds" it would define the 
> BC over the entire circumferance.

You can do this easily by just using ds(0), ds(1), etc.

Garth

> ------------------------------------------------------------------------
> 
> _______________________________________________
> FEniCS-users mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/fenics-users