Skip to content

Commit

Permalink
fix(symmetry): do symmetry analysis of real_brav before transfering c…
Browse files Browse the repository at this point in the history
…oordinate to original lattice system (#1435)
  • Loading branch information
pxlxingliang committed Oct 27, 2022
1 parent 6e90dae commit 432ea23
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions source/module_symmetry/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ void Symmetry::analy_sys(const UnitCell_pseudo &ucell, std::ofstream &ofs_runnin
// std::cout << "a1 = " << a2.x << " " << a2.y << " " << a2.z <<std::endl;
// std::cout << "a1 = " << a3.x << " " << a3.y << " " << a3.z <<std::endl;

//Symm_Other::print1(ibrav, cel_const, ofs_running);
Symm_Other::print1(real_brav, cel_const, ofs_running);
this->change_lattice();
//this->pricell(); // pengfei Li 2018-05-14
//for( iat =0 ; iat < ucell.nat ; iat++)
// std::cout << " newpos_now = " << newpos[3*iat] << " " << newpos[3*iat+1] << " " << newpos[3*iat+2] << std::endl;
test_brav = true; // output the real ibrav and point group
ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",real_brav);
this->setgroup(this->symop, this->nop, this->real_brav);
this->getgroup(this->nrot, this->nrotk, ofs_running);
this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running);
ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname);
ofs_running<<"Warning : If the optimal symmetric configuration is not the input configuration, "<<'\n';
ofs_running<<"you have to manually change configurations, ABACUS would only calculate the input structure."<<'\n';

// the atom position coordinates are changed to
// crystal coordinates of a1,a2,a3
Expand Down Expand Up @@ -156,22 +170,6 @@ void Symmetry::analy_sys(const UnitCell_pseudo &ucell, std::ofstream &ofs_runnin
}
}


//Symm_Other::print1(ibrav, cel_const, ofs_running);
Symm_Other::print1(real_brav, cel_const, ofs_running);
this->change_lattice();
//this->pricell(); // pengfei Li 2018-05-14
//for( iat =0 ; iat < ucell.nat ; iat++)
// std::cout << " newpos_now = " << newpos[3*iat] << " " << newpos[3*iat+1] << " " << newpos[3*iat+2] << std::endl;
test_brav = true; // output the real ibrav and point group
ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",real_brav);
this->setgroup(this->symop, this->nop, this->real_brav);
this->getgroup(this->nrot, this->nrotk, ofs_running);
this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running);
ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname);
ofs_running<<"Warning : If the optimal symmetric configuration is not the input configuration, "<<'\n';
ofs_running<<"you have to manually change configurations, ABACUS would only calculate the input structure."<<'\n';

test_brav = false; // use the input ibrav to calculate
//ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",ibrav);
this->setgroup(this->symop, this->nop, this->ibrav);
Expand Down

0 comments on commit 432ea23

Please sign in to comment.