sarkas.potentials.force_pm.calc_charge_dens#

sarkas.potentials.force_pm.calc_charge_dens(mesh_pos, mesh_points, charges, cao, mesh_sz, mid, pshift)[source]#

Assigns Charges to Mesh Points.

Parameters
  • mesh_pos (numpy.ndarray) – Particles’ positions relative to the mesh.

  • mesh_points (numpy.ndarray) – Particles’ positions on the mesh.

  • charges (numpy.ndarray) – Particles’ charges.

  • cao (numpy.ndarray) – Charge assignment order.

  • mesh_sz (numpy.ndarray) – Mesh points per direction.

  • mid (numpy.ndarray) – Midpoint flag for the three directions.

  • pshift (numpy.ndarray) – Midpoint shift in each direction.

Returns

rho_r (numpy.ndarray) – Charge density distributed on mesh.