Skip to content

Commit 168628b

Browse files
committed
add new find atom interface
1 parent a9bb0c2 commit 168628b

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

source/module_cell/module_neighbor/sltk_grid.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,7 @@ class Grid
3535
double x_max;
3636
double y_max;
3737
double z_max;
38-
/*
39-
// If there is no cells expansion, this would be 1, 1, 1.
40-
// If a cell is expanded, it indicates the number of unit cells in each direction,
41-
// including the original unit cell. For example, 3, 3, 3 would mean 27 unit cells.
42-
int cell_nx;
43-
int cell_ny;
44-
int cell_nz;
4538

46-
// true cell means the index of original cell. cell index start from 0 to (nx-1)
47-
int true_cell_x;
48-
int true_cell_y;
49-
int true_cell_z;
50-
*/
5139
// The algorithm for searching neighboring atoms uses a "box" partitioning method.
5240
// Each box has an edge length of sradius, and the number of boxes in each direction is recorded here.
5341
double box_edge_length;
@@ -120,8 +108,6 @@ class Grid
120108
int glayerY_minus;
121109
int glayerZ;
122110
int glayerZ_minus;
123-
124-
125111
};
126112

127113
#endif

source/module_cell/module_neighbor/sltk_grid_driver.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Grid_Driver::~Grid_Driver()
2222
{
2323
}
2424

25-
void Grid_Driver::Find_atom(const UnitCell& ucell,
26-
const ModuleBase::Vector3<double>& cartesian_pos,
27-
const int& ntype,
25+
void Grid_Driver::Find_atom(const int& ntype,
2826
const int& nnumber,
2927
AdjacentAtomInfo* adjs)
3028
{

source/module_cell/module_neighbor/sltk_grid_driver.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,20 @@ class Grid_Driver : public Grid
6363
// 2. And store results into parameter adjs when adjs is
6464
// NOT NULL
6565
//==========================================================
66+
void Find_atom(const int& ntype,
67+
const int& nnumber,
68+
AdjacentAtomInfo* adjs = nullptr);
69+
70+
// cartesian_posi and ucell is deprecated 20241204 zhanghaochong
71+
// this interface is deprecated, please use Find_atom above
6672
void Find_atom(const UnitCell& ucell,
6773
const ModuleBase::Vector3<double>& cartesian_posi,
6874
const int& ntype,
6975
const int& nnumber,
70-
AdjacentAtomInfo* adjs = nullptr);
76+
AdjacentAtomInfo* adjs = nullptr)
77+
{
78+
this->Find_atom(ntype, nnumber, adjs);
79+
}
7180

7281
//==========================================================
7382
// EXPLAIN : The adjacent information for the input

0 commit comments

Comments
 (0)