DispersionPauli
- class AmberFD.DispersionPauli(*args)
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.
To construct a new force object, define the object with
- 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
- __init__(*args)
Methods
__init__
(*args)add_exclusion
(i, j)Add an exclusion between a pair of sites
calc_energy
(coords)Calculate the total interaction energy of all sites
calc_one_pair
(*args)Overload 1:
create_exclusions_from_bonds
(bonds, bond_cutoff)Create exclusions based on wht atoms are bonded to each other
create_exclusions_from_fragment
(frag_idx)Create exclusions from fragments.
create_repulsion_sites
(vertical_dist, bonds)Create the two-site repulsion sites
Get the C6 coefficients used for all sites
Get the C6 coefficient mapping by nuclei type
Return the total dispersion energy for the system
Get the dispersion parameters
get_exclusions
(particle1)Get a list of sites that are excluded from interacting with the i-th site
Return the forces exerted on each site after an energy computation
Get the number sites
Return the total Pauli repulsion energy for the system
Get the Pauli exponents used on all sites in the system
Get the Pauli radii for all sites
Inquire if PBC is used or not
Get the vdw radii used for all sites
Get the vdw radii mapping by the nuclei type
Clear energy components before a calculation
set_C6_map
(nucleiToC6Map)Set the C6 coefficients by the nuclei type
set_dispersion_params
(s6, a1, a2)Set the dispersion parameters assording to Grimme et alhttps://doi.org/10.1002/jcc.21759
set_pauli_exp
(*args)Overload 1:
set_pauli_radii
(*args)Overload 1:
set_two_site_distance
(vertical_dist)Set the two site repulsion distance
set_use_PBC
(*args)Overload 1:
set_use_secondary_radii
([use_radii])Set the use of secondary radii for Pauli repulsion.
set_use_two_site_repulsion
(on_off)Set the use two site repulsion (experimental only)
set_vdw_radii
(nuclei2radiiMap)Set the vdw radii by the nuclei type
Attributes
The membership flag
- property thisown
The membership flag
- set_dispersion_params(s6, a1, a2)
Set the dispersion parameters assording to Grimme et alhttps://doi.org/10.1002/jcc.21759
- Parameters
s6 (float) – Coefficient that scales the entire energy
a1 (float) – multiple of the vdw radii R_ab
a2 (float) – additive to a1*R_ab
- get_dispersion_params()
Get the dispersion parameters
- Parameters
s6 (float) – Coefficient that scales the entire energy
a1 (float) – multiple of the vdw radii R_ab
a2 (float) – additive to a1*R_ab
- set_vdw_radii(nuclei2radiiMap)
Set the vdw radii by the nuclei type
- Parameters
nuclei2radiiMap (
map_id
) – mapping from nuclei integers to vdw Radii (in bohr)
- get_vdw_radii_map()
Get the vdw radii mapping by the nuclei type
- Return type
map_id
- Returns
mapping from nuclei integers to vdw Radii (in bohr)
- get_vdw_radii()
Get the vdw radii used for all sites
- Return type
vec_d
- Returns
array of vdw radii in bohr
- set_C6_map(nucleiToC6Map)
Set the C6 coefficients by the nuclei type
- Parameters
nucleiToC6Map (
map_id
) – mapping from nuclei integers to C6 coeff
- get_C6_map()
Get the C6 coefficient mapping by nuclei type
- Return type
map_id
- Returns
mapping fron nuclei integers to C6 coeff
- get_C6_coeff()
Get the C6 coefficients used for all sites
- Return type
vec_d
- Returns
array of C6 coefficients
- set_pauli_radii(*args)
Overload 1:
Set the Pauli radii for all sites
- Parameters
radii_list (
vec_d
) – list of Pauli radii
Overload 2:
Set the Pauli radii for an individual site
- Parameters
index (int) – the index of the site to change
radii (float) – the Pauli radii to assign
- get_pauli_radii()
Get the Pauli radii for all sites
- Return type
vec_d
- Returns
array of Pauli radii in bohr
- set_pauli_exp(*args)
Overload 1:
Set the Pauli exponents for all sites
- Parameters
exp_list (
vec_d
) – array of exponents to use
Overload 2:
Set the Pauli exponent for a particular site
- Parameters
index (int) – The index of the site to change the exponent of
exponent (float) – The value of the exponent to use on this site
- get_pauli_exp()
Get the Pauli exponents used on all sites in the system
- Return type
vec_d
- Returns
vec_d Array of Pauli exponents (in inverse bohr)
- get_num_sites()
Get the number sites
- Return type
int
- Returns
int
- create_exclusions_from_bonds(bonds, bond_cutoff)
Create exclusions based on wht atoms are bonded to each other
- Parameters
bonds (std::vector< std::pair< int,int >,std::allocator< std::pair< int,int > > >) – A list of index pairs in which each pair declares a bond between those two sites
bond_cutoff (int) – Any site this many bonds away are excluded in the interaction calculation
- create_exclusions_from_fragment(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 (
vec_i
) – An array of indicies
- add_exclusion(i, j)
Add an exclusion between a pair of sites
- Parameters
i (int) – The index of the first site
j (int) – The index of the second site
- get_exclusions(particle1)
Get a list of sites that are excluded from interacting with the i-th site
- Parameters
particle1 (int) – The site to inquire about exclusions
- Return type
std::set< int,std::less< int >,std::allocator< int > >
- Returns
std::set<int> a list of site indicies that do not interact with particle1
- set_use_PBC(*args)
Overload 1:
Turn on or off periodic boundary conditions
- Parameters
is_periodic (boolean) – If true, use PBC, if false, do not use them
Overload 2:
Set the periodic boundaries
- Parameters
is_periodic (boolean) – If true, use PBC, if false, do not use them
x (float) – The x-direction of the periodic box
y (float) – The y-direction of the periodic box
z (float) – The z-direction of the periodic box
- get_use_PBC()
Inquire if PBC is used or not
- Return type
boolean
- Returns
true PBC is being used
- Return type
boolean
- Returns
false PBC is not being used
- initialize()
Clear energy components before a calculation
- calc_energy(coords)
Calculate the total interaction energy of all sites
- Parameters
coords (
vec_d
) – A 1D array of positions of the sites- Return type
float
- Returns
The interaction energy
- calc_one_pair(*args)
Overload 1:
Compute the interaction energy of a single pair of sites
- Parameters
pos (
vec_d
) – A 1D array of positions of the sitesdeltaR (
DeltaR
) – A distance object for the pair of sitesi (int) – Index of the first site
j (int) – Index of the second site
energies (
Energies
) – The Energies object that will be updatedforces (std::vector< Vec3,std::allocator< Vec3 > >) – The forces array that will be updated
- Return type
float
- Returns
double
Overload 2:
Compute the interaction energy of a single pair of sites
- Parameters
pos (
vec_d
) – A 1D array of positions of the sitesi (int) – Index of the first site
j (int) – Index of the second site
forces (std::vector< Vec3,std::allocator< Vec3 > >) – The forces array that will be updated
- Return type
- Returns
Energies that were computed for the pair
- get_pauli_energy()
Return the total Pauli repulsion energy for the system
- Return type
float
- Returns
double
- get_disp_energy()
Return the total dispersion energy for the system
- Return type
float
- Returns
double
- get_forces()
Return the forces exerted on each site after an energy computation
- Return type
std::vector< vec_d,std::allocator< vec_d > >
- Returns
std::vector<vec_d> An Nx3 array of forces
- set_use_secondary_radii(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 (boolean) – If true, the backup radii will alos be used
- set_use_two_site_repulsion(on_off)
Set the use two site repulsion (experimental only)
- Parameters
on_off (boolean) – Set to true to enable
- set_two_site_distance(vertical_dist)
Set the two site repulsion distance
- Parameters
vertical_dist (float) – The virtical distance out of the place
- create_repulsion_sites(vertical_dist, bonds)
Create the two-site repulsion sites
- Parameters
vertical_dist (float) – The virtical distance out of the place
bonds (std::vector< std::pair< int,int >,std::allocator< std::pair< int,int > > >) – A list of all bonds