← Back to team overview

ffc team mailing list archive

Re: Index() for the mixed elements

 

On Wed, Feb 20, 2008 at 05:50:58PM +0100, Murtazo Nazarov wrote:
> 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

No, you need to use vector operations on these.

-- 
Anders


> /murtazo
> 
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev


References