Projecting a Gaussian distribution
I would like to project a particle cloud represented as a sum of dirac masses on a grid using PointSource. I have tried the following code but it gives me a set of points on the mesh instead of a nice Gaussian shaped function, any ideas why?
Perhaps I'm not using the PointSource correctly?
Cheers
/J
from dolfin import *
import random
mesh = Rectangle(-10,-10, 10,10,50,50)
V = FunctionSpace(mesh, 'CG', 1)
u = TrialFunction(V)
v = TestFunction(V)
a = inner(u,v)*dx
A=assemble(a)
L= v*dx
b = assemble(L)
n = 100000
for i in range(n):
p= Point(random.
delta = PointSource(V, p, 1)
delta.apply(b)
u = Function(V)
solve(A, u.vector(), b)
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask j for more information if necessary.