Hi @damianmoz, thanks for the questions! Hopefully this helps:
It took me a long while to figure out what a source condition was?
@tbzy's answer is spot on:
I guess the word "source" above refers to the right-hand side ("b") of the Poisson like equation (nabla p = b) and the "source condition" probably means the setting / definition of the b term.
I think I originally learned this term in the context of computational electromagnetics (where a "source term" would be something like an incoming electric field exciting an antenna).
How do you choose nx and ny given then you want a mesh of 30*30 points?
It should just be --nx=30 --ny=30
Also, y = 0 and y = 2? Are these the left and right edge of the 2D region in question?
Yes, by default the domain is 2 by 2 (meters). Its size can be modified by changing the xLen
and yLen
variables.
If one assigns some StencilDist array say, x , to another y ... Does that copy the fluff ?
Yes, that's correct, the fluff buffers should be copied along with the array itself.
Why is p.updateFluff() called when it is rather than pn.updateFluff() called as it was just prior to the call to poissonKernel() as it was in nsPoissonStencil.chpl?
Either pattern achieves essentially the same effect. The benefit of this arrangement is that after the loop, the solution array, p
, has updated fluff buffers. With the alternative pattern, you'd want to call p.updateFluff()
immediately after the for-loop to achieve the same effect.
This is the Cauchy convergence criterion for a sequence of vectors.
The difference of the individual 1-norms as used in Barba's original Python and replicated in the Chapel code is, I would suggest, not a true convergence measure...
Yeah, that's true, it's sort of a strange convergence criterion, and I'm not 100% sure why it was used in the original tutorials, but I went ahead and copied what they used to keep things consistent. It would definitely be interesting to try the condition you've suggested to see if it achieves noticeably different results.
Not sure what the problem is but a NaN is not a good thing to have.
It is the algorithm which has the issues. No problems with Chapel itself.
That's probably a case where the algorithm has become numerically unstable. I'm guessing it's because the ratio of finite difference points to unit length is too large, and thus the "derivatives" become too large to be numerically stable. You should be able to get around this by also increasing xLen
and yLen
.
Best,
Jeremiah