ArityMismatch for Crank Nicolson method on mixed function space

Hi wavy,

the ArityMismatch arises, since your right hand side L is not a linear form, but a bilinear form.

In [1]: len(L2.arguments())                                                                                      
Out[1]: 2

For a linear form the number of arguments should be 1.
I didn’t go over the derivation of the weak form myself, maybe you could check it again. You could just push the bilinear term to the left hand side, and fenics actually will do it for you as well:

form = a1 + a2 - L1 - L2
a = lhs(form)
L = rhs(form)

Best,
Philipp

1 Like