Skip to content

Commit

Permalink
Merge branch 'deepmodeling:devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
mingzhong15 committed Apr 27, 2023
2 parents 03eb354 + b13b26c commit 3356b67
Show file tree
Hide file tree
Showing 5 changed files with 1,086 additions and 35 deletions.
104 changes: 104 additions & 0 deletions source/api_c/include/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,97 @@ extern void DP_DeepPotModelDeviComputeNListf(DP_DeepPotModelDevi* dp,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP model deviation
*with neighbor list. (double version)
* @version 2
* @param[in] dp The DP model deviation to use.
* @param[in] nframes The number of frames. Only support 1 for now.
* @param[in] natoms The number of atoms.
* @param[in] coord The coordinates of atoms. The array should be of size natoms
*x 3.
* @param[in] atype The atom types. The array should contain natoms ints.
* @param[in] box The cell of the region. The array should be of size 9. Pass
*NULL if pbc is not used.
* @param[in] nghost The number of ghost atoms.
* @param[in] nlist The neighbor list.
* @param[in] ago Update the internal neighbour list if ago is 0.
* @param[in] fparam The frame parameters. The array can be of size nframes x
*dim_fparam.
* @param[in] aparam The atom parameters. The array can be of size nframes x
*natoms x dim_aparam.
* @param[out] energy Output energy.
* @param[out] force Output force. The array should be of size natoms x 3.
* @param[out] virial Output virial. The array should be of size 9.
* @param[out] atomic_energy Output atomic energy. The array should be of size
*natoms.
* @param[out] atomic_virial Output atomic virial. The array should be of size
*natoms x 9.
* @warning The output arrays should be allocated before calling this function.
*Pass NULL if not required.
**/
void DP_DeepPotModelDeviComputeNList2(DP_DeepPotModelDevi* dp,
const int nframes,
const int natoms,
const double* coord,
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* virial,
double* atomic_energy,
double* atomic_virial);
/**
* @brief Evaluate the energy, force and virial by using a DP model deviation
*with neighbor list. (float version)
* @version 2
* @param[in] dp The DP model deviation to use.
* @param[in] nframes The number of frames. Only support 1 for now.
* @param[in] natoms The number of atoms.
* @param[in] coord The coordinates of atoms. The array should be of size natoms
*x 3.
* @param[in] atype The atom types. The array should contain natoms ints.
* @param[in] box The cell of the region. The array should be of size 9. Pass
*NULL if pbc is not used.
* @param[in] nghost The number of ghost atoms.
* @param[in] nlist The neighbor list.
* @param[in] ago Update the internal neighbour list if ago is 0.
* @param[in] fparam The frame parameters. The array can be of size nframes x
*dim_fparam.
* @param[in] aparam The atom parameters. The array can be of size nframes x
*natoms x dim_aparam.
* @param[out] energy Output energy.
* @param[out] force Output force. The array should be of size natoms x 3.
* @param[out] virial Output virial. The array should be of size 9.
* @param[out] atomic_energy Output atomic energy. The array should be of size
*natoms.
* @param[out] atomic_virial Output atomic virial. The array should be of size
*natoms x 9.
* @warning The output arrays should be allocated before calling this function.
*Pass NULL if not required.
**/
void DP_DeepPotModelDeviComputeNListf2(DP_DeepPotModelDevi* dp,
const int nframes,
const int natoms,
const float* coord,
const int* atype,
const float* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
const float* fparam,
const float* aparam,
double* energy,
float* force,
float* virial,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Get the type map of a DP model deviation.
* @param[in] dp The DP model deviation to use.
Expand Down Expand Up @@ -584,6 +675,19 @@ int DP_DeepPotGetDimAParam(DP_DeepPot* dp);
*/
const char* DP_DeepPotGetTypeMap(DP_DeepPot* dp);

/**
* @brief Get the dimension of frame parameters of a DP Model Deviation.
* @param[in] dp The DP Model Deviation to use.
* @return The dimension of frame parameters of the DP Model Deviation.
*/
int DP_DeepPotModelDeviGetDimFParam(DP_DeepPotModelDevi* dp);
/**
* @brief Get the dimension of atomic parameters of a DP Model Deviation.
* @param[in] dp The DP Model Deviation to use.
* @return The dimension of atomic parameters of the DP Model Deviation.
*/
int DP_DeepPotModelDeviGetDimAParam(DP_DeepPotModelDevi* dp);

/**
* @brief The deep tensor.
**/
Expand Down
Loading

0 comments on commit 3356b67

Please sign in to comment.