class ElectricField : public feasst::ModelOneBody

Apply an electric field along a dimension.

\(U_{ext}(x) = -q E x\)

where \(q\) is the charge of a site, \(E\) is the electric field and \(x\) is the position along a given dimension.

Public Functions

void precompute(const ModelParams &existing)

Precompute model parameters based on existing model parameters.

double energy(const Position &wrapped_site, const Site &site, const Configuration &config, const ModelParams &model_params)

Return the energy given the wrapped coordinates, site, config and params.

void serialize(std::ostream &ostr) const

Output a serialized version of the existing model.


  • dimension: direction of the electric field (default: 0).

  • field_strength: external electric field strength in force per charge. The units are assumed to be Volts/Angstrom, where charge is electron charge and energy is in kJ/mol.