defining a varying 2nd order tensor

Asked by Sungick Kim

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] ] )

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Sungick Kim
Solved:
Last query:
Last reply:
Revision history for this message
Sungick Kim (sungick) said :
#1

https://answers.launchpad.net/dolfin/+question/102501

I can write the tensor that way. FEniCS doesn't complain about it.
But I think that it's not solving problem.
Here are code and the result

<my code>
f00 = Expression("(10.45-9.96)/10.45 *u1c")
f11 = Expression("(5.58-6.05)/5.58 *u1c")
f22 = Expression("(4.86-4.74)/4.86 *u1c")
z = Constant(0.0)
F2= as_matrix( (f00,z,z),(z,f11,z),(z,z,f22) )

F1 = I + grad(u2c)
F = F1*F2 # Deformation gradient

<result>

(1) computing Transport problem
  Solving nonlinear variational problem
    Starting Newton solve.
      Applying boundary conditions to linear system.
      Applying boundary conditions to linear system.
      Solving linear system of size 7381 x 7381 (PETSc LU solver, umfpack).
      Applying boundary conditions to linear system.
      Newton iteration 1: r (abs) = 0.000e+00 (tol = 1.000e-10) r (rel) = -nan (tol = 1.000e-14)

Revision history for this message
Sungick Kim (sungick) said :
#2

Thank you, Johan Hake.