@@ -548,7 +548,7 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
548548 // mohan add 2010-06-30
549549 // xiaohui modify 2015-03-15, cancel outputfile "STRU_READIN.xyz"
550550 // this->print_cell_xyz("STRU_READIN.xyz");
551- this ->check_dtau ( );
551+ unitcell::check_dtau ( this ->atoms , this -> ntype , this -> lat0 , this -> latvec );
552552
553553 if (unitcell::check_tau (this ->atoms , this ->ntype , this ->lat0 ))
554554 {
@@ -680,77 +680,6 @@ int UnitCell::find_type(const std::string &label)
680680}
681681*/
682682
683- void UnitCell::check_dtau () {
684- for (int it=0 ; it<ntype; it++)
685- {
686- Atom* atom1 = &atoms[it];
687- for (int ia=0 ; ia<atoms[it].na ; ia++)
688- {
689- double dx2 = (atom1->taud [ia].x +10000 ) - int (atom1->taud [ia].x +10000 );
690- double dy2 = (atom1->taud [ia].y +10000 ) - int (atom1->taud [ia].y +10000 );
691- double dz2 = (atom1->taud [ia].z +10000 ) - int (atom1->taud [ia].z +10000 );
692-
693- // mohan add 2011-04-07
694- while (dx2 >= 1 )
695- {
696- GlobalV::ofs_warning << " dx2 is >=1 " << std::endl;
697- dx2 -= 1.0 ;
698- }
699- while (dy2 >= 1 )
700- {
701- GlobalV::ofs_warning << " dy2 is >=1 " << std::endl;
702- dy2 -= 1.0 ;
703- }
704- while (dz2 >= 1 )
705- {
706- GlobalV::ofs_warning << " dz2 is >=1 " << std::endl;
707- dz2 -= 1.0 ;
708- }
709- // mohan add 2011-04-07
710- while (dx2<0 )
711- {
712- GlobalV::ofs_warning << " dx2 is <0 " << std::endl;
713- dx2 += 1.0 ;
714- }
715- while (dy2<0 )
716- {
717- GlobalV::ofs_warning << " dy2 is <0 " << std::endl;
718- dy2 += 1.0 ;
719- }
720- while (dz2<0 )
721- {
722- GlobalV::ofs_warning << " dz2 is <0 " << std::endl;
723- dz2 += 1.0 ;
724- }
725-
726- atom1->taud [ia].x = dx2;
727- atom1->taud [ia].y = dy2;
728- atom1->taud [ia].z = dz2;
729-
730- double cx2=0.0 ;
731- double cy2=0.0 ;
732- double cz2=0.0 ;
733-
734- ModuleBase::Mathzone::Direct_to_Cartesian (
735- atom1->taud [ia].x , atom1->taud [ia].y , atom1->taud [ia].z ,
736- latvec.e11 , latvec.e12 , latvec.e13 ,
737- latvec.e21 , latvec.e22 , latvec.e23 ,
738- latvec.e31 , latvec.e32 , latvec.e33 ,
739- cx2, cy2, cz2);
740-
741- atom1->tau [ia].x = cx2;
742- atom1->tau [ia].y = cy2;
743- atom1->tau [ia].z = cz2;
744-
745- // std::cout << std::setw(15) << dx2 << std::setw(15) << dy2 << std::setw(15) << dz2
746- // << std::setw(15) << cx2 << std::setw(15) << cy2 << std::setw(15) << cz2
747- // << std::endl;
748-
749- }
750- }
751- return ;
752- }
753-
754683void UnitCell::read_orb_file (int it, std::string &orb_file, std::ofstream &ofs_running, Atom* atom)
755684{
756685 // the maximum L is 9 like cc-pV9Z, according to the basissetexchange https://www.basissetexchange.org/
0 commit comments