@@ -426,17 +426,11 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype)
426426 {
427427 for (int j = 0 ;j < ucell.atoms [i].na ;j++)
428428 {
429- FAtom fake_atom;
430- fake_atom.setX (ucell.atoms [i].tau [j].x + vec1[0 ] * ix + vec2[0 ] * iy + vec3[0 ] * iz);
431- fake_atom.setY (ucell.atoms [i].tau [j].y + vec1[1 ] * ix + vec2[1 ] * iy + vec3[1 ] * iz);
432- fake_atom.setZ (ucell.atoms [i].tau [j].z + vec1[2 ] * ix + vec2[2 ] * iy + vec3[2 ] * iz);
433- fake_atom.setType (i);
434- fake_atom.setNatom (j);
435- fake_atom.setCellX (ix);
436- fake_atom.setCellY (iy);
437- fake_atom.setCellZ (iz);
438-
439- this ->fake_atoms .push_back (fake_atom);
429+ double x = ucell.atoms [i].tau [j].x + vec1[0 ] * ix + vec2[0 ] * iy + vec3[0 ] * iz;
430+ double y = ucell.atoms [i].tau [j].y + vec1[1 ] * ix + vec2[1 ] * iy + vec3[1 ] * iz;
431+ double z = ucell.atoms [i].tau [j].z + vec1[2 ] * ix + vec2[2 ] * iy + vec3[2 ] * iz;
432+
433+ this ->fake_atoms .push_back (FAtom (x, y, z, i, j, ix, iy, iz));
440434 }
441435 }
442436 }
@@ -556,42 +550,20 @@ void Atom_input::set_FAtom(const UnitCell &ucell, FAtom &a)const
556550// ----------------------------------------------------------
557551 else
558552 {
559- Load_atom (ucell);
560- a.setX (x);
561- a.setY (y);
562- a.setZ (z);
563- a.setType (type);
564- a.setNatom (natom);
565- // GlobalV::ofs_running<<"\n x = "<<x;
566- // GlobalV::ofs_running<<"\n y = "<<y;
567- // GlobalV::ofs_running<<"\n z = "<<z;
568- // GlobalV::ofs_running<<"\n Type = "<<type;
569- // GlobalV::ofs_running<<"\n natom = "<<natom;
570- }
571-
572- return ;
573- }
574-
575- void Atom_input::Load_atom (const UnitCell& ucell)const
576- {
577- // ModuleBase::TITLE("Atom_input","load_atom");
578- natom++;
553+ natom++;
579554
580- if (natom >= ucell.atoms [type].na )
581- {
582- type ++;
583- natom = 0 ;
555+ if (natom >= ucell.atoms [type].na )
556+ {
557+ type ++;
558+ natom = 0 ;
559+ }
560+ FAtom temp (ucell.atoms [type].tau [natom].x ,
561+ ucell.atoms [type].tau [natom].y ,
562+ ucell.atoms [type].tau [natom].z ,
563+ type, natom,
564+ 0 , 0 , 0 );
565+ a = temp;
584566 }
585567
586- x = ucell.atoms [type].tau [natom].x ;
587-
588- y = ucell.atoms [type].tau [natom].y ;
589- z = ucell.atoms [type].tau [natom].z ;
590-
591- // std::cout<<" x = "<<ucell.atoms[type].tau[natom].x
592- // <<" y = "<<ucell.atoms[type].tau[natom].y
593- // <<" z = "<<ucell.atoms[type].tau[natom].z
594- // <<" type = "<<type
595- // <<" natom = "<<natom;
596568 return ;
597569}
0 commit comments