This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Point source for time dependent problem

0 votes

Hello everyone,

I would like to know if it is possible to use the point source class to create time dependent dirac function in right hand side.

More precisely, i would like to solve a non-stationnary heat equation (on a unit square), homogeneous Dirichlet boundary conditions and a point source at discrete time and space positions.

Thanks a lot,

Yours faithfully,

JayC

asked Dec 5, 2016 by JayC FEniCS Novice (210 points)

1 Answer

+3 votes

Yes it is possible. The PointSource class is very flexible and you can apply it to the right-hand-side vector at specific time steps in your simulation.

If you have a specific application we can help more if you describing your problem and its discretisation scheme carefully and concisely.

answered Dec 5, 2016 by Ettie Unwin FEniCS Novice (650 points)

Thank you for your answer Ettie Unwin.

I'm still thinking on how to apply this to my application and i'm not quite sure yet it is feasible.

I've figured out what is precisely my need. I have a time dependent equation (the heat equation) with Dirac right hand side at different space points. These points are stable through time but the value (or magnitude if i understand the class well) changes at each time step. Is it possible to update my list of dirac just by changing their magnitude instead of creating them ?

Example of PDE:

du/dt - \Delta u = f(t)*delta(x=0.5)

Thanks a lot,

JayC

When you construct your PointSource you need to specify a point and a magnitude of the source. If the magnitude changes at each step you will still need to construct a different PointSource at the same location and then apply it.

Currently the easiest way would require you to reassemble your right-hand side each time step because you can't change the magnitude or remove the old PointSource and reapply the new one.

v = TestFunction(FunctionSpace)
for t in time steps:
      magnitude = new_magnitude
      K = assemble(Constant(0.0)*v*dx)
      ps = PointSource(FunctionSpace, Point(0.5), magnitude) 
      ps.apply(K)
      K*=f(t)

However there are some possible workarounds where you could consider adding a point source with a negative magnitude.

...