[firedrake] Solve multiple variational problems at once

Anna Kalogirou a.kalogirou at leeds.ac.uk
Wed Nov 26 12:24:48 GMT 2014


Do I still need to define u1, u2, u3 = Functions(V), where V is in 
original space? After the variational problem is solved I split w as

u1, u2, u3 = split(w)

and try to print u1, u2, u3 in files, but I get

AttributeError: 'Indexed' object has no attribute 'function_space'.

Also, I can't interpolate or assign. In the end, I want to pass u1, u2, 
u3 to some other functions u1_, u2_, u3_, which also appear in the 
residual expressions. But this produces a 'Mismatching function spaces' 
error.




On 26/11/14 11:12, David Ham wrote:
> Actually, assuming the original problems were written so that v is in 
> the same space as u1, which is how I read the spec, then this is 
> ill-posed. Instead you need to pull the test function from the mixed 
> space too.
>
> W = MixedFunctionSpace(...)
>
> w = Function(W)
> v = TestFunction(W)
>
> u1, u2, u3 = split(w)
> v1, v2, v3 = split(v)
>
> F = fn(u1, u2, u3; v1)
> etc...
>
>
> solve(F + G + H == 0, w)
>
> On 26 November 2014 at 10:28, Mitchell, Lawrence 
> <lawrence.mitchell at imperial.ac.uk 
> <mailto:lawrence.mitchell at imperial.ac.uk>> wrote:
>
>     -----BEGIN PGP SIGNED MESSAGE-----
>     Hash: SHA1
>
>     On 26/11/14 10:19, Anna Kalogirou wrote:
>     > Dear all,
>     >
>     > How would I solve multiple nonlinear variational problems
>     > simultaneously? For example, say that I have three residuals
>     >
>     > F(u1,u2,u3;v) = 0 G(u1,u2,u3;v) = 0 H(u1,u2,u3;v) = 0,
>     >
>     > where v is the test function. I need to solve all three of them
>     > together. Any suggestions?
>
>     Assuming you have:
>
>     W = MixedFunctionSpace(...)
>
>     w = Function(W)
>
>     u1, u2, u3 = split(w)
>
>     F = fn(u1, u2, u3; v)
>     etc...
>
>     Since you're linear in v, can you not just write:
>
>
>     solve(F + G + H == 0, w)
>
>     ?
>
>     Or am I missing something?
>
>     Lawrence
>
>     -----BEGIN PGP SIGNATURE-----
>     Version: GnuPG v1.4.10 (GNU/Linux)
>     Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
>     iQEcBAEBAgAGBQJUdas2AAoJECOc1kQ8PEYvGzIIAM/PQ/7o82RvhWC2StXETQtm
>     ub5cvB+sj6ceqyE73L4bJzMjNvqdjSMy61QcCErho6nyeviqtvCDKbih98Sy7tut
>     7QMKLFQgwB1JdtnmdU4Rc5cm6pDDo2LPE07pbHmRSAl7XUH0GZTcqRAJoBubEzcn
>     BxcF0vRAgr++Y+4ak+Snt2k950k2mf3jE4Q3oA/KpkL8nVfEkBWU5ACb23CbKLAD
>     lO5ZrOFuSYHoyj+Fcn8aEsrBGHEDwv6GhNoyWqo46speLCEamJN1E5D7KxYXuTCj
>     W5lNHMPM0VeWvEiH69j4CidRbCo5Mba7rwVYJMzDWiXa0/avuFDlq2oOzxmIIIs=
>     =BZY9
>     -----END PGP SIGNATURE-----
>
>     _______________________________________________
>     firedrake mailing list
>     firedrake at imperial.ac.uk <mailto:firedrake at imperial.ac.uk>
>     https://mailman.ic.ac.uk/mailman/listinfo/firedrake
>
>
>
>
> -- 
> Dr David Ham
> Departments of Mathematics and Computing
> Imperial College London
>
> http://www.imperial.ac.uk/people/david.ham

-- 
  
  Dr Anna Kalogirou
  Research Fellow
  School of Mathematics
  University of Leeds

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the firedrake mailing list