CoulombGalore
Public Member Functions | Public Attributes | List of all members
CoulombGalore::Plain Class Reference

Inherits CoulombGalore::EnergyImplementation< Plain >.

Public Member Functions

 Plain (double debye_length=infinity)
 
 Plain (const nlohmann::json &j)
 
double calc_dielectric (double M2V)
 
double dipole_dipole_energy (const vec3 &muA, const vec3 &muB, const vec3 &r) const override
 
vec3 dipole_dipole_force (const vec3 &muA, const vec3 &muB, const vec3 &r) const override
 
vec3 dipole_field (const vec3 &mu, const vec3 &r) const override
 
double dipole_potential (const vec3 &mu, const vec3 &r) const override
 
vec3 dipole_torque (const vec3 &mu, const vec3 &E) const
 
double ion_dipole_energy (double z, const vec3 &mu, const vec3 &r) const override
 
vec3 ion_dipole_force (double z, const vec3 &mu, const vec3 &r) const override
 
vec3 ion_field (double z, const vec3 &r) const override
 
double ion_ion_energy (double zA, double zB, double r) const override
 
vec3 ion_ion_force (double zA, double zB, const vec3 &r) const override
 
double ion_potential (double z, double r) const override
 
double ion_quadrupole_energy (double z, const mat33 &quad, const vec3 &r) const override
 
vec3 ion_quadrupole_force (double z, const mat33 &quad, const vec3 &r) const override
 
vec3 multipole_field (double z, const vec3 &mu, const mat33 &quad, const vec3 &r) const
 
double multipole_multipole_energy (double zA, double zB, const vec3 &muA, const vec3 &muB, const mat33 &quadA, const mat33 &quadB, const vec3 &r) const override
 
vec3 multipole_multipole_force (double zA, double zB, const vec3 &muA, const vec3 &muB, const mat33 &quadA, const mat33 &quadB, const vec3 &r) const override
 
double neutralization_energy (const std::vector< double > &charges, double volume) const override
 
vec3 quadrupole_field (const mat33 &quad, const vec3 &r) const
 
double quadrupole_potential (const mat33 &quad, const vec3 &r) const override
 
double self_energy (const std::array< double, 2 > &squared_moments) const
 
double short_range_function (double) const override
 
double short_range_function_derivative (double) const override
 
double short_range_function_second_derivative (double) const override
 
double short_range_function_third_derivative (double) const override
 
void to_json (nlohmann::json &j) const
 

Public Attributes

double cutoff
 
double debye_length
 
std::string doi
 
std::string name
 
Scheme scheme
 
std::function< double(const std::array< double, 2 > &)> selfEnergyFunctor = nullptr
 

Detailed Description

No truncation scheme, cutoff = infinity.

Warning
Neutralization-scheme should not be used using an infinite cut-off

Definition at line 1197 of file coulombgalore.h.

Member Function Documentation

§ calc_dielectric()

double CoulombGalore::SchemeBase::calc_dielectric ( double  M2V)
inherited

Calculate dielectric constant.

Parameters
M2Vsee details, UNIT: [ 1 ]

The dimensionless paramter M2V is described by \( M2V = \frac{\langle M^2\rangle}{ 3\varepsilon_0Vk_BT } \) where \( \langle M^2\rangle \) is mean value of the system dipole moment squared, \( \varepsilon_0 \) is the vacuum permittivity, V the volume of the system, \( k_B \) the Boltzmann constant, and T the temperature. When calculating the dielectric constant T0 is also needed, i.e. the Spatial Fourier transformed modified interaction tensor, which is automatically given for each scheme.

Definition at line 582 of file coulombgalore.h.

§ dipole_dipole_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::dipole_dipole_energy ( const vec3 muA,
const vec3 muB,
const vec3 r 
) const
overridevirtualinherited

interaction energy between two point dipoles

Parameters
muAdipole moment of particle A, UNIT: [ ( input length ) x ( input charge ) ]
muBdipole moment of particle B, UNIT: [ ( input length ) x ( input charge ) ]
rdistance-vector between dipoles, \( {\bf r} = {\bf r}_{\mu_B} - {\bf r}_{\mu_A} \), UNIT: [ input length ]
Returns
interaction energy, UNIT: [ ( input charge )^2 / ( input length ) ]

The interaction energy between two dipoles is decribed by

\[ u(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r}) = -\boldsymbol{\mu}_A\cdot {\bf E}(\boldsymbol{\mu}_B, {\bf r}) \]

where \( {\bf E}(\boldsymbol{\mu}_B, {\bf r}) \) is the field from dipole B at the location of dipole A.

Implements CoulombGalore::SchemeBase.

Definition at line 926 of file coulombgalore.h.

§ dipole_dipole_force()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::dipole_dipole_force ( const vec3 muA,
const vec3 muB,
const vec3 r 
) const
overridevirtualinherited

interaction force between two point dipoles

Parameters
muAdipole moment of particle A, UNIT: [ ( input length ) x ( input charge ) ]
muBdipole moment of particle B, UNIT: [ ( input length ) x ( input charge ) ]
rdistance-vector between dipoles,

\[ {\bf r} = {\bf r}_{\mu_B} - {\bf r}_{\mu_A} \]

, UNIT: [ input length ]
Returns
interaction force, UNIT: [ ( input charge )^2 / ( input length )^2 ]

The force between two dipoles is decribed by

\[ {\bf F}(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r}) = {\bf F}_D(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r})\left( s(q) - qs^{\prime}(q) + \frac{q^2}{3}s^{\prime\prime}(q) \right) + {\bf F}_I(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r})\left( s^{\prime\prime}(q) - qs^{\prime\prime\prime}(q) \right)q^2 \]

where the 'direct' (D) force contribution is

\[ {\bf F}_D(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r}) = 3\frac{ 5 (\boldsymbol{\mu}_A \cdot {\bf \hat{r}}) (\boldsymbol{\mu}_B \cdot {\bf \hat{r}}){\bf \hat{r}} - (\boldsymbol{\mu}_A \cdot \boldsymbol{\mu}_B){\bf \hat{r}} - (\boldsymbol{\mu}_A \cdot {\bf \hat{r}})\boldsymbol{\mu}_B - (\boldsymbol{\mu}_B \cdot {\bf \hat{r}})\boldsymbol{\mu}_A }{|{\bf r}|^4} \]

and the 'indirect' (I) force contribution is

\[ {\bf F}_I(\boldsymbol{\mu}_A, \boldsymbol{\mu}_B, {\bf r}) = \frac{ (\boldsymbol{\mu}_A \cdot {\bf \hat{r}}) (\boldsymbol{\mu}_B \cdot {\bf \hat{r}}){\bf \hat{r}}}{|{\bf r}|^4}. \]

Implements CoulombGalore::SchemeBase.

Definition at line 1049 of file coulombgalore.h.

§ dipole_field()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::dipole_field ( const vec3 mu,
const vec3 r 
) const
overridevirtualinherited

electrostatic field from point dipole

Parameters
mupoint dipole, UNIT: [ ( input length ) x ( input charge ) ]
rdistance-vector from point dipole, UNIT: [ input length ]
Returns
field from dipole, UNIT: [ ( input charge ) / ( input length )^2 ]

The field from a point dipole is described by

\[ {\bf E}(\boldsymbol{\mu}, {\bf r}) = \frac{3 ( \boldsymbol{\mu} \cdot \hat{{\bf r}} ) \hat{{\bf r}} - \boldsymbol{\mu} }{|{\bf r}|^3} \left( s(q) - qs^{\prime}(q) + \frac{q^2}{3}s^{\prime\prime}(q) \right) + \frac{\boldsymbol{\mu}}{|{\bf r}|^3}\frac{q^2}{3}s^{\prime\prime}(q) \]

Implements CoulombGalore::SchemeBase.

Definition at line 768 of file coulombgalore.h.

§ dipole_potential()

double CoulombGalore::EnergyImplementation< Plain , true >::dipole_potential ( const vec3 mu,
const vec3 r 
) const
overridevirtualinherited

electrostatic potential from point dipole

Parameters
mudipole moment, UNIT: [ ( input length ) x ( input charge ) ]
rdistance vector from dipole, UNIT: [ input length ]
Returns
dipole potential, UNIT: [ ( input charge ) / ( input length ) ]

The potential from a point dipole is described by

\[ \Phi(\boldsymbol{\mu}, {\bf r}) = \frac{\boldsymbol{\mu} \cdot \hat{{\bf r}} }{|{\bf r}|^2} \left( s(q) - qs^{\prime}(q) \right) \]

Implements CoulombGalore::SchemeBase.

Definition at line 683 of file coulombgalore.h.

§ dipole_torque()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::dipole_torque ( const vec3 mu,
const vec3 E 
) const
inherited

torque exerted on point dipole due to field

Parameters
mudipole moment, UNIT: [ ( input length ) x ( input charge ) ]
Efield, UNIT: [ ( input charge unit ) / ( input length unit )^2 ]
Returns
torque, UNIT: [ ( input charge )^2 / ( input length ) ]

The torque on a dipole in a field is described by \( \boldsymbol{\tau} = \boldsymbol{\mu} \times \boldsymbol{E} \)

Warning
Not tested!

Definition at line 1157 of file coulombgalore.h.

§ ion_dipole_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::ion_dipole_energy ( double  z,
const vec3 mu,
const vec3 r 
) const
overridevirtualinherited

interaction energy between a point charges and a point dipole

Parameters
zpoint charge, UNIT: [ input charge ]
mudipole moment, UNIT: [ ( input length ) x ( input charge ) ]
rdistance-vector between dipole and charge, \( {\bf r} = {\bf r}_{\mu} - {\bf r}_z \), UNIT: [ input length ]
Returns
interaction energy, UNIT: [ ( input charge )^2 / ( input length ) ]

The interaction energy between an ion and a dipole is decribed by

\[ u(z, \boldsymbol{\mu}, {\bf r}) = z \Phi(\boldsymbol{\mu}, -{\bf r}) \]

where \( \Phi(\boldsymbol{\mu}, -{\bf r}) \) is the potential from the dipole at the location of the ion. This interaction can also be described by

\[ u(z, \boldsymbol{\mu}, {\bf r}) = -\boldsymbol{\mu}\cdot {\bf E}(z, {\bf r}) \]

where \( {\bf E}(z, {\bf r}) \) is the field from the ion at the location of the dipole.

Implements CoulombGalore::SchemeBase.

Definition at line 906 of file coulombgalore.h.

§ ion_dipole_force()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::ion_dipole_force ( double  z,
const vec3 mu,
const vec3 r 
) const
overridevirtualinherited

interaction force between a point charges and a point dipole

Parameters
zcharge, UNIT: [ input charge ]
mudipole moment, UNIT: [ ( input length ) x ( input charge ) ]
rdistance-vector between dipole and charge, \( {\bf r} = {\bf r}_{\mu} - {\bf r}_z \), UNIT: [ input length ]
Returns
interaction force, UNIT: [ ( input charge )^2 / ( input length )^2 ]

The force between an ion and a dipole is decribed by

\[ {\bf F}(z, \boldsymbol{\mu}, {\bf r}) = z {\bf E}(\boldsymbol{\mu}, {\bf r}) \]

where \( {\bf E}(\boldsymbol{\mu}, {\bf r}) \) is the field from the dipole at the location of the ion.

Implements CoulombGalore::SchemeBase.

Definition at line 1019 of file coulombgalore.h.

§ ion_field()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::ion_field ( double  z,
const vec3 r 
) const
overridevirtualinherited

electrostatic field from point charge

Parameters
zpoint charge, UNIT: [ input charge ]
rdistance-vector from point charge, UNIT: [ input length ]
Returns
field from charge, UNIT: [ ( input charge ) / ( input length )^2 ]

The field from a charge is described by

\[ {\bf E}(z, {\bf r}) = \frac{z \hat{{\bf r}} }{|{\bf r}|^2} \left( s(q) - qs^{\prime}(q) \right) \]

.

Implements CoulombGalore::SchemeBase.

Definition at line 740 of file coulombgalore.h.

§ ion_ion_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::ion_ion_energy ( double  zA,
double  zB,
double  r 
) const
overridevirtualinherited

interaction energy between two point charges

Parameters
zApoint charge, UNIT: [ input charge ]
zBpoint charge, UNIT: [ input charge ]
rcharge-charge separation, UNIT: [ input length ]
Returns
interaction energy, UNIT: [ ( input charge )^2 / ( input length ) ]

The interaction energy between two charges is decribed by \( u(z_A, z_B, r) = z_B \Phi(z_A,r) \) where \( \Phi(z_A,r) \) is the potential from ion A.

Implements CoulombGalore::SchemeBase.

Definition at line 886 of file coulombgalore.h.

§ ion_ion_force()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::ion_ion_force ( double  zA,
double  zB,
const vec3 r 
) const
overridevirtualinherited

interaction force between two point charges

Parameters
zApoint charge, UNIT: [ input charge ]
zBpoint charge, UNIT: [ input charge ]
rdistance-vector between charges, \( {\bf r} = {\bf r}_{z_B} - {\bf r}_{z_A} \), UNIT: [ input length ]
Returns
interaction force, UNIT: [ ( input charge )^2 / ( input length )^2 ]

The force between two point charges is described by

\[ {\bf F}(z_A, z_B, {\bf r}) = z_B {\bf E}(z_A, {\bf r}) \]

where \( {\bf E}(z_A, {\bf r}) \) is the field from ion A at the location of ion B.

Implements CoulombGalore::SchemeBase.

Definition at line 1004 of file coulombgalore.h.

§ ion_potential()

double CoulombGalore::EnergyImplementation< Plain , true >::ion_potential ( double  z,
double  r 
) const
overridevirtualinherited

electrostatic potential from point charge

Parameters
zcharge, UNIT: [ input charge ]
rdistance from charge, UNIT: [ input length ]
Returns
ion potential, UNIT: [ ( input charge ) / ( input length ) ]

The electrostatic potential from a point charge is described by

\[ \Phi(z,r) = \frac{z}{r}s(q) \]

Implements CoulombGalore::SchemeBase.

Definition at line 659 of file coulombgalore.h.

§ ion_quadrupole_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::ion_quadrupole_energy ( double  z,
const mat33 &  quad,
const vec3 r 
) const
overridevirtualinherited

interaction energy between a point charges and a point quadrupole

Parameters
zpoint charge, UNIT: [ input charge ]
quadquadrupole moment, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector between quadrupole and charge, \( {\bf r} = {\bf r}_{\boldsymbol{Q}} - {\bf r}_z \), UNIT: [ input length ]
Returns
interaction energy, UNIT: [ ( input charge )^2 / ( input length ) ]

The interaction energy between an ion and a quadrupole is decribed by

\[ u(z, \boldsymbol{Q}, {\bf r}) = z \Phi(\boldsymbol{Q}, -{\bf r}) \]

where \( \Phi(\boldsymbol{Q}, -{\bf r}) \) is the potential from the quadrupole at the location of the ion.

Implements CoulombGalore::SchemeBase.

Definition at line 943 of file coulombgalore.h.

§ ion_quadrupole_force()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::ion_quadrupole_force ( double  z,
const mat33 &  quad,
const vec3 r 
) const
overridevirtualinherited

interaction force between a point charge and a point quadrupole

Parameters
zpoint charge, UNIT: [ input charge ]
quadpoint quadrupole, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector between particles, \( {\bf r} = {\bf r}_{Q} - {\bf r}_{z} \), UNIT: [ input length ]
Returns
interaction force, UNIT: [ ( input charge )^2 / ( input length )^2 ]

The force between a point charge and a point quadrupole is described by

\[ {\bf F}(z, Q, {\bf r}) = z {\bf E}(Q, {\bf r}) \]

where \( {\bf E}(Q, {\bf r}) \) is the field from the quadrupole at the location of the ion.

Implements CoulombGalore::SchemeBase.

Definition at line 1088 of file coulombgalore.h.

§ multipole_field()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::multipole_field ( double  z,
const vec3 mu,
const mat33 &  quad,
const vec3 r 
) const
virtualinherited

electrostatic field from point multipole

Parameters
zcharge, UNIT: [ input charge ]
mudipole, UNIT: [ ( input length ) x ( input charge ) ]
quadpoint quadrupole, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector from point multipole, UNIT: [ input length ]
Returns
field from multipole, UNIT: [ ( input charge ) / ( input length )^2 ]

The field from a point multipole is described by

\[ {\bf E}(z,\boldsymbol{\mu}, {\bf r}) = \frac{z \hat{{\bf r}} }{|{\bf r}|^2} \left( s(q) - qs^{\prime}(q) \right) + \frac{3 ( \boldsymbol{\mu} \cdot \hat{{\bf r}} ) \hat{{\bf r}} - \boldsymbol{\mu} }{|{\bf r}|^3} \left( s(q) - qs^{\prime}(q) + \frac{q^2}{3}s^{\prime\prime}(q) \right) + \frac{\boldsymbol{\mu}}{|{\bf r}|^3}\frac{q^2}{3}s^{\prime\prime}(q) \]

Implements CoulombGalore::SchemeBase.

Definition at line 845 of file coulombgalore.h.

§ multipole_multipole_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::multipole_multipole_energy ( double  zA,
double  zB,
const vec3 muA,
const vec3 muB,
const mat33 &  quadA,
const mat33 &  quadB,
const vec3 r 
) const
overridevirtualinherited

interaction energy between two multipoles with charges and dipole moments

Parameters
zApoint charge of particle A, UNIT: [ input charge ]
zBpoint charge of particle B, UNIT: [ input charge ]
muApoint dipole moment of particle A, UNIT: [ ( input length ) x ( input charge ) ]
muBpoint dipole moment of particle B, UNIT: [ ( input length ) x ( input charge ) ]
quadApoint quadrupole of particle A, UNIT: [ ( input length )^2 x ( input charge ) ]
quadBpoint quadrupole of particle B, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector between dipoles, \( {\bf r} = {\bf r}_{\mu_B} - {\bf r}_{\mu_A} \), UNIT: [ input length ]
Returns
interaction energy, UNIT: [ ( input charge )^2 / ( input length ) ]

A combination of the functions 'ion_ion_energy', 'ion_dipole_energy', 'dipole_dipole_energy' and 'ion_quadrupole_energy'.

Implements CoulombGalore::SchemeBase.

Definition at line 960 of file coulombgalore.h.

§ multipole_multipole_force()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::multipole_multipole_force ( double  zA,
double  zB,
const vec3 muA,
const vec3 muB,
const mat33 &  quadA,
const mat33 &  quadB,
const vec3 r 
) const
overridevirtualinherited

interaction force between two point multipoles

Parameters
zAcharge of particle A, UNIT: [ input charge ]
zBcharge of particle B, UNIT: [ input charge ]
muAdipole moment of particle A, UNIT: [ ( input length ) x ( input charge ) ]
muBdipole moment of particle B, UNIT: [ ( input length ) x ( input charge ) ]
quadApoint quadrupole of particle A, UNIT: [ ( input length )^2 x ( input charge ) ]
quadBpoint quadrupole of particle B, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector between dipoles,

\[ {\bf r} = {\bf r}_{\mu_B} - {\bf r}_{\mu_A} \]

, UNIT: [ input length ]
Returns
interaction force, UNIT: [ ( input charge )^2 / ( input length )^2 ]

A combination of the functions 'ion_ion_force', 'ion_dipole_force', 'dipole_dipole_force' and 'ion_quadrupole_force'.

Implements CoulombGalore::SchemeBase.

Definition at line 1103 of file coulombgalore.h.

§ neutralization_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::neutralization_energy ( const std::vector< double > &  charges,
double  volume 
) const
overridevirtualinherited

Compensating term for non-neutral systems.

Parameters
chargesCharges of particles, UNIT: [ input charge ]
volumeVolume of unit-cell, UNIT: [ ( input length )^3 ]
Returns
energy, UNIT: [ ( input charge )^2 / ( input length ) ]
Note
DOI:10.1021/jp951011v

Reimplemented from CoulombGalore::SchemeBase.

Definition at line 1183 of file coulombgalore.h.

§ quadrupole_field()

vec3 CoulombGalore::EnergyImplementation< Plain , true >::quadrupole_field ( const mat33 &  quad,
const vec3 r 
) const
virtualinherited

electrostatic field from point quadrupole

Parameters
quadpoint quadrupole, UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance-vector from point quadrupole, UNIT: [ input length ]
Returns
field from quadrupole, UNIT: [ ( input charge ) / ( input length )^2 ]

The field from a point quadrupole is described by

\[ {\bf E}(\boldsymbol{Q}, {\bf r}) = ... \]

Implements CoulombGalore::SchemeBase.

Definition at line 801 of file coulombgalore.h.

§ quadrupole_potential()

double CoulombGalore::EnergyImplementation< Plain , true >::quadrupole_potential ( const mat33 &  quad,
const vec3 r 
) const
overridevirtualinherited

electrostatic potential from point dipole

Parameters
quadquadrupole moment (not necessarily traceless), UNIT: [ ( input length )^2 x ( input charge ) ]
rdistance vector from dipole, UNIT: [ input length ]
Returns
quadrupole potential, UNIT: [ ( input charge ) / ( input length ) ]

The potential from a point quadrupole is described by

\[ \Phi(\boldsymbol{Q}, {\bf r}) = \frac{1}{2}... \]

Implements CoulombGalore::SchemeBase.

Definition at line 709 of file coulombgalore.h.

§ self_energy()

double CoulombGalore::EnergyImplementation< Plain , true >::self_energy ( const std::array< double, 2 > &  squared_moments) const
inherited

Self-energy for all type of interactions.

Parameters
squared_momentsvector with square moments, i.e. charge squared and dipole moment squared, UNIT: [ ( input charge )^2 , ( input length )^2 x ( input charge )^2 , ... ]
Returns
self-energy, UNIT: [ ( input charge )^2 / ( input length ) ]

The self-energy is described by \( u_{self} = p_1 \frac{z^2}{R_c} + p_2 \frac{|\boldsymbol{\mu}|^2}{R_c^3} + \cdots \) where \( p_i \) is the prefactor for the self-energy for species 'i'. Here i=0 represent ions, i=1 represent dipoles etc.

Definition at line 1171 of file coulombgalore.h.


The documentation for this class was generated from the following file: