[firedrake] .dx without operand

Asbjørn Nilsen Riseth riseth at maths.ox.ac.uk
Tue Jun 30 08:27:24 BST 2015


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 at 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 at 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 at 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 at imperial.ac.uk
>> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
>>
>>
> _______________________________________________
> firedrake mailing list
> firedrake at imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the firedrake mailing list