[firedrake] compile problem

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Fri Jul 4 09:57:52 BST 2014


On 03/07/14 21:55, Shipton, Jemma wrote:
> That's just poor copy and pasting! I'll try that branch you mentioned tomorrow...Thanks!
> ________________________________________
> From: firedrake-bounces at imperial.ac.uk [firedrake-bounces at imperial.ac.uk] on behalf of Andrew McRae [a.mcrae12 at imperial.ac.uk]
> Sent: 03 July 2014 21:12
> To: firedrake
> Subject: Re: [firedrake] compile problem
> 
> On second thoughts, I think you're just missing a comma in front of the t=t?
> 
> 
> On 3 July 2014 18:57, Shipton, Jemma <j.shipton at imperial.ac.uk<mailto:j.shipton at imperial.ac.uk>> wrote:
> Hi All,
> 
> Sorry to post a question in the chat and then disappear - I'd lost track of time and needed to dash home. Anyway, I've copied and pasted my question...
> 
> 18:26 < jemma> I have pulled some code Colin added this morning
> 18:27 < jemma> and it doesn't work - although Colin was quite happily running
>                it before he went to watch tennis
> 18:27 < jemma> can anyone see why there'd be a problem with this:
> 18:27 < jemma> u = project(Expression(("1.0 +
> sin(pi*(x[0]-t))*sin(pi*x[1])*cos(pi*t/T0)","cos(pi*(x[0]-t))*cos(pi*x[1])*cos(pi*t/T0)")t=t,T0=T0),V1)
> 18:28 < jemma> where V1 comes from:
> 18:28 < jemma> V1_v = OuterProductElement(IUh1, IUv0)
> 18:28 < jemma> V1_h = OuterProductElement(IUh0, IUv1)
> 18:28 < jemma> V1_elt = HDiv(V1_v) + HDiv(V1_h)
> 18:28 < jemma> V1 = FunctionSpace(mesh,V1_elt)
> 18:28 < jemma> t and T0 are defined
> 18:29 < jemma> maybe I'm missing a ufl/pyop2/something update - I haven't
>                updated in a while...
> 
> When I run the code won't even compile:
> 
> pyop2.exceptions.CompilationError: Unable to compile code
> 
> I've attached the log and err files. The problem seems to be the variables t and T0 in the expression - although they are defined in previous lines:
> 
> t = 0.0
> T0 = 1.0
> 
> The script I'm trying to run is at: https://bitbucket.org/colinjcotter/vertical-tests/src/c1a2a565912564897fdbec05638c530d095176b0/Theta-SSPRK.py?at=default

I think this is because your firedrake is not up-to-date enough.  The
Expressions with user-defined variables arrived on 20th of May.

If you do git branch --contains 2ad90e5 you can see if your local
firedrake branch has it (you may not be up-to-date enough).

Running with current firedrake master this test case works for me.

I also note that that script is not making best use of the user-defined
variables.  You can define the Expression before the timestepping loop
and then just update values inside it (rather than redefining the
Expression):


e.g.

uexpr = Expression(..., t=t, T0=T0)

u = project(uexpr, V)

while t < T:
    uexpr.t = t
    u.project(uexpr)

Cheers,

Lawrence




More information about the firedrake mailing list