Projection of Second order Tensor


146
views
0
4 months ago by
Hello all,

I am trying to define initial values of plastic strain as zeros(3,3) on the functionspace. Actually, I both tried as matrix and voigt notation but could not manage it. I tried the following:
Vepspn=VectorFunctionSpace(mesh,"CG",1,dim=6)
epspn=Coefficient(Vepspn)
abc=Constant((0.0,0.0,0.0,0.0,0.0,0.0))
epspn=project(abc,Vepspn) 
​

but it see my epspn variable as <class 'dolfin.functions.function.Function'> but not <class 'ufl.tensors.ListTensor'> How can I transform it to ListTensor ?

Best Regards

Community: FEniCS Project

1 Answer


1
4 months ago by

You can define a function space of tensors and then project your plastic strain or use a ListTensor object, however, if you want to update your tensor I think that the first option is better (or you can create a ListTensor object of scalar functions):

# 1
V = TensorFunctionSpace(mesh, 'CG', 1, shape=(3,3), symmetry=True) # symmetry=False?
abc = Constant(((0, 0, 0), (0,0,0), (0,0,0)))
epspn = project(abc, V)

# 2
epspn = as_tensor([[0,0,0],[0,0,0],[0,0,0]])
Please login to add an answer/comment or follow this question.

Similar posts:
Search »