You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning, I got a question about sampling the gradient or more generically a field.
Let's take as an example the density gradient, the gradient can be sampled at every point, and the result will be the sum of the weighted densities of all nearby particles. Now that is all good if I am sampling in a generic way the gradient, but when I am sampling the gradient in order to update a value of particle I, particle I need not to be in the neighbor's list? Meaning to compute the value at that particle that particle itself is not included in the computation? I guess otherwise the field would be offsetted by "max value" at every particle point?
Basically enforcing
Here is an example of the density gradient, computed at every point, not for every particle:
To me makes sense that if I am sampling a point that is exactly on a particle, there I would expect a high density being near the peak of the kernel function. But my source of confusion is instead if I am evaluating the particles itself
Best regards
M.
PS: hope this is clear enough, if not let me know I can elaborate.
The text was updated successfully, but these errors were encountered:
giordi91
changed the title
Question]
[Question] Evaluating gradient at particle vs at point
Mar 14, 2018
Apologies, after reasoning more about it, the derivative would be zero, for i==j, meaning we would end up adding nothing to the gradient. Avoiding the i==j case is basically a small optimization. Please correct me if wrong.
In my code I have organized the grid to hold the particles in buckets, so I don't have a list where for each particle I have all the neighbors, but from a position, I find a cell, from that cell(and adjacent cells) I get the contained particles, kinda tempted to leave the extra computation in to avoid more complex logic/branching. Of course I will only know by profiling. I will try to get back to you on the matter. Sorry for the bother.
Hi @giordi91 ! Yes, I think you got it right. i == j will give you zero gradient contribution from j. All the operators including gradient and laplacian can be computed from any random points in the space. Some non-SPH methods have 1/r factor in the equation which introduces singularities, but for SPH, it's all good :)
Good morning, I got a question about sampling the gradient or more generically a field.
Let's take as an example the density gradient, the gradient can be sampled at every point, and the result will be the sum of the weighted densities of all nearby particles. Now that is all good if I am sampling in a generic way the gradient, but when I am sampling the gradient in order to update a value of particle I, particle I need not to be in the neighbor's list? Meaning to compute the value at that particle that particle itself is not included in the computation? I guess otherwise the field would be offsetted by "max value" at every particle point?
Basically enforcing
Here is an example of the density gradient, computed at every point, not for every particle:
To me makes sense that if I am sampling a point that is exactly on a particle, there I would expect a high density being near the peak of the kernel function. But my source of confusion is instead if I am evaluating the particles itself
Best regards
M.
PS: hope this is clear enough, if not let me know I can elaborate.
The text was updated successfully, but these errors were encountered: