[firedrake] Solve multiple variational problems at once
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Wed Nov 26 15:18:13 GMT 2014
Hi Anna,
On 26 Nov 2014, at 14:19, Anna Kalogirou <a.kalogirou at leeds.ac.uk> wrote:
> That is what is am doing and it still complains about Mismatching Function Spaces.. So what I have now is, let's say
>
> u1_ = Function(V)
> u2_ = Function(V)
> w = Function(W), where W = V*V
> v = TestFunction(W)
>
> u1, u2 = split(w)
> v1, v2 = split(v) *Here I also tried defining instead v1, v2 = TestFunctions(W).*
>
> F = fn(u1, u2, u1_, u2_; v1)
> G = fn(u1, u2, u1_, u2_; v2)
>
> u1, u2 = w.split() *OR does this need to be after the variational problem is solved?*
> *I tried both with the same outcome.*
>
> solve(F == 0, w)
>
> u1_.assign(u1)
> u2_.assign(u2).
I see. It turns out support for this option is currently unimplemented in the expression assembler (used for assignment here). However, it should be possible, because the functionspaces all match. The code change to allow this was quite small, so I did so. It is currently waiting on code review but should hopefully be in firedrake master soon: you can see the changes here https://github.com/firedrakeproject/firedrake/pull/400.
Cheers,
Lawrence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20141126/daefc0db/attachment.sig>
More information about the firedrake
mailing list