I use fipy to model the linearized Poisson-Boltzmann equation , which is essentially

I suppose I can model f(x)as a boundary condition. If epsilon(x)is a constant, fipy can handle this:
phi = CellVariable(mesh)
dielectric_solvent = 80.0
dielectric_inner = 4.0
LHS = (DiffusionTerm(coeff = dielectric_solvent))
RHS = phi
eq = LHS == RHS
dr = np.linalg.norm(mesh.faceCenters, axis=0)
mask = (dr<.5) * mesh.exteriorFaces
phi.constrain(1, mask)
mask = (dr>.5) * mesh.exteriorFaces
phi.constrain(0, mask)
sol = eq.solve(var=phi)
giving:

the complete minimal example is published as an entity so that everything is in order, this is the corresponding part.
What I would like to do, let it epsilon(x)change as a function in space, but DiffusionTermcan only accept a constant. How can I realize a spatially changing dielectric term?
source
share