assemble error: All terms in form must have same rank
Hello,
i am facing the "All terms in form must have the same rank" error while trying to assamble a form. Here is a minimal code:
meshsize = 32
mesh = UnitSquare(
V = FunctionSpace(mesh, "CG", 1)
R = FunctionSpace(mesh, "R", 0)
Q = VectorFunctionS
W = MixedFunctionSp
v = TestFunction(W)
class State(object):
def __init__(self):
self.uk = Function(W)
self.u0 = Function(W)
self.E = Function(V)
self.Vext = Function(V)
self.problem = None
def solve(self, u0, E, massn0):
# self.E.
self.u0 = u0
self.massn0 = massn0
self.uk = Function(W, self.u0)
self.du = TrialFunction(W)
self.u00, self.u01, self.u02 = split(self.u0)
self.uk0, self.uk1, self.uk2 = split(self.uk)
self.du0, self.du1, self.du2 = split(self.du)
v0, v1, v2 = split(v)
self.J = (4.0/dt)
- 2.0*inner( div(outer(
- 2.0*( self.uk0*
- 2.0*inner( outer(grad(
+ eps**2*inner( outer(grad(
- 2.0*self.
- inner(self.du1, grad(v0))*dx + 1.0/dt*
- self.uk0*
self.du = Function(W)
self.A = assemble(self.J)
The error occurs in the last line, thus the mistake should be somewhere in the definition of J, but i can't find it! I also played a bit with Test and Trial Functions for self.du, but it doesnt help either...
Any help is appreciated!
Regards
Sebastian
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 Sebastian Rau for more information if necessary.