Dear all,

Suppose that there is a point source in the right-hand side of a linear problem, like \int_\Omega \nabla u\nabla\phi dx+\kappa\int_\Gamma u \phi ds=\int_\Omega\delta(x-x')\phi dx as the weak form. The usual way to write this in Fenics using PointSource function is

`a=inner(grad(u),grad(v))*dx+kappa*inner(u,v)*ds L=Constant(0)*v*dx ps=PointSouce(V, Point(x'), 1) A,b=assemble_system(a, L) ps.apply(b) u = Function(V) solve(A, u.vector(), b)`

Inspired by the example here, can I do something similar like

f = Function(V)

ps = PointSource(V, Point(x’), 1)

ps.apply(f.vector())

a = inner(grad(u), grad(v)) * dx + kappa * inner(u, v) * ds

L = f * v *dx

u = Function(V)

solve(a = = L)

Is the second one a correct way to do point source? Are these two methods the same?

Thanks a lot in advance.

Best regards,

Alice