From 89ff7c9a02d2b55afcfb32aea3c73e3ac511b826 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 21 Aug 2021 15:11:19 -0400 Subject: [PATCH 1/3] add `InputNlist` into API doc This struct is necessary for C++ APIs. --- doc/Doxyfile | 2 +- source/api_cc/include/DeepPot.h | 2 +- source/api_cc/include/common.h | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index c7af10d41a..a554710377 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -865,7 +865,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../source/api_cc/include/ +INPUT = ../source/api_cc/include/ ../source/lib/include/neighbor_list.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/source/api_cc/include/DeepPot.h b/source/api_cc/include/DeepPot.h index d0c9099210..6057cf4ab7 100644 --- a/source/api_cc/include/DeepPot.h +++ b/source/api_cc/include/DeepPot.h @@ -128,7 +128,7 @@ class DeepPot * @param[in] atype The atom types. The list should contain natoms ints. * @param[in] box The cell of the region. The array should be of size nframes x 9. * @param[in] nghost The number of ghost atoms. - * @param[in] inlist The input neighbour list. + * @param[in] lmp_list The input neighbour list. * @param[in] ago Update the internal neighbour list if ago is 0. * @param[in] fparam The frame parameter. The array can be of size : * nframes x dim_fparam. diff --git a/source/api_cc/include/common.h b/source/api_cc/include/common.h index 7c769c4b1e..a6e4610a8b 100644 --- a/source/api_cc/include/common.h +++ b/source/api_cc/include/common.h @@ -32,9 +32,13 @@ typedef double ENERGYTYPE; struct NeighborListData { + /// Number of core region atoms std::vector ilist; + /// Array stores the core region atom's index std::vector > jlist; + /// Array stores the core region atom's neighbor atom number std::vector numneigh; + /// Array stores the core region atom's neighbor index std::vector firstneigh; public: void copy_from_nlist(const InputNlist & inlist); @@ -44,6 +48,9 @@ struct NeighborListData void make_inlist(InputNlist & inlist); }; +/** @struct deepmd::InputNlist + **/ + /** * @brief Check if the model version is supported. * @param[in] model_version The model version. From 7cf3f00b6d623baca31fe364f483f7d0acff3458 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sun, 22 Aug 2021 22:28:19 -0400 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Denghui Lu --- source/api_cc/include/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/api_cc/include/common.h b/source/api_cc/include/common.h index a6e4610a8b..094439c79d 100644 --- a/source/api_cc/include/common.h +++ b/source/api_cc/include/common.h @@ -32,9 +32,9 @@ typedef double ENERGYTYPE; struct NeighborListData { - /// Number of core region atoms - std::vector ilist; /// Array stores the core region atom's index + std::vector ilist; + /// Array stores the core region atom's neighbor index std::vector > jlist; /// Array stores the core region atom's neighbor atom number std::vector numneigh; From b6e5f8c6d4f724c3e8f07ab2fc52283e78d84068 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 23 Aug 2021 00:49:59 -0400 Subject: [PATCH 3/3] update comment for `firstneigh` --- source/api_cc/include/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/api_cc/include/common.h b/source/api_cc/include/common.h index 094439c79d..6d24f9d5c3 100644 --- a/source/api_cc/include/common.h +++ b/source/api_cc/include/common.h @@ -36,9 +36,9 @@ struct NeighborListData std::vector ilist; /// Array stores the core region atom's neighbor index std::vector > jlist; - /// Array stores the core region atom's neighbor atom number + /// Array stores the number of neighbors of core region atoms std::vector numneigh; - /// Array stores the core region atom's neighbor index + /// Array stores the the location of the first neighbor of core region atoms std::vector firstneigh; public: void copy_from_nlist(const InputNlist & inlist);