Thanks. I am now doing this with: https://gist.github.com/ctjacobs/ca7545b55a1f3f1fd2a8

I now need to integrate this by parts for DG but I'm not sure how to re-write the UFL to express this. Any ideas?

On 30 June 2015 at 08:27, Asbjørn Nilsen Riseth <riseth@maths.ox.ac.uk> wrote:
Have you considered using a binomial expansion? 
Should be possible with a for loop?

On Tue, 30 Jun 2015 at 08:23 Christian Jacobs <c.jacobs10@imperial.ac.uk> wrote:
As Martin pointed out in a previous thread, .dx(*((0,)*k)) would do the job for expressing d^ku/dx^k, but I can't hard code something like this in as I don't know what the individual terms would look like in advance for arbitrary k.

On 29 June 2015 at 19:58, Andrew McRae <a.mcrae12@imperial.ac.uk> wrote:
I don't *think* so (I might be wrong -- Martin?), but what about .dx(0).dx(0)?

On 29 June 2015 at 19:54, Jacobs, Christian T <c.jacobs10@imperial.ac.uk> wrote:
I'm trying to express the following in UFL: http://amcg.ese.ic.ac.uk/~ctj10/images/k.png where A and B are matrices and u is a vector of solution variables.

For the case of k=1 I can write e.g.

-1*([1*u[0].dx(0) + 2*u[1].dx(0) + 5*u[0].dx(1) + 6*u[1].dx(1), 3*u[0].dx(0) + 4*u[1].dx(0) + 7*u[0].dx(1) + 8*u[0].dx(0)])

But how can I write this for k>1? Having e.g. (1*u[0].dx(0) + 2*u[0].dx(1) + ...)**2 will result in terms that represent (du/dx)**2 not (d**2)u/(dx**2). Is there a way of expressing .dx() (of arbitrary order) without an operand in UFL, so we can just have d^k/dx^k ?


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake

_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake