Skip to content

Commit

Permalink
add InputNlist into API doc (#1009)
Browse files Browse the repository at this point in the history
* add `InputNlist` into API doc

This struct is necessary for C++ APIs.

* Apply suggestions from code review

Co-authored-by: Denghui Lu <[email protected]>

* update comment for `firstneigh`

Co-authored-by: Denghui Lu <[email protected]>
  • Loading branch information
njzjz and denghuilu authored Aug 23, 2021
1 parent 297ce70 commit 29546c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/include/DeepPot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions source/api_cc/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ typedef double ENERGYTYPE;

struct NeighborListData
{
/// Array stores the core region atom's index
std::vector<int > ilist;
/// Array stores the core region atom's neighbor index
std::vector<std::vector<int> > jlist;
/// Array stores the number of neighbors of core region atoms
std::vector<int > numneigh;
/// Array stores the the location of the first neighbor of core region atoms
std::vector<int* > firstneigh;
public:
void copy_from_nlist(const InputNlist & inlist);
Expand All @@ -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.
Expand Down

0 comments on commit 29546c1

Please sign in to comment.