Class DeepTensorTF

Inheritance Relationships

Base Type

Class Documentation

class DeepTensorTF : public deepmd::DeepTensorBase

Deep Tensor.

Unnamed Group

virtual void computew(std::vector<double> &global_tensor, std::vector<double> &force, std::vector<double> &virial, std::vector<double> &atom_tensor, std::vector<double> &atom_virial, const std::vector<double> &coord, const std::vector<int> &atype, const std::vector<double> &box, const bool request_deriv)

Evaluate the global tensor and component-wise force and virial.

Parameters
  • global_tensor[out] The global tensor to evalute.

  • force[out] The component-wise force of the global tensor, size odim x natoms x 3.

  • virial[out] The component-wise virial of the global tensor, size odim x 9.

  • atom_tensor[out] The atomic tensor value of the model, size natoms x odim.

  • atom_virial[out] The component-wise atomic virial of the global tensor, size odim x natoms x 9.

  • coord[in] The coordinates of atoms. The array should be of size 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 9.

  • request_deriv[in] Whether to request the derivative of the global tensor, including force and virial.

virtual void computew(std::vector<float> &global_tensor, std::vector<float> &force, std::vector<float> &virial, std::vector<float> &atom_tensor, std::vector<float> &atom_virial, const std::vector<float> &coord, const std::vector<int> &atype, const std::vector<float> &box, const bool request_deriv)

Unnamed Group

virtual void computew(std::vector<double> &global_tensor, std::vector<double> &force, std::vector<double> &virial, std::vector<double> &atom_tensor, std::vector<double> &atom_virial, const std::vector<double> &coord, const std::vector<int> &atype, const std::vector<double> &box, const int nghost, const InputNlist &inlist, const bool request_deriv)

Evaluate the global tensor and component-wise force and virial.

Parameters
  • global_tensor[out] The global tensor to evalute.

  • force[out] The component-wise force of the global tensor, size odim x natoms x 3.

  • virial[out] The component-wise virial of the global tensor, size odim x 9.

  • atom_tensor[out] The atomic tensor value of the model, size natoms x odim.

  • atom_virial[out] The component-wise atomic virial of the global tensor, size odim x natoms x 9.

  • coord[in] The coordinates of atoms. The array should be of size 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 9.

  • nghost[in] The number of ghost atoms.

  • inlist[in] The input neighbour list.

  • request_deriv[in] Whether to request the derivative of the global tensor, including force and virial.

virtual void computew(std::vector<float> &global_tensor, std::vector<float> &force, std::vector<float> &virial, std::vector<float> &atom_tensor, std::vector<float> &atom_virial, const std::vector<float> &coord, const std::vector<int> &atype, const std::vector<float> &box, const int nghost, const InputNlist &inlist, const bool request_deriv)

Public Functions

DeepTensorTF()

Deep Tensor constructor without initialization.

~DeepTensorTF()
DeepTensorTF(const std::string &model, const int &gpu_rank = 0, const std::string &name_scope = "")

Deep Tensor constructor with initialization..

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

  • gpu_rank[in] The GPU rank. Default is 0.

  • name_scope[in] Name scopes of operations.

virtual void init(const std::string &model, const int &gpu_rank = 0, const std::string &name_scope = "")

Initialize the Deep Tensor.

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

  • gpu_rank[in] The GPU rank. Default is 0.

  • name_scope[in] Name scopes of operations.

inline virtual double cutoff() const

Get the cutoff radius.

Returns

The cutoff radius.

inline virtual int numb_types() const

Get the number of types.

Returns

The number of types.

inline virtual int output_dim() const

Get the output dimension.

Returns

The output dimension.

inline virtual const std::vector<int> &sel_types() const

Get the list of sel types.

Returns

The list of sel types.

virtual void get_type_map(std::string &type_map)

Get the type map (element name of the atom types) of this model.

Parameters

type_map[out] The type map of this model.