MPM

class pyMPM.MPM(box, eps_p, radius=1, eps_m=1, xi=0.5, tol=0.001, quiet=False, guess_type='derivative')

Calculates the dipoles of particles for an electric field in x, y, and z direction given particles positions and their dielectric functions.

Parameters
box

A 1D array of length three specifying Lx, Ly, and Lz.

eps_p

Either a 1D or 2D array specifying the frequency dependent dielectric function of the particles. If eps_p is a 1D array, it is assumed to be of length num_wavelengths and to specify the frequency dependent dielectric function for all particles. If eps_p is 2D, it is assumed to be of shape num_wavelengths x num_particles and to specify the frequency dependent dielectric function of each particle individually.

radius

The radius of the particles. Defaults to 1 (assumed nondimentionalized).

eps_m

The dielectrix constant of the media the particle is embedded in. Defaults to 1 (assumed nondimensionalized).

xi

The Ewald parameter. Defaults to 0.5.

tol

The tolerance for solving the dipoles. Defaults to 0.001.

quiet

If True, does not print out progress statements.

guess_type
The guess value for each dipole:
“mean-field”

Uses the mean-field approximated dipole as the guess value.

“previous”

Uses the mean-field method for the first frequency, then uses the previous-frequency dipole value as the guess value.

“derivative”

Uses the mean-field method for the first two frequencies, then uses the last two calculated dipole values to linearly extrapolate the next guess value.

compute(positions)

Calculate the dipoles for the positions given. May be called multiple times.

Parameters
positions

An array of shape (num_frames,num_particles,3) or (num_particles,3).

get_cap_dip()

Deprecated. Use get_dipoles and get_eff_polarizibility instead.