Class DeepSpin#

Inheritance Relationships#

Base Type#

Class Documentation#

class DeepSpin : public deepmd::hpp::DeepBaseModel#

Public Functions

inline DeepSpin()#

DP constructor without initialization.

inline ~DeepSpin()#
inline DeepSpin(const std::string &model, const int &gpu_rank = 0, const std::string &file_content = "")#

DP constructor with initialization.

Parameters:
  • model[in] The name of the frozen model file.

  • gpu_rank[in] The GPU rank.

  • file_content[in] The content of the frozen model file.

inline void init(const std::string &model, const int &gpu_rank = 0, const std::string &file_content = "")#

Initialize the DP.

Parameters:
  • model[in] The name of the frozen model file.

  • gpu_rank[in] The GPU rank.

  • file_content[in] The content of the frozen model file.

template<typename VALUETYPE, typename ENERGYVTYPE>
inline void compute(ENERGYVTYPE &ener, std::vector<VALUETYPE> &force, std::vector<VALUETYPE> &force_mag, std::vector<VALUETYPE> &virial, const std::vector<VALUETYPE> &coord, const std::vector<VALUETYPE> &spin, const std::vector<int> &atype, const std::vector<VALUETYPE> &box, const std::vector<VALUETYPE> &fparam = std::vector<VALUETYPE>(), const std::vector<VALUETYPE> &aparam = std::vector<VALUETYPE>())#

Evaluate the energy, force, magnetic force and virial by using this DP spin model.

Warning

Natoms should not be zero when computing multiple frames.

Parameters:
  • ener[out] The system energy.

  • force[out] The force on each atom.

  • force_mag[out] The magnetic force on each atom.

  • virial[out] The virial.

  • coord[in] The coordinates of atoms. The array should be of size nframes x 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 list should contain natoms ints.

  • box[in] The cell of the region. The array should be of size nframes x 9 (PBC) or empty (no PBC).

  • fparam[in] The frame parameter. The array can be of size : nframes x dim_fparam. dim_fparam. Then all frames are assumed to be provided with the same fparam.

  • aparam[in] The atomic parameter The array can be of size : nframes x natoms x dim_aparam. natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.

template<typename VALUETYPE, typename ENERGYVTYPE>
inline void compute(ENERGYVTYPE &ener, std::vector<VALUETYPE> &force, std::vector<VALUETYPE> &force_mag, std::vector<VALUETYPE> &virial, std::vector<VALUETYPE> &atom_energy, std::vector<VALUETYPE> &atom_virial, const std::vector<VALUETYPE> &coord, const std::vector<VALUETYPE> &spin, const std::vector<int> &atype, const std::vector<VALUETYPE> &box, const std::vector<VALUETYPE> &fparam = std::vector<VALUETYPE>(), const std::vector<VALUETYPE> &aparam = std::vector<VALUETYPE>())#

Evaluate the energy, force, magnetic force, virial, atomic energy, and atomic virial by using this DP spin model.

Warning

Natoms should not be zero when computing multiple frames.

Parameters:
  • ener[out] The system energy.

  • force[out] The force on each atom.

  • force_mag[out] The magnetic force on each atom.

  • virial[out] The virial.

  • atom_energy[out] The atomic energy.

  • atom_virial[out] The atomic virial.

  • coord[in] The coordinates of atoms. The array should be of size nframes x 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 list should contain natoms ints.

  • box[in] The cell of the region. The array should be of size nframes x 9 (PBC) or empty (no PBC).

  • fparam[in] The frame parameter. The array can be of size : nframes x dim_fparam. dim_fparam. Then all frames are assumed to be provided with the same fparam.

  • aparam[in] The atomic parameter The array can be of size : nframes x natoms x dim_aparam. natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.

template<typename VALUETYPE, typename ENERGYVTYPE>
inline void compute(ENERGYVTYPE &ener, std::vector<VALUETYPE> &force, std::vector<VALUETYPE> &force_mag, std::vector<VALUETYPE> &virial, const std::vector<VALUETYPE> &coord, const std::vector<VALUETYPE> &spin, const std::vector<int> &atype, const std::vector<VALUETYPE> &box, const int nghost, const InputNlist &lmp_list, const int &ago, const std::vector<VALUETYPE> &fparam = std::vector<VALUETYPE>(), const std::vector<VALUETYPE> &aparam = std::vector<VALUETYPE>())#

Evaluate the energy, force, magnetic force and virial by using this DP spin model with the neighbor list.

Warning

Natoms should not be zero when computing multiple frames.

Parameters:
  • ener[out] The system energy.

  • force[out] The force on each atom.

  • force_mag[out] The magnetic force on each atom.

  • virial[out] The virial.

  • coord[in] The coordinates of atoms. The array should be of size nframes x 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 list should contain natoms ints.

  • box[in] The cell of the region. The array should be of size nframes x 9 (PBC) or empty (no PBC).

  • 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 parameter. The array can be of size : nframes x dim_fparam. dim_fparam. Then all frames are assumed to be provided with the same fparam.

  • aparam[in] The atomic parameter The array can be of size : nframes x natoms x dim_aparam. natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.

template<typename VALUETYPE, typename ENERGYVTYPE>
inline void compute(ENERGYVTYPE &ener, std::vector<VALUETYPE> &force, std::vector<VALUETYPE> &force_mag, std::vector<VALUETYPE> &virial, std::vector<VALUETYPE> &atom_energy, std::vector<VALUETYPE> &atom_virial, const std::vector<VALUETYPE> &coord, const std::vector<VALUETYPE> &spin, const std::vector<int> &atype, const std::vector<VALUETYPE> &box, const int nghost, const InputNlist &lmp_list, const int &ago, const std::vector<VALUETYPE> &fparam = std::vector<VALUETYPE>(), const std::vector<VALUETYPE> &aparam = std::vector<VALUETYPE>())#

Evaluate the energy, force, magnetic force, virial, atomic energy, and atomic virial by using this DP spin model with the neighbor list.

Warning

Natoms should not be zero when computing multiple frames.

Parameters:
  • ener[out] The system energy.

  • force[out] The force on each atom.

  • force_mag[out] The magnetic force on each atom.

  • virial[out] The virial.

  • atom_energy[out] The atomic energy.

  • atom_virial[out] The atomic virial.

  • coord[in] The coordinates of atoms. The array should be of size nframes x 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 list should contain natoms ints.

  • box[in] The cell of the region. The array should be of size nframes x 9 (PBC) or empty (no PBC).

  • 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 parameter. The array can be of size : nframes x dim_fparam. dim_fparam. Then all frames are assumed to be provided with the same fparam.

  • aparam[in] The atomic parameter The array can be of size : nframes x natoms x dim_aparam. natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam.