← Back to team overview

ffc team mailing list archive

Re: scalar weight linear element

 

On Wed, Jun 25, 2008 at 11:52:45AM +0200, Vuk Milisic wrote:
> Hello,
> 
> 
> If I have a mixed element and I want a scalar weight
> for instance x[0], is the following piece of code correct ?
> 
> P2 = FiniteElement("Lagrange", "triangle", 2)
> 
> P1 = FiniteElement("Lagrange", "triangle", 1)
> 
> Vh = (P2 + P2 +P2) 
> 
> Th = Vh + P1
> 
> (v, q) = TestFunctions(Th)
> 
> (u, p) = TrialFunctions(Th)
> 
> (phi,pkmu) = Functions (Th)
> 
> Py = Function(P2)
> 
> a=(phi[i]*u[i]*v[i])*Py+pkmu*p*q
> 
> 
> 
> I can't compile that, something's wrong ?

You can't have an index appear three times in a term. The index 'i'
must appear exactly twice.

And you forgot to multiply by dx.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References