coulomb_mc.mc_expansion_tools module

class coulomb_mc.mc_expansion_tools.LocalExp(L)

Bases: object

Generates C code to manipulate and evaluate Local expansions.

Parameters

L (int) – Number of expansion terms.

compute_local_exp(n, charge, radius, theta, phi, out)

Compute the local expansion that describes the field induced by a charge at the origin.

Parameters
  • n – Number of charges.

  • charge – np.array n x 1, c_double charge values.

  • radius – np.array n x 1, c_double radii.

  • theta – np.array n x 1, c_double theta values.

  • phi – np.array n x 1, c_double phi values.

  • out – np.array n x 1, c_void_p pointer to LxLx2 c_double values (MUST NOT ALIAS). I.E. pointers must be unique and not overlap.

compute_phi_local(n, radius, theta, phi, moments, out)

Evaluate local expansions at points.

Parameters
  • n – Number of points,

  • radius – np.array n x 1, c_double of radii.

  • theta – np.array n x 1, c_double of theta values.

  • phi – np.array n x 1, c_double of phi values.

  • moments – np.array n x 1, c_void_p of pointers to LxLx2 c_double values.

  • out – np.array n x 1, c_double of output field evaluations.