PointSource should add values vector values, not set

Bug #850130 reported by Garth Wells
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Undecided
Unassigned

Bug Description

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.normalvariate(0,1), random.normalvariate(0,1))
    delta = PointSource(V, p, 1)
    delta.apply(b)

u = Function(V)
solve(A, u.vector(), b)

Related branches

Changed in dolfin:
status: New → Fix Committed
milestone: none → 1.0-rc1
Anders Logg (logg)
Changed in dolfin:
milestone: 1.0-rc1 → 1.0-beta2
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.