pynbody.gravity.calc.all_pm

Contents

pynbody.gravity.calc.all_pm#

pynbody.gravity.calc.all_pm(f: SimSnap, ngrid: int = 10)[source]#

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

The results are stored inside the snapshot itself, as f['phi'] and f['acc'].

Warning

PM calculations assume periodic boundary conditions, and are only accurate on large scales (much larger than

Parameters:
  • f – The snapshot to calculate the potential and acceleration for

  • ngrid – The number of grid points to use in each dimension for the Particle-Mesh calculation.