How to define product of dirac delta functions as initial condition

The degrees of freedom has physical coordinates, which you can get through

print(V.tabulate_dof_coordinates)

these are the coordinates sent into

(which you dont call anywhere in your code btw.)

If none of these coordinates are close to (0,0), then you will only get zero values in your initial function (say if you called)

u0 = interpolate(Delta(), V)

Thus you need to make sure your discretization aligns with your point source if you want to use it as an initial condition.

If you don’t want alignment, you need to project Delta into V (but you face the same issue if none of the quadrature points align with the point source).

Alternatively, you can used a smooth approximation of the point source, see: Implement point source in the variational formulation - #2 by MiroK

1 Like