Subject: [Fenics-ufc] Order scheme in local tensor A and coefficent w

From: Andre Massing <[email-masked]>
Date: Wed, 09 Jun 2010 15:56:13 +0200

Hi there!

ATM I am manually hacking the autogenerated form for the elasticity 
example and I was wondering about the order of the coefficents and the 
entries in the local tensor for the tabulate_tensor function in the ufc 
interface. I looked at the ufc manual, but the order is not stated 
there, it only says A should be of the size local dimension * rank and 
size of the arrays w[0], w[1] should be equal the dim of the local fe 
space. But for VectorElements that is still some ambiguity:

So let's say I have as in the elasticity example

element = VectorElement("Lagrange", "tetrahedron", 1)

v = TestFunction(element)
u = TrialFunction(element)
f = Coefficient(element)

lmbda = Constant("tetrahedron")
mu    = Constant("tetrahedron")

We have 4 basis function phi_i with 3 components phi_i^j and say the 3 
components f^j for the load vector.

For the assembly of the linearform \int f * v an array A of length 12 is 
used, so are the entries computed by

A[0] = f^0 * phi_0^0 //first basis function first comp
A[1] = f^1 * phi_0^1 //first basis function second comp
A[2] = f^2 * phi_0^2 //first basis function third comp
A[3] = f^0 * phi_1^0 //second basis function first comp
...
or that way:
A[0] = f^0 * phi_0^0 //first basis function first comp
A[1] = f^0 * phi_1^0 //second basis function first comp
A[2] = f^0 * phi_2^0 //third basis function first comp
A[3] = f^0 * phi_3^0 //fourth basis function first comp
A[4] = f^1 * phi_0^1  //first basis function second component
...	
?

Same question arises for the component array w, but I could answer this 
question myself from reading the code if knew the answer for A :)

Regards,
Andre

---

From: Kristian Oelgaard <[email-masked]>
Date: Thu, 10 Jun 2010 16:24:49 +0200

On 9 June 2010 15:56, Andre Massing <[email-masked]> wrote:
> Hi there!
>
> ATM I am manually hacking the autogenerated form for the elasticity example
> and I was wondering about the order of the coefficents and the entries in
> the local tensor for the tabulate_tensor function in the ufc interface. I
> looked at the ufc manual, but the order is not stated there, it only says A
> should be of the size local dimension * rank and size of the arrays w[0],
> w[1] should be equal the dim of the local fe space. But for VectorElements
> that is still some ambiguity:
>

This element has 12 dofs which are:

   comp 0   comp 1   comp 2
[  0,1,2,3,  4,5,6,7,  8,9,10,11]

because it is a mixed element:
element = MixedElement([CG1, CG1, CG1])

For mixed-mixed elements you just extend the procedure.

> A[4] = f^1 * phi_0^1  //first basis function second component

This one.

Kristian

> _______________________________________________
> Mailing list: https://launchpad.net/~fenics-ufc
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~fenics-ufc
> More help   : https://help.launchpad.net/ListHelp
>