Subject: [FFC-dev] Index() for the mixed elements

From: Murtazo Nazarov <[email-masked]>
Date: Wed, 20 Feb 2008 17:50:58 +0100

Hi,

I am trying to use Index() in mixed elements in FFC. But it always gives me
an error. I could not find an example of this type.

Does Index() work for mixed elements?

Here is peace of my code:

...
TH = scalar + vector + scalar

(v1,v2,v3) = TestFunctions(TH)
(u1, u2, u3) = TrialFunctions(TH)
...
i = Index();
j = Index();
...
a = v2[i]*u1[i]*dx
...

It give the error:

   a = v2[i]*u2[i]*dx
TypeError: object cannot be interpreted as an index

/murtazo

---

From: Anders Logg <[email-masked]>
Date: Mon, 25 Feb 2008 22:46:59 +0100

> TypeError: object cannot be interpreted as an index

No, you need to use vector operations on these.

-- 
Anders

> /murtazo
> 
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev