UserExpression depending on solution

Hi,
I’m new to Fenics and are trying to implement a poisson-solver where the prescribed function f depends on the solution u. The question is very similar to here Previous Question. However, I want to call another python library within the UserExpression to calculate the returned value. How can I get the current value of the solution u every time eval is called?
Would be grateful for any help!

from fenics import *
from fdint import fd1h
import matplotlib.pyplot as plt


class charge(UserExpression):
    def __init__(self, nu_s, **kwargs):
        super().__init__(**kwargs)
        self.nu_s = nu_s

    #Here is the function where the solution u should be used  
    def eval(self, value, x):
        p = self.nu_s * x * fd1h(u)
        value [0] =  p

mesh = UnitIntervalMesh(10)
V = FunctionSpace(mesh, 'P', 1)
u_D = Expression('1 + x[0]*x[0]', degree=1)
def boundary(x, on_boundary):
    return on_boundary
bc = DirichletBC(V, u_D, boundary)
u = TrialFunction(V)
v = TestFunction(V)

#User-defined function
f = charge(nu_s=5,degree=0)

a = dot(grad(u), grad(v))*dx
L = f*v*dx

u = Function(V)
solve(a == L, u, bc)

plot(u)
plt.show()

Have you considered using the function(x)/Eval functionality? See for instance Material property depending on solution - #2 by Maeggis

Thanks for your answer!
I figured out how I can cast my equation into the form of the nonlinear Poisson equation (similar to Fenics Tutorial Volume 1 Ch. 3.2) . This solved the problem.