Class DispersionPauli
Defined in File DispersionPauli.h
Class Documentation
-
class DispersionPauli
To construct a new force object, define the object with.
This class impliments two forces, a repulsive Pauli force and an attractive dispersion force. The sum of these two constitute a force similar to a Lennard-Jones force used in many MD simulations or a van der Waals force used in the AMOEBA model. To use it, simple create a DispersionPauli object by specifying the number of sites and the parameters for all sites. These parameters can be altered after the creation of the force object.
Next, set the global parameters for dispersion dampening, which employs the same functional form used in Grimme et al https://doi.org/10.1002/jcc.21759 for the r^6 attractive term. If no dampening is desired, set both a1 and a2 parameters to zero. As a result, vdw Radii will not affect the dispersion energy, and only C6 coefficeients will matter. Both C6 Nd vds Radii are determined based on the nuclei of each site, and all sites with the same nuclei will use the same parameters.
For the interaction betweena pair of sites, a geometric mixing is employed for the C6 coefficients while the two vdw radii are simply added together. For the Pauli repulsion, exponents are arithmetically averaged while the radii are converted to coefficient pre-factors that are then multipled by each other.
- Param num_sites
The number of sites to create
- Param nuclei
The integer nuclei of each site
- Param exponents
The exponents used for the Pauli repulsion
- Param radii
The Pauli radii used for repulsion
Public Functions
-
DispersionPauli(const int num_sites, const int *nuclei, const double *exponents, const double *radii)
Construct a new DispersionPauli force object.
- Parameters
num_sites – The number of sites to create
nuclei – The integer nuclei of each site
exponents – The exponents used for the Pauli repulsion
radii – The Pauli radii used for repulsion
-
~DispersionPauli()
-
void set_dispersion_params(double s6, double a1, double a2)
Set the dispersion parameters assording to Grimme et alhttps://doi.org/10.1002/jcc.21759.
- Parameters
s6 – Coefficient that scales the entire energy
a1 – multiple of the vdw radii R_ab
a2 – additive to a1*R_ab
-
void get_dispersion_params(double &s6, double &a1, double &a2)
Get the dispersion parameters.
- Parameters
s6 – Coefficient that scales the entire energy
a1 – multiple of the vdw radii R_ab
a2 – additive to a1*R_ab
-
void set_vdw_radii(map_id nuclei2radiiMap)
Set the vdw radii by the nuclei type.
- Parameters
nuclei2radiiMap – mapping from nuclei integers to vdw Radii (in bohr)
-
map_id get_vdw_radii_map()
Get the vdw radii mapping by the nuclei type.
- Returns
mapping from nuclei integers to vdw Radii (in bohr)
-
void set_C6_map(map_id nucleiToC6Map)
Set the C6 coefficients by the nuclei type.
- Parameters
nucleiToC6Map – mapping from nuclei integers to C6 coeff
-
map_id get_C6_map()
Get the C6 coefficient mapping by nuclei type.
- Returns
mapping fron nuclei integers to C6 coeff
-
void set_pauli_radii(vec_d radii_list)
Set the Pauli radii for all sites.
- Parameters
radii_list – list of Pauli radii
-
void set_pauli_radii(int index, double radii)
Set the Pauli radii for an individual site.
- Parameters
index – the index of the site to change
radii – the Pauli radii to assign
-
void set_pauli_exp(vec_d exp_list)
Set the Pauli exponents for all sites.
- Parameters
exp_list – array of exponents to use
-
void set_pauli_exp(int index, double exponent)
Set the Pauli exponent for a particular site.
- Parameters
index – The index of the site to change the exponent of
exponent – The value of the exponent to use on this site
-
vec_d get_pauli_exp()
Get the Pauli exponents used on all sites in the system.
- Returns
vec_d Array of Pauli exponents (in inverse bohr)
-
int get_num_sites()
Get the number sites.
- Returns
int
-
void create_exclusions_from_bonds(const std::vector<std::pair<int, int>> bonds, int bond_cutoff)
Create exclusions based on wht atoms are bonded to each other.
- Parameters
bonds – A list of index pairs in which each pair declares a bond between those two sites
bond_cutoff – Any site this many bonds away are excluded in the interaction calculation
-
void create_exclusions_from_fragment(const vec_i frag_idx)
Create exclusions from fragments. A fragment is a collection of indicies in which all sites will not interact with each other.
- Parameters
frag_idx – An array of indicies
-
void add_exclusion(const int i, const int j)
Add an exclusion between a pair of sites.
- Parameters
i – The index of the first site
j – The index of the second site
-
std::set<int> get_exclusions(const int particle1) const
Get a list of sites that are excluded from interacting with the i-th site.
- Parameters
particle1 – The site to inquire about exclusions
- Returns
std::set<int> a list of site indicies that do not interact with particle1
-
void set_use_PBC(bool is_periodic)
Turn on or off periodic boundary conditions.
- Parameters
is_periodic – If true, use PBC, if false, do not use them
-
void set_use_PBC(bool is_periodic, const double x, const double y, const double z)
Set the periodic boundaries.
- Parameters
is_periodic – If true, use PBC, if false, do not use them
x – The x-direction of the periodic box
y – The y-direction of the periodic box
z – The z-direction of the periodic box
-
bool get_use_PBC()
Inquire if PBC is used or not.
- Returns
true PBC is being used
- Returns
false PBC is not being used
-
void initialize()
Clear energy components before a calculation.
-
double calc_energy(const vec_d &coords)
Calculate the total interaction energy of all sites.
- Parameters
coords – A 1D array of positions of the sites
- Returns
The interaction energy
-
double calc_one_pair(const vec_d &pos, DeltaR &deltaR, int i, int j, Energies &energies, std::vector<Vec3> &forces)
Compute the interaction energy of a single pair of sites.
- Parameters
pos – A 1D array of positions of the sites
deltaR – A distance object for the pair of sites
i – Index of the first site
j – Index of the second site
energies – The Energies object that will be updated
forces – The forces array that will be updated
- Returns
double
-
Energies calc_one_pair(const vec_d &pos, int i, int j, std::vector<Vec3> &forces)
Compute the interaction energy of a single pair of sites.
- Parameters
pos – A 1D array of positions of the sites
i – Index of the first site
j – Index of the second site
forces – The forces array that will be updated
- Returns
Energies that were computed for the pair
-
double get_pauli_energy()
Return the total Pauli repulsion energy for the system.
- Returns
double
-
double get_disp_energy()
Return the total dispersion energy for the system.
- Returns
double
-
std::vector<vec_d> get_forces()
Return the forces exerted on each site after an energy computation.
- Returns
std::vector<vec_d> An Nx3 array of forces
-
void set_use_secondary_radii(bool use_radii = true)
Set the use of secondary radii for Pauli repulsion. This is a backup to ensure that two sites never get too close to each other without an enormous energetic cost. The distances used are chosed to be a close to a third of the vdw radii so that the energy cost will be minimal at normal distances. This can redude performance somewhat.
- Parameters
use_radii – If true, the backup radii will alos be used
-
void set_use_two_site_repulsion(bool on_off)
Set the use two site repulsion (experimental only)
- Parameters
on_off – Set to true to enable
-
void set_two_site_distance(double vertical_dist)
Set the two site repulsion distance.
- Parameters
vertical_dist – The virtical distance out of the place
-
void create_repulsion_sites(double vertical_dist, const std::vector<std::pair<int, int>> &bonds)
Create the two-site repulsion sites.
- Parameters
vertical_dist – The virtical distance out of the place
bonds – A list of all bonds