Activity log for bug #1010850

Date Who What changed Old value New value Message
2012-06-09 11:05:35 Joachim Haga bug added bug
2012-06-13 20:30:27 Joachim Haga description I have tried to use the PointSource class. However, I've found some problems with it: 1/ It doesn't work properly for mixed (sub)spaces in python: qu = PointSource(W.sub(1), Point(0.0)) fails with some assertion error, but Q = W.sub(1); qu=PointSource(Q, Point(0.0)) seems to work. 2/ It is often desired to scale the point source so that it integrates to 1.0 with the given basis (like the delta function does in the continuous case). This can be done by hand, but it would be extra nice to have it done automatically. Especially since such by-hand scaling would require multiple steps (create trial source; assemble to find scale; create scaled source) in the general case. 3/ It can not be used with the solve(A==b) interface in python (I think). Would it be a good idea to let it inherit from BoundaryCondition, so that one can say solve(A==b, bcs=qu)? (but see next question) 4/ Even nicer would be if it could be used in forms (if it was a Function or Expression). That's how it's usually written in mathematical notation. Hm. I guess I can make such a function myself easily enough with apply() on an f.vector(). Still: Is making PointSource a Function, instead of something which is called through apply(), something you would consider? Edit: The original report is below; some issues in the original are converted to a blueprint. PointSource has a memory bug, when a temporary is used for the function space: qu = PointSource(W.sub(1), ...) The function space no longer exists when apply() is called. Additionally, I suggest that PointSource inherits BoundaryCondition (with no-op LHS apply). This would allow PointSource to be used with the high-level solve(a==L, bcs=...) interface. ================== original =================== I have tried to use the PointSource class. However, I've found some problems with it: 1/ It doesn't work properly for mixed (sub)spaces in python:     qu = PointSource(W.sub(1), Point(0.0)) fails with some assertion error, but     Q = W.sub(1); qu=PointSource(Q, Point(0.0)) seems to work. 2/ It is often desired to scale the point source so that it integrates to 1.0 with the given basis (like the delta function does in the continuous case). This can be done by hand, but it would be extra nice to have it done automatically. Especially since such by-hand scaling would require multiple steps (create trial source; assemble to find scale; create scaled source) in the general case. 3/ It can not be used with the solve(A==b) interface in python (I think). Would it be a good idea to let it inherit from BoundaryCondition, so that one can say solve(A==b, bcs=qu)? (but see next question) 4/ Even nicer would be if it could be used in forms (if it was a Function or Expression). That's how it's usually written in mathematical notation. Hm. I guess I can make such a function myself easily enough with apply() on an f.vector(). Still: Is making PointSource a Function, instead of something which is called through apply(), something you would consider?