How do I set up a Dirac delta distribution (at a given interior point) for the linear form L in LinearProblem?
See PointSource.h/cpp.
If you want the point source to not align with the grid, you could use
x = ufl.SpatialCoordinate(mesh)
to defined the Dirac delta as the limit distribution:
delta_a = 1/(np.abs(a)*np.sqrt(pi))*ufl.exp(-(x[0]/a)**2)
.
If the point of interest aligns with the mesh, you should use
dofs = dolfinx.fem.locate_dofs_geometrical(V, lambda x: np.isclose(x.T, [px, py,pz]).all(axis=1))
u.x.array[dofs] = 1
(if V is a scalar space).
2 Likes
As far as I know, PointSource is not yet available in dolfinx
I’m currently modifying the grid and define a small area for the support of the approximate Dirac delta, but your approach might safe the remeshing time, I’ll try it! Thanks so far