pynbody.gravity

pynbody.gravity#

Routines for calculating gravitational potential and accelerations.

See also

pynbody.analysis.profile provides a user-friendly interface to rotation curves.

Functions

all_direct(f[, eps])

Calculate the potential and acceleration for all particles in the snapshot using a direct summation algorithm.

all_pm(f[, ngrid])

Calculate the potential and acceleration for all particles in the snapshot using a Particle-Mesh algorithm.

direct(f, ipos[, eps, num_threads])

Calculate the gravitational acceleration and potential at the specified positions

midplane_potential(f, rxy_points[, eps])

Calculate the potential of a disk galaxy in the x-y midplane (with z=0)

midplane_rot_curve(f, rxy_points[, eps])

Calculate the rotation curve of a disk galaxy in the x-y midplane (with z=0)

pm(f, ipos[, ngrid, x0, x1])

Calculate the potential and acceleration for a set of particles using a Particle-Mesh algorithm.