In the scalar approach, are you also redefining Q at each time step? ...just checking On 30 September 2015 at 15:46, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Yes I update the time component of the expession at every time step.
On 30/09/15 15:38, Andrew McRae wrote:
Are you performing the interpolation every time step?
On 30 September 2015 at 15:36, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
The solution behaves as expected when I define Q as a function, but in the other case there seems to be some kind of instability and I get a very strange result.
Anna.
On 30/09/15 15:28, Lawrence Mitchell wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 30/09/15 15:19, Anna Kalogirou wrote:
Dear all,
I have a very simple, yet not so obvious - to me at least - question:
If I define an expression which does not depend on space variables, for example
Q_expr = Expression("A*sin(2*pi*F*t)", t=t, A=A, F=F) Q.interpolate(Q_expr)
shouldn't this be equivalent to just writing Q as a scalar,
Q = A*sin(2*pi*F*t) ?
This quantity Q is then used in a weak form to multiply the test function v on a boundary, e.g. Q*v*ds_v(1).
I get different results for the two cases. Clearly, in the 1st case Q is a function while in the 2nd case it is a scalar, but I don't see why this would give different results. I might be missing something obvious here... These ought to be equivalent. But can you describe how they are different?
Lawrence.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEcBAEBAgAGBQJWC/GPAAoJECOc1kQ8PEYvGncIAM7WI2JkrZ5Y1wZMyJAHNDJG Ca476ZQcNCzKsZ/ntPL9SoXsbXu4Uu2mIVuT4r30VBc/NAEuBdkKppVmiwS3DTsP qzLVP2nRL1ENxYWOUk8pWryE/jffyPP9ny5gHoRLPP/09vL3e4y8jKplw0bmKMgZ UVvcp+kL1hqFujvCddxpym8gg4Y3UrMTdD2MaYJ8WHaFeqB9ZPNWomv24ZKKWhHU HAms5sgsNedvdrgIY32AH2AARRysk4AsLsfjYymsiXPrOyPrlG5V2Muf4gKdqID1 MRWiL7p6ZVxLnOytF4NtFRUItYLKcOrv487IIIHVfl+TVvmKO+IJpXDyx5wyZcY= =EkO8 -----END PGP SIGNATURE-----
_______________________________________________ firedrake mailing list firedrake@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/
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing listfiredrake@imperial.ac.ukhttps://mailman.ic.ac.uk/mailman/listinfo/firedrake
--
Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds
Yes, I double - and triple - checked and I believe I am doing the same thing in both approaches. I don't understand then why the results are different. On 30/09/15 15:48, Andrew McRae wrote:
In the scalar approach, are you also redefining Q at each time step?
...just checking
On 30 September 2015 at 15:46, Anna Kalogirou <a.kalogirou@leeds.ac.uk <mailto:a.kalogirou@leeds.ac.uk>> wrote:
Yes I update the time component of the expession at every time step.
On 30/09/15 15:38, Andrew McRae wrote:
Are you performing the interpolation every time step?
On 30 September 2015 at 15:36, Anna Kalogirou <a.kalogirou@leeds.ac.uk <mailto:a.kalogirou@leeds.ac.uk>> wrote:
The solution behaves as expected when I define Q as a function, but in the other case there seems to be some kind of instability and I get a very strange result.
Anna.
On 30/09/15 15:28, Lawrence Mitchell wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 30/09/15 15:19, Anna Kalogirou wrote: >> Dear all, >> >> I have a very simple, yet not so obvious - to me at least - >> question: >> >> If I define an expression which does not depend on space variables, >> for example >> >> Q_expr = Expression("A*sin(2*pi*F*t)", t=t, A=A, F=F) >> Q.interpolate(Q_expr) >> >> shouldn't this be equivalent to just writing Q as a scalar, >> >> Q = A*sin(2*pi*F*t) ? >> >> This quantity Q is then used in a weak form to multiply the test >> function v on a boundary, e.g. Q*v*ds_v(1). >> >> I get different results for the two cases. Clearly, in the 1st case >> Q is a function while in the 2nd case it is a scalar, but I don't >> see why this would give different results. I might be missing >> something obvious here... > These ought to be equivalent. But can you describe how they are > different? > > > Lawrence. > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > > iQEcBAEBAgAGBQJWC/GPAAoJECOc1kQ8PEYvGncIAM7WI2JkrZ5Y1wZMyJAHNDJG > Ca476ZQcNCzKsZ/ntPL9SoXsbXu4Uu2mIVuT4r30VBc/NAEuBdkKppVmiwS3DTsP > qzLVP2nRL1ENxYWOUk8pWryE/jffyPP9ny5gHoRLPP/09vL3e4y8jKplw0bmKMgZ > UVvcp+kL1hqFujvCddxpym8gg4Y3UrMTdD2MaYJ8WHaFeqB9ZPNWomv24ZKKWhHU > HAms5sgsNedvdrgIY32AH2AARRysk4AsLsfjYymsiXPrOyPrlG5V2Muf4gKdqID1 > MRWiL7p6ZVxLnOytF4NtFRUItYLKcOrv487IIIHVfl+TVvmKO+IJpXDyx5wyZcY= > =EkO8 > -----END PGP SIGNATURE----- > > _______________________________________________ > firedrake mailing list > firedrake@imperial.ac.uk <mailto:firedrake@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/ <http://www1.maths.leeds.ac.uk/%7Ematak/>
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@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/ <http://www1.maths.leeds.ac.uk/%7Ematak/>
_______________________________________________ firedrake mailing list firedrake@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/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 30/09/15 15:51, Anna Kalogirou wrote:
Yes, I double - and triple - checked and I believe I am doing the same thing in both approaches. I don't understand then why the results are different.
Hmph, can you show us some breaking code? Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWC/imAAoJECOc1kQ8PEYvalEH/2z+lJMa3od/bKUbcbW73imx i3In1Wg9ZKVGeZG8VmVlcnirkr38EgzIi5ZoRZVtGQ6tmWsXTCwojfqsaLUv5k+b fWma1V9FWp8Vk6XSo8eqR+5oV0CBH0KRZtN8sZdGGqBm2QY5PBrQSyYcy5XHunIm h/mc7tT8oLRQKaPwYxuDt8WBtzc+BdNZPexLbGEa921qE1ms/SemDk85GbOQ5oqr oqvqfxpyrzwMBlPjz7GLN697u7r15e+qwGFni0Z6x3YsaBUF1OKXq7k0FvT5ObeI t30lYnhlxxKbbZQh1NI7goAZ7RUEd5RgAge2wUXN3V8EDyKVqzooRso1GGKGAwg= =jk88 -----END PGP SIGNATURE-----
I was just ready to send you a code when I realised what the problem was. When I define Q as a scalar expression, updating it after every time step does not update the expression in the weak form (I define a and L outside the time loop and then just call the solver at every time step). Defining the expression by Q_expr = Expression("A*sin(2*pi*F*t)", t=t, A=A, F=F) Q.interpolate(Q_expr) and updating it by Q_expr.t = t works though. Therefore I had to re-define the linear and bilinear parts of the weak form inside the time loop for the first approach to work. On 30/09/15 15:58, Lawrence Mitchell wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 30/09/15 15:51, Anna Kalogirou wrote:
Yes, I double - and triple - checked and I believe I am doing the same thing in both approaches. I don't understand then why the results are different. Hmph, can you show us some breaking code?
Lawrence
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEcBAEBAgAGBQJWC/imAAoJECOc1kQ8PEYvalEH/2z+lJMa3od/bKUbcbW73imx i3In1Wg9ZKVGeZG8VmVlcnirkr38EgzIi5ZoRZVtGQ6tmWsXTCwojfqsaLUv5k+b fWma1V9FWp8Vk6XSo8eqR+5oV0CBH0KRZtN8sZdGGqBm2QY5PBrQSyYcy5XHunIm h/mc7tT8oLRQKaPwYxuDt8WBtzc+BdNZPexLbGEa921qE1ms/SemDk85GbOQ5oqr oqvqfxpyrzwMBlPjz7GLN697u7r15e+qwGFni0Z6x3YsaBUF1OKXq7k0FvT5ObeI t30lYnhlxxKbbZQh1NI7goAZ7RUEd5RgAge2wUXN3V8EDyKVqzooRso1GGKGAwg= =jk88 -----END PGP SIGNATURE-----
_______________________________________________ firedrake mailing list firedrake@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/
participants (3)
- 
                
                Andrew McRae
- 
                
                Anna Kalogirou
- 
                
                Lawrence Mitchell