to add to @saikali’s answer (and sorry for the delay), making a 2D version of GPUSPH is possible, but it would require some work.
The first thing to do would be to recompute all the coefficients for the smoothing kernels (the kernels are radial, so the functional form remains exactly the same —it’s just the coeffcients computed in
setconstants method that would need to change). This is relatively simple.
For the forces computation and integration, most things could be kept as-is. It would be necessary to choose which of the x, y, z direction to ignore, and then simply “kill” that contribution. This can be enforced for example by not integrating the
z component in the
euler step (
eulerDevice kernel in
src/cuda/euler_kernel.def). Some additional work would probably be needed to handle moving bodies and floating objects, as well as to compute the stress and strain tensors, if necessary for the model, based on whether this is a plane strain or plane stress conditions.
Finally, the largest non-trivial change would be in the way the problem is set up. We do have some 2D geometries (rectangles and disks), but they are not usually used directly in 3D, just as auxiliary shapes for other geometries. This would need to change when setting up 2D problems.
As a simpler alternatives, for these 2D problems one might simply stick to imported geometries (loading e.g. one or more XYZ files that put everything on the same plane), which may be doable without larger changes, but would require the use of external programs to produce the files in the first place.