In the "Multiple Neumann, Robin, and Dirichlet Condition" of the tutorial.
It use a boundary condition that with "u":
$-\frac{\partial u}{\partial n}=p(u-q)$ on $\Gamma_R$
And the correspond code is :
a = inner(nabla_grad(u), nabla_grad(v))*dx + p*u*v*ds(0)
L = f*v*dx - g*v*ds(1) + p*q*v*ds(0)
Now i want a boundary condition that with nonlinear form of "u", for example:
$-\frac{\partial u}{\partial n}=p(u^2-q)$ on $\Gamma_R$
I changed the code to:
a = inner(nabla_grad(u), nabla_grad(v))*dx + p*u*u*v*ds(0)
L = f*v*dx - g*v*ds(1) + p*q*v*ds(0)
It cannot work. So what's the right way to do this? Thank you very much.