@@ -43,13 +43,25 @@ void Grid_Driver::Find_atom(const UnitCell& ucell,
4343 local_adjs->adjacent_tau .push_back (ModuleBase::Vector3<double >(atom->x , atom->y , atom->z ));
4444 local_adjs->adj_num ++;
4545 }
46+ // 20241204 zhanghaochong
47+ // for some unknown reason, the last neighbour atom must be it self
48+ // is self must in last, the order cannot be changed.
49+ // if self not in last, test 701_LJ_MD_Anderson will assert
4650 local_adjs->ntype .push_back (ntype);
4751 local_adjs->natom .push_back (nnumber);
4852 local_adjs->box .push_back (ModuleBase::Vector3<int >(0 , 0 , 0 ));
4953 local_adjs->adjacent_tau .push_back (ModuleBase::Vector3<double >(ucell.atoms [ntype].tau [nnumber].x , ucell.atoms [ntype].tau [nnumber].y , ucell.atoms [ntype].tau [nnumber].z ));
5054 ModuleBase::timer::tick (" Grid_Driver" , " Find_atom" );
5155 return ;
5256}
57+ void Grid_Driver::Find_atom (const UnitCell& ucell,
58+ const ModuleBase::Vector3<double >& cartesian_posi,
59+ const int & ntype,
60+ const int & nnumber,
61+ AdjacentAtomInfo* adjs)
62+ {
63+ this ->Find_atom (ucell, ntype, nnumber, adjs);
64+ }
5365
5466// filter_adjs delete not adjacent atoms in adjs
5567void filter_adjs (const std::vector<bool >& is_adj, AdjacentAtomInfo& adjs)
0 commit comments