Subject: Re: [Ffc] [Branch ~ffc-core/ffc/dev] Rev 1502: Fixes for covariant piola. Marie finally remembered why it should be

From: Kristian Oelgaard <[email-masked]>
Date: Thu, 21 Jan 2010 15:19:48 +0100 (CET)

2010/1/21  <[email-masked]>:
> ------------------------------------------------------------
> revno: 1502
> committer: Marie E. Rognes <[email-masked]>
> branch nick: ffc-unstable
> timestamp: Thu 2010-01-21 15:13:40 +0100
> message:
>  Fixes for covariant piola. Marie finally remembered why it should be
>  (j, i) instead of (i, j).

Cool, I guess this means that the indices is based on some theory after all :)

Kristian

> modified:
>  ffc/evaluatedof.py
>  ffc/interpolatevertexvalues.py
>
>
> --
> lp:~ffc-core/ffc/dev
> https://code.launchpad.net/~ffc-core/ffc/dev
>
> You are subscribed to branch lp:~ffc-core/ffc/dev.
> To unsubscribe from this branch go to https://code.launchpad.net/~ffc-core/ffc/dev/+edit-subscription.
>
> === modified file 'ffc/evaluatedof.py'
> --- ffc/evaluatedof.py  2010-01-18 20:24:30 +0000
> +++ ffc/evaluatedof.py  2010-01-21 14:13:40 +0000
> @@ -199,7 +199,7 @@
>
>     'covariant piola' mapping for g:
>
> -      G(X) = J g(x)          i.e  G_i(X) = J_ij g_j(x)
> +      G(X) = J^T g(x)          i.e  G_i(X) = J^T_ij g(x) = J_ji g_j(x)
>     """
>
>     # meg: Various mappings must be handled both here and in
> @@ -223,9 +223,9 @@
>         # covariant piola
>         values = []
>         for i in range(dim):
> -            jacobian_row = [J(i, j) for j in range(dim)]
> +            jacobian_column = [J(j, i) for j in range(dim)]
>             components = [component("vals", j + offset) for j in range(dim)]
> -            values += [inner(jacobian_row, components)]
> +            values += [inner(jacobian_column, components)]
>         return values
>     else:
>         raise Exception, "The mapping (%s) is not allowed" % mapping
>
> === modified file 'ffc/interpolatevertexvalues.py'
> --- ffc/interpolatevertexvalues.py      2010-01-15 16:38:25 +0000
> +++ ffc/interpolatevertexvalues.py      2010-01-21 14:13:40 +0000
> @@ -4,7 +4,7 @@
>  __copyright__ = "Copyright (C) 2009"
>  __license__  = "GNU GPL version 3 or any later version"
>
> -# Last changed: 2010-01-15
> +# Last changed: 2010-01-21
>
>  from ffc.codesnippets import jacobian
>  from ffc.cpp import format, remove_unused
> @@ -120,7 +120,7 @@
>
>     'covariant piola' mapping for f:
>
> -      g(x) = K G(X)              i.e   g_i(x) = K_ij G_j(X)
> +      g(x) = K^T G(X)              i.e   g_i(x) = K^T_ij G_j(X) = K_ji G_j(X)
>     """
>
>     if mapping is "affine":
> @@ -130,7 +130,7 @@
>                                                                      [G[j][index] for j in range(dim)])])
>                                             for index in range(space_dim)]
>     elif mapping == "covariant piola":
> -        change_of_variables = lambda G, i: [inner([Jinv(i, j) for j in range(dim)],
> +        change_of_variables = lambda G, i: [inner([Jinv(j, i) for j in range(dim)],
>                                                   [G[j][index] for j in range(dim)])
>                                             for index in range(space_dim)]
>     else:
>
>
>

---

From: Anders Logg <[email-masked]>
Date: Thu, 21 Jan 2010 15:42:13 +0100

> Cool, I guess this means that the indices is based on some theory after all :)

I doubt it.

H(div) and H(curl) elements are mostly trial and error. :-)

Same for Pk elements for k > 2.

--
Anders

---

From: Harish Narayanan <[email-masked]>
Date: Thu, 21 Jan 2010 15:15:25 +0000

> Cool, I guess this means that the indices is based on some theory after

Would the reason why the covariant Piola map doesn't contain a det(J)
but the contravariant Piola does be clarified on reading
RognesKirbyEtAl2009?

Harish

---

From: Marie Rognes <[email-masked]>
Date: Thu, 21 Jan 2010 16:46:07 +0100

> but the contravariant Piola does be clarified on reading

Yes.

--
Marie

---

From: Harish Narayanan <[email-masked]>
Date: Thu, 21 Jan 2010 18:32:53 +0000

>> but the contravariant Piola does be clarified on reading

Excellent. I am curious to find out.

Harish