tensor multiplication in weak form
Hello there,
I have some problems in multiplying tensors in the weak formulation.
Maybe it is a problem of the assemble function... Would be great, if someone can help me.
Here is my little code:
#start
from dolfin import *
#mesh
mesh = Rectangle(0.0, 0.0, 1.0, 1.0, 10, 10)
# Define function spaces
V = VectorFunctionS
# Define trial and test functions
U = TrialFunction(V)
T_U = TestFunction(V)
i,k = indices(2)
Form = T_U[i].dx(k) * (U[i]*U[k])*dx
#lefthandside of Form
a = lhs(Form)
# Assemble matrices
A = assemble(a)
#end
I wonder, why it doesn't work?
U[i]*U[k]
ist just a tensor like
U[i].dx(k)
.
And with
Form = T_U[i].dx(k) * U[i].dx(k)*dx
or
inner(grad(T_U), grad(U))
it works perfectly. But unfortunately not what I want:-(
So is there a way to assemble these ''strange'' tensors?
Thank you very much ans best regards,
Robert
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask robert kersting for more information if necessary.