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

From: phil marinier <[email-masked]>
Date: Tue, 17 Nov 2009 00:17:29 -0500

> Date: Tue, 17 Nov 2009 01:05:17 +0100
> From: [email-masked]
> To: [email-masked]; [email-masked]
> Subject: Re: [FEniCS-users] "Expecting integrand to be an Expr instance." error
> 
> 
> 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:
> >
> >
> > 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
> >
> 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
> 
> 
> 

Ok so I looked at that demo, very helpful thank you, I was going to try
to use Assemble, but instead I can just create my VariationalProblem
and pass in the MeshFunctions as arguments. And for ds(0), ds(1), etc, the number in the bracket is the marker that you give the subdomain. I got my .ufl file to compile by using ds(0) instead of defining a ds0, so that fixes my problem. Thank you again.

In case you guys would like the information about the error message, I had originally tried compiling the above form file with the boundary term in L instead of in a, but I got the same error message, so I assumed I was doing it wrong and tried putting it in "a" instead, since an example I saw had something like that. I seems like I can't compile anything that uses "Integral." I used the command "ffc -l dolfin Laplace.ufl" to compile.

Thank you again

Phil