I want to couple two different problems. One gives me a stress tensor (sigma[i,j]) (For example out of an hyperelastic problem). And then i want to use this stress tensor to calculate a "vector field" for the second problem. I want to calculate the components of the vector field in the following way:
n = Constant((1.0,0.0)
m = Constant((0.0,1.0)
tau_1=m[i]*sigma[i,j]*n[j]
tau_2=n[i]*sigma[i,j]*m[j]
Now i want to create a "vector field" using tau_1 and tau_2:
V = [tau_1,tau_2]
At the end this V will be used to assemble the following K matrix:
Tr = TrialFunction(FunctionSpace(mesh,'CG',1)
Ts = TestFunction(FunctionSpace(mesh,'CG',1)
K = assemble(-div(Tr*V)*Ts*dV)
To show u what i need: I was able to assemble K with a simplified version of V using "expression" and "interpolation":
V_expression = Expression(('0.1,0.0),degree=2,domain=mesh)
V = interpolate(V_expression, VectorFunctionSpace(mesh,'CG',1))
But this simplified version is not sufficient. This simple V is constant in the whole area/mesh and i need it to be dependent on sigma and by that dependent on the location. So is it possible to implement the version above?
Im not sure, if explanation is adequate. Please say if not. Thanks a lot.