Energy, gradient, virial tensor, and number of interactions.
More...
|
void | tinker::zeroEGV (int vers=rc_flag) |
| Zero out all of the counts, energies, gradients, and virials on device. More...
|
|
void | tinker::scaleGradient (double scale, grad_prec *g0x, grad_prec *g0y, grad_prec *g0z) |
| g0 *= scale . More...
|
|
void | tinker::sumGradient (grad_prec *g0x, grad_prec *g0y, grad_prec *g0z, const grad_prec *g1x, const grad_prec *g1y, const grad_prec *g1z) |
| g0 += g1 . More...
|
|
void | tinker::sumGradient (double scale, grad_prec *g0x, grad_prec *g0y, grad_prec *g0z, const grad_prec *g1x, const grad_prec *g1y, const grad_prec *g1z) |
| g0 += scale*g1 . More...
|
|
void | tinker::copyGradientSync (int vers, double *grdx, double *grdy, double *grdz, const grad_prec *gx_src, const grad_prec *gy_src, const grad_prec *gz_src, int queue) |
| Copies the energy gradients from device to host. More...
|
|
void | tinker::copyGradient (int vers, double *grdx, double *grdy, double *grdz, const grad_prec *gx_src, const grad_prec *gy_src, const grad_prec *gz_src) |
| Copies the energy gradients from device to host. More...
|
|
void | tinker::copyGradient (int vers, double *grdx, double *grdy, double *grdz) |
|
void | tinker::copyEnergy (int vers, energy_prec *eng) |
|
void | tinker::energy_core (int vers, unsigned tsflag, const TimeScaleConfig &tsconfig) |
|
void | tinker::energy (int vers) |
|
void | tinker::energy (int vers, unsigned tsflag, const TimeScaleConfig &tsconfig) |
|
void | tinker::energyData (RcOp) |
| Entry point to the setup functions of all the potential energy terms. More...
|
|
bool | tinker::useEnergyVdw () |
| Logical flag for use of VDW, repulsion, dispersion, etc. terms. More...
|
|
bool | tinker::useEnergyElec () |
| Logical flag for use of electrostatic terms. More...
|
|
void | tinker::egvData (RcOp) |
| Sets up data on device. More...
|
|
const TimeScaleConfig & | tinker::defaultTSConfig () |
|
Energy, gradient, virial tensor, and number of interactions.
Underlying arrays used in energy, gradient, and viria calculation
Electrostatic terms
| .not. analyz | analyz |
ebuf_elec | new array | nullptr |
vbuf_elec | new array | nullptr |
g_elec | new array | new array |
em | alias ebuf_elec | new array |
vir_em | alias vbuf_elec | new array |
dem | alias g_elec | new array |
VDW terms
| .not. analyz | analyz |
ebuf_vdw | new array | nullptr |
vbuf_vdw | new array | nullptr |
g_vdw | new array | new array |
ev | alias ebuf_vdw | new array |
vir_ev | alias vbuf_vdw | new array |
dev | alias g_vdw | new array |
Valence terms
| .not. analyz | analyz |
ebuf | new array | nullptr |
vbuf | new array | nullptr |
g | new array | new array |
eb | alias ebuf | new array |
vir_eb | alias vbuf | new array |
deb | alias g | new array |
◆ TimeScaleConfig
Time scale configuration that assigns a group number to every energy term. Up to 32 different group numbers are supported, from 0 to 31.
This class must:
- implement a C++ style
.at(arg)
member function where arg
is the name of an energy term;
- return the group to which
arg
belongs;
- throw an exception if
arg
is an invalid energy name.
If the k-th bit of the flag is set, all of the energies in Group k will be calculated.
Example 1.
Every energy term in the Verlet integrator is computed at every time-step. Therefore, all of the terms are in the same group. This group (G) can be any number from 0 to 31. Accordingly, the flag must be \( 2^G \).
Example 2.
There are usually two groups, "high frequency" (fast) and "low frequency" (slow), of energy terms in the RESPA integrator. If one decides to assign 3 and 5 to these two groups, respectively, tsconfig.at("ebond")
shall return 3 and tsconfig.at("evdw")
shall return 5.
The values of flags shall be:
- 8 ( \( 2^3 \)) for only the fast terms;
- 32 ( \( 2^5 \)) for only the slow terms;
- 40 (8 + 32) for both groups.
- Note
- To use a new energy term in an existing integrator, the force field developers are responsible to update the time scale configuration of this integrator.
◆ copyEnergy()
void tinker::copyEnergy |
( |
int |
vers, |
|
|
energy_prec * |
eng |
|
) |
| |
Copies the total potential energy to another variable on host. Avoid accessing esum directly because the potential energy may not be evaluated on the current MD step.
◆ copyGradient() [1/2]
void tinker::copyGradient |
( |
int |
vers, |
|
|
double * |
grdx, |
|
|
double * |
grdy, |
|
|
double * |
grdz |
|
) |
| |
Copies the energy gradients from gx, gy, gz to host.
- See also
- gx
-
gy
-
gz
◆ copyGradient() [2/2]
void tinker::copyGradient |
( |
int |
vers, |
|
|
double * |
grdx, |
|
|
double * |
grdy, |
|
|
double * |
grdz, |
|
|
const grad_prec * |
gx_src, |
|
|
const grad_prec * |
gy_src, |
|
|
const grad_prec * |
gz_src |
|
) |
| |
Copies the energy gradients from device to host.
◆ copyGradientSync()
void tinker::copyGradientSync |
( |
int |
vers, |
|
|
double * |
grdx, |
|
|
double * |
grdy, |
|
|
double * |
grdz, |
|
|
const grad_prec * |
gx_src, |
|
|
const grad_prec * |
gy_src, |
|
|
const grad_prec * |
gz_src, |
|
|
int |
queue |
|
) |
| |
Copies the energy gradients from device to host.
◆ defaultTSConfig()
- Returns
- The default TimeScaleConfig object. All of the energy terms are in group 0, and can only be accessed via flag 1.
◆ egvData()
void tinker::egvData |
( |
RcOp |
| ) |
|
◆ energy() [1/2]
void tinker::energy |
( |
int |
vers | ) |
|
First, energy buffers, virial buffers, gradient arrays, and count buffers are set to 0. Then, evaluate energies, gradients, virials, and count interactions. Last, update the global energy and virial tensor variables. Counts are not updated until countReduce() is explicitly called. May skip some steps based on the version parameter.
◆ energy() [2/2]
void tinker::energy |
( |
int |
vers, |
|
|
unsigned |
tsflag, |
|
|
const TimeScaleConfig & |
tsconfig |
|
) |
| |
Initializes to zero and evaluates potential energy with time scale configuration.
- See also
- TimeScaleConfig
◆ energy_core()
void tinker::energy_core |
( |
int |
vers, |
|
|
unsigned |
tsflag, |
|
|
const TimeScaleConfig & |
tsconfig |
|
) |
| |
Evaluates potential energy.
- Parameters
-
vers | Flag to select the version of energy routines. |
tsflag | Time scale flag, a 32-bit encrypted integer. |
tsconfig | Constant reference to a TimeScaleConfig object. |
- See also
- TimeScaleConfig
◆ energyData()
void tinker::energyData |
( |
RcOp |
| ) |
|
Entry point to the setup functions of all the potential energy terms.
◆ scaleGradient()
◆ sumGradient() [1/2]
◆ sumGradient() [2/2]
◆ useEnergyElec()
bool tinker::useEnergyElec |
( |
| ) |
|
Logical flag for use of electrostatic terms.
◆ useEnergyVdw()
bool tinker::useEnergyVdw |
( |
| ) |
|
Logical flag for use of VDW, repulsion, dispersion, etc. terms.
◆ zeroEGV()
void tinker::zeroEGV |
( |
int |
vers = rc_flag | ) |
|
Zero out all of the counts, energies, gradients, and virials on device.
◆ energy_elec
Total electrostatic energy.
◆ energy_valence
◆ energy_vdw
◆ eng_buf
Energy buffer for the valence terms.
◆ eng_buf_elec
Energy buffer for the electrostatic terms.
◆ eng_buf_vdw
Energy buffer for the vdw terms.
◆ esum
◆ gx
Gradient of valence terms; also works as total gradient array.
◆ gx_elec
Gradient of electrostatic terms.
◆ gx_vdw
Gradient of VDW, repulsion, dispersion, etc. terms.
◆ gy
Gradient of valence terms; also works as total gradient array.
◆ gy_elec
Gradient of electrostatic terms.
◆ gy_vdw
Gradient of VDW, repulsion, dispersion, etc. terms.
◆ gz
Gradient of valence terms; also works as total gradient array.
◆ gz_elec
Gradient of electrostatic terms.
◆ gz_vdw
Gradient of VDW, repulsion, dispersion, etc. terms.
◆ vir
Total potential virial tensor.
◆ vir_buf
Virial buffer for the valence terms.
◆ vir_buf_elec
Virial buffer for the electrostatic terms.
◆ vir_buf_vdw
Virial buffer for the vdw terms.
◆ virial_elec
Total electrostatic virial tensor.
◆ virial_valence
Total valence virial tensor.
◆ virial_vdw