Class DeepTensorBase#
Defined in File DeepTensor.h
Inheritance Relationships#
Derived Type#
public deepmd::DeepTensorTF
(Class DeepTensorTF)
Class Documentation#
- class DeepTensorBase#
Deep Tensor.
Subclassed by deepmd::DeepTensorTF
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) = 0#
Evaluate the global tensor and component-wise force and virial.
- Parameters:
global_tensor – [out] The global tensor to evaluate.
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) = 0#
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) = 0#
Evaluate the global tensor and component-wise force and virial.
- Parameters:
global_tensor – [out] The global tensor to evaluate.
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) = 0#
Public Functions
- inline DeepTensorBase()#
Deep Tensor constructor without initialization.
- inline virtual ~DeepTensorBase()#
- DeepTensorBase(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 = "") = 0#
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.
- virtual double cutoff() const = 0#
Get the cutoff radius.
- Returns:
The cutoff radius.
- virtual int numb_types() const = 0#
Get the number of types.
- Returns:
The number of types.
- virtual int output_dim() const = 0#
Get the output dimension.
- Returns:
The output dimension.
- virtual const std::vector<int> &sel_types() const = 0#
Get the list of sel types.
- Returns:
The list of sel types.
- virtual void get_type_map(std::string &type_map) = 0#
Get the type map (element name of the atom types) of this model.
- Parameters:
type_map – [out] The type map of this model.
- 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) = 0#