dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #20839
[Question #142110]: defining a varying 2nd order tensor
Question #142110 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/142110
Description changed to:
Hi.
I want to define a 2nd order 3X3 tensor.
I guess that 'project' function is needed.
my current code is
Q = FunctionSpace(mesh, "CG", 1)
D = TensorConstant(tetrahedron)
#I want to define D = as_matrix( [ [D0,0,0], [0,D1,0], [0,0,D2] ] )
D0 = Expression(10+100/(1+exp(-20*(u1-0.5))) ) # where u1 is a scalar field
D1 = Expression(1+10/(1+exp(-20*(u1-0.5))) )
D2 = 0
D = as_matrix( [ [D0,0,0], [0,D1,0], [0,0,D2] ] )
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.