- #1
TimeFall
- 12
- 0
Hello! I'm currently working on an algorithm that converts SPH (smoothed particle hydrodynamics) data to an Eulerian grid. Basically, the problem is this: each sph particle has an associated smoothing length, which is effectively the radius of a sphere centered at the sph particle's position. The properties of the particle as "smeared" out by a so-called smoothing kernel W(r, h), where r is the distance from the particle and h is the smoothing length. W is a piecewise polynomial. The idea is to get the points on the cell where the sphere overlaps it, and then integrate the smoothing kernel over this overlap volume. My problem is that I do not know of an efficient, effective way of getting these intersection points so that I can do the kernel integration, and was wondering if anyone out there did?
In a nutshell, I have a sphere that overlaps with a cube (not necessarily fully), and I would like to know the points of intersection in the x, y, and z directions. Or, if anyone knows of a better way to approach this problem, I am open to suggestions. Any help would be greatly appreciated! Thanks!
In a nutshell, I have a sphere that overlaps with a cube (not necessarily fully), and I would like to know the points of intersection in the x, y, and z directions. Or, if anyone knows of a better way to approach this problem, I am open to suggestions. Any help would be greatly appreciated! Thanks!