← Back to team overview

dolfin team mailing list archive

[Question #142116]: writing a tensor

 

Question #142116 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/142116

Description changed to:
Hi.
I want to write a tensor F_ij, where i,j=0,1,2.
Can you give me a hand?

So not working code is
-------------------------------------------------------------
V = VectorFunctionSpace(sphere, "CG", 1)
v   = TestFunction(V)

ID = Identity(v.cell().d)                 # Identity tensor
F= 0*ID                                       #initializing
F[0][0] = 1*u1                             # u1 is a scalar field.
F[1][1] = 2*u1
F[2][2] = 3*u1
-------------------------------------------------------------

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.