[firedrake] Solve a Variational problem in a part of the domain
Anna Kalogirou
a.kalogirou at leeds.ac.uk
Thu Aug 13 12:09:25 BST 2015
Dear all,
I have a system of equations to solve, which involves three space
dependent functions phi, eta, lambda and two constants/scalars Z, W.
These need to be solved simultaneously because all the equations involve
at least 2 unknowns.
How do I solve that, considering that one of the scalar equations
includes a spacial integral of one of the (still unknown) functions? Is
it best to define the scalars as Constants?
This problem goes away when I write down the system in a standard FEM
formulation, introducing the mass matrix etc. In this case, it is clear
that I could solve for that function and then consecutively solve each
of the remaining 4 equations. It is not that obvious how I can do that
using Firedrake, that is why I thought I would have to solve
simultaneously, but then I have the problem described above.
Regards,
Anna.
On 06/08/15 11:04, Lawrence Mitchell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Anna,
>
> On 06/08/15 10:37, Anna Kalogirou wrote:
>> Dear all,
>>
>> I have a rather simple question but I would like to get some
>> feedback from someone in the Firedrake team.
>>
>> I am now working on the problem which includes solving a
>> variational problem in a part of the domain only (a water wave
>> problem which includes a floating body).
>>
>> I can think of a couple of possible solutions on how to solve this:
>> 1. Define two domains and solve the problem separately in each
>> domain. However, I will have to deal with nonzero boundary
>> conditions on the common boundary.
>>
>> 2. I prefer solving the problem in the whole domain, since most of
>> the equations/functions are valid everywhere. Then I can define a
>> Heavyside step function which will be 0 in one part and 1 in the
>> part of the domain I am interested in (under the floating body). I
>> will essentially write down a variational problem valid everywhere,
>> but will actually be zero in a part of the domain.
>>
>> Is the 2nd step a good approach? The question essentially is how
>> to split a mass matrix M_kl which is defined everywhere, and solve
>> and integral form in a part of the domain only.
> I think step two is a fine approach. However, note the following
> issues at present. The way you would have to do this currently is as
> follows:
>
> Define a DG0 field to hold your indicator function
>
> indicator = Function(DG0)
>
> # Set it to 1 in the appropriate part of the domain
> indicator.interpolate(...)
>
> # Now use this extra field everywhere when defining your variational
> # problem.
>
> However, all your integrals are still over the whole domain, you just
> pick up lots of zeros.
>
> Steadily climbing our todo list (and at an increasing pace, I feel),
> is the ability to define proper sub domains in a mesh, and then be
> able to perform integrals over them. Until that time, I think
> approach 2 is somewhat easier to do than approach 1.
>
> Cheers,
>
> LAwrence
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJVwzElAAoJECOc1kQ8PEYvGswIAN+Mr6hD+U0NmsnZAGminaq+
> j/SqmI+o7GlbXRSgPqEfrpyWwFiiFVN6DnPmTboRooZr3h93ZhGDhECQ/O12XKA/
> 00yNuCiDn4YBaXJamWBM6u8ILdZYGMyVNTG1JOaZZIMBoiIkrTyYpXatGApcE4sD
> 4T+DoAYSUEY7u6MV4eJmRc1lzZEd8Rw43YP+Viy0itCs2jKV+HsDpvpvu1DU/FSQ
> zMeE/cRR8It6aImk1L3OON8Zo2ZB0HNirK6YuD3sMkIoqLEYANnNl8qaeU3LL227
> 3TL4ddkALXQLGaYGo5ETgtMKI6afNDIsfjwGUcVRhTTxHM3GKOMQgWV6miNtgv4=
> =wE25
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> firedrake mailing list
> firedrake at imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
--
Dr Anna Kalogirou
Research Fellow
School of Mathematics
University of Leeds
http://www1.maths.leeds.ac.uk/~matak/
More information about the firedrake
mailing list