@@ -564,92 +564,4 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
564564}// end read_atom_positions
565565
566566
567- void UnitCell::print_stru_file (const std::string& fn,
568- const int & nspin,
569- const bool & direct,
570- const bool & vel,
571- const bool & magmom,
572- const bool & orb,
573- const bool & dpks_desc,
574- const int & iproc) const
575- {
576- ModuleBase::TITLE (" UnitCell" ," print_stru_file" );
577- if (iproc != 0 ) {
578- return ; // old: if(GlobalV::MY_RANK != 0) return;
579- }
580- // ATOMIC_SPECIES
581- std::string str = " ATOMIC_SPECIES\n " ;
582- for (int it=0 ; it<ntype; it++){ str += FmtCore::format (" %s %8.4f %s %s\n " , atom_label[it], atom_mass[it], pseudo_fn[it], pseudo_type[it]); }
583- // NUMERICAL_ORBITAL
584- if (orb)
585- {
586- str += " \n NUMERICAL_ORBITAL\n " ;
587- for (int it = 0 ; it < ntype; it++) { str += orbital_fn[it] + " \n " ; }
588- }
589- // NUMERICAL_DESCRIPTOR
590- if (dpks_desc) { str += " \n NUMERICAL_DESCRIPTOR\n " + descriptor_file + " \n " ; }
591- // LATTICE_CONSTANT
592- str += " \n LATTICE_CONSTANT\n " + FmtCore::format (" %-.10f\n " , lat0);
593- // LATTICE_VECTORS
594- str += " \n LATTICE_VECTORS\n " ;
595- str += FmtCore::format (" %20.10f%20.10f%20.10f\n " , latvec.e11 , latvec.e12 , latvec.e13 );
596- str += FmtCore::format (" %20.10f%20.10f%20.10f\n " , latvec.e21 , latvec.e22 , latvec.e23 );
597- str += FmtCore::format (" %20.10f%20.10f%20.10f\n " , latvec.e31 , latvec.e32 , latvec.e33 );
598- // ATOMIC_POSITIONS
599- str += " \n ATOMIC_POSITIONS\n " ;
600- const std::string scale = direct? " Direct" : " Cartesian" ;
601- int nat_ = 0 ; // counter iat, for printing out Mulliken magmom who is indexed by iat
602- str += scale + " \n " ;
603- for (int it = 0 ; it < ntype; it++)
604- {
605- str += " \n " + atoms[it].label + " #label\n " ;
606- str += FmtCore::format (" %-8.4f #magnetism\n " , magnet.start_magnetization [it]);
607- str += FmtCore::format (" %d #number of atoms\n " , atoms[it].na );
608- for (int ia = 0 ; ia < atoms[it].na ; ia++)
609- {
610- // output position
611- const double & x = direct? atoms[it].taud [ia].x : atoms[it].tau [ia].x ;
612- const double & y = direct? atoms[it].taud [ia].y : atoms[it].tau [ia].y ;
613- const double & z = direct? atoms[it].taud [ia].z : atoms[it].tau [ia].z ;
614- str += FmtCore::format (" %20.10f%20.10f%20.10f" , x, y, z);
615- str += FmtCore::format (" m%2d%2d%2d" , atoms[it].mbl [ia].x , atoms[it].mbl [ia].y , atoms[it].mbl [ia].z );
616- if (vel) // output velocity
617- {
618- str += FmtCore::format (" v%20.10f%20.10f%20.10f" , atoms[it].vel [ia].x , atoms[it].vel [ia].y , atoms[it].vel [ia].z );
619- }
620- if (nspin == 2 && magmom) // output magnetic information
621- {
622- str += FmtCore::format (" mag%8.4f" , atom_mulliken[nat_][1 ]);
623- }
624- else if (nspin == 4 && magmom) // output magnetic information
625- {
626- str += FmtCore::format (" mag%8.4f%8.4f%8.4f" , atom_mulliken[nat_][1 ], atom_mulliken[nat_][2 ], atom_mulliken[nat_][3 ]);
627- }
628- str += " \n " ;
629- nat_++;
630- }
631- }
632- std::ofstream ofs (fn.c_str ());
633- ofs << str;
634- ofs.close ();
635- return ;
636- }
637-
638-
639- /*
640- int UnitCell::find_type(const std::string &label)
641- {
642- if(PARAM.inp.test_pseudo_cell) ModuleBase::TITLE("UnitCell","find_type");
643- assert(ntype>0);
644- for(int it=0;it<ntype;it++)
645- {
646- if(atoms[it].label == label)
647- {
648- return it;
649- }
650- }
651- ModuleBase::WARNING_QUIT("UnitCell::find_type","Can not find the atom type!");
652- return -1;
653- }
654- */
655567
0 commit comments