← Back to team overview

ffc team mailing list archive

Re: bug in MixedElement.tabulate()

 



2010/1/26 Garth N. Wells <gnw20@xxxxxxxxx>:


Kristian Oelgaard wrote:


2010/1/26 Anders Logg <logg@xxxxxxxxx>:
I'm just about to take off for the Depeche Mode concert in Göteborg
but let's discuss it tomorrow. Or feel free to figure out what
tabulate should do... :-)

OK enjoy, I might have  a look although I have an important Handball
match to watch tonight,

Are you joking?

Hmm, I guess handball is still not very popular (or even known?) in Great Britain.
Denmark is playing Norway and only the winner has a chance of qualifying for the semi-finals in the mens European championships.

Kristian

Garth

but I guess you don't follow the championships
anymore in Sweden? :)

Kristian

--
Anders


On Tue, Jan 26, 2010 at 04:08:07PM +0100, k.b.oelgaard@xxxxxxxxx wrote:
MixedElement.tabulate() produces some mysterious results. Try the
following in a ufl file:

from ffc.fiatinterface import create_element
elem = FiniteElement("Lagrange", triangle, 1)
print create_element(elem).tabulate(1, [(0.333, 0.333)])

This gives:

{(0, 1): array([[-1.0],
      [0.0],
      [1.0]], dtype=object), (1, 0): array([[-1.0],
      [1.0],
      [0.0]], dtype=object), (0, 0): array([[0.334],
      [0.333],
      [0.333]], dtype=object)}

which is correct.

For a vector (mixed) element

elem = VectorElement("Lagrange", triangle, 1)

the result is

{(0, 1): array([[[ 0.334],                                  [ 0.
]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.   ],
       [ 0.334]],

      [[ 0.   ],
       [ 0.333]],

      [[ 0.   ],
       [ 0.333]]]), (1, 0): array([[[ 0.334],
       [ 0.   ]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.   ],
       [ 0.334]],

      [[ 0.   ],
       [ 0.333]],

      [[ 0.   ],
       [ 0.333]]]), (0, 0): array([[[ 0.334],
       [ 0.   ]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.333],
       [ 0.   ]],

      [[ 0.   ],
       [ 0.334]],

      [[ 0.   ],
       [ 0.333]],

      [[ 0.   ],
       [ 0.333]]])}

which is very wrong. I had a look at the code in
MixedElement.tabulate(), but couldn't figure out what was going on.

Kristian




_______________________________________________
Mailing list: https://launchpad.net/~ffc
Post to     : ffc@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ffc
More help   : https://help.launchpad.net/ListHelp


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAktfBtEACgkQTuwUCDsYZdE/DACfYRm5wWiLHtVoRDMmw9syr9vA
JnYAnjJHHAtl0oST5d9aMjJ0acbtb7rE
=qBbe
-----END PGP SIGNATURE-----




------------------------------------------------------------------------

_______________________________________________
Mailing list: https://launchpad.net/~ffc
Post to     : ffc@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ffc
More help   : https://help.launchpad.net/ListHelp


Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References