Function DP_DeepSpinComputeNList2#
Defined in File c_api.h
Function Documentation#
- void DP_DeepSpinComputeNList2(DP_DeepSpin *dp, const int nframes, const int natoms, const double *coord, const double *spin, const int *atype, const double *cell, const int nghost, const DP_Nlist *nlist, const int ago, const double *fparam, const double *aparam, double *energy, double *force, double *force_mag, double *virial, double *atomic_energy, double *atomic_virial)#
Evaluate the energy, force, magnetic force and virial by using a DP spin model with the neighbor list. (double version)
- Version
2
- Since
API version 24
Warning
The output arrays should be allocated before calling this function. Pass NULL if not required.
- Parameters:
dp – [in] The DP spin model to use.
nframes – [in] The number of frames.
natoms – [in] The number of atoms.
coord – [in] The coordinates of atoms. The array should be of size natoms x 3.
spin – [in] The spins of atoms, [0, 0, 0] if no spin. The array should be of size nframes x natoms x 3.
atype – [in] The atom types. The array should contain natoms ints.
box – [in] The cell of the region. The array should be of size 9. Pass NULL if pbc is not used.
nghost – [in] The number of ghost atoms.
nlist – [in] The neighbor list.
ago – [in] Update the internal neighbour list if ago is 0.
fparam – [in] The frame parameters. The array can be of size nframes x dim_fparam.
aparam – [in] The atom parameters. The array can be of size nframes x natoms x dim_aparam.
energy – [out] Output energy.
force – [out] Output force. The array should be of size natoms x 3.
force_mag – [out] Output magnetic force on each atom. The array should be of size natoms x 3.
virial – [out] Output virial. The array should be of size 9.
atomic_energy – [out] Output atomic energy. The array should be of size natoms.
atomic_virial – [out] Output atomic virial. The array should be of size natoms x 9.