Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 35 additions & 18 deletions source/module_symmetry/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void Symmetry::analy_sys(const UnitCell_pseudo &ucell, std::ofstream &ofs_runnin
new_lat.e11=a1.x; new_lat.e12=a1.y; new_lat.e13=a1.z;
new_lat.e21=a2.x; new_lat.e22=a2.y; new_lat.e23=a2.z;
new_lat.e31=a3.x; new_lat.e32=a3.y; new_lat.e33=a3.z;
output::printM3(ofs_running,"STANDARD LATTICE VECTORS: (CARTESIAN COORDINATE: IN UNIT OF A0)",new_lat);
//output::printM3(ofs_running,"STANDARD LATTICE VECTORS: (CARTESIAN COORDINATE: IN UNIT OF A0)",new_lat);

int iat=0;
for(int it=0; it<ucell.ntype; ++it)
Expand Down Expand Up @@ -156,21 +156,31 @@ void Symmetry::analy_sys(const UnitCell_pseudo &ucell, std::ofstream &ofs_runnin
}


Symm_Other::print1(ibrav, cel_const, ofs_running);

//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;
ModuleBase::GlobalFunc::OUT(ofs_running,"ibrav",ibrav);
this->setgroup(this->symop, this->nop, this->ibrav);
//now select all symmetry operations which reproduce the lattice
//to find those symmetry operations which reproduce the entire crystal
this->getgroup(this->nrot, this->nrotk, ofs_running);
// find the name of point group
this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running);
ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname);
//write();
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);
//now select all symmetry operations which reproduce the lattice
//to find those symmetry operations which reproduce the entire crystal
this->getgroup(this->nrot, this->nrotk, ofs_running);
// find the name of point group
this->pointgroup(this->nrot, this->pgnumber, this->pgname, this->gmatrix, ofs_running);
// ModuleBase::GlobalFunc::OUT(ofs_running,"POINT GROUP", this->pgname);
//write();

delete[] dirpos;
delete[] newpos;
Expand Down Expand Up @@ -705,6 +715,7 @@ void Symmetry::lattice_type(
// GlobalV::ofs_running << " pre_brav=" << pre_brav << std::endl;
// GlobalV::ofs_running << " temp_brav=" << temp_brav << std::endl;


if ( temp_brav < pre_brav)
{
//if the symmetry of the new vectors is higher, store the new ones
Expand Down Expand Up @@ -771,7 +782,6 @@ void Symmetry::lattice_type(
}
}
ofs.close();


}

Expand Down Expand Up @@ -811,9 +821,12 @@ void Symmetry::lattice_type(
}
}*/
brav = pre_brav;
bravname = get_brav_name(brav);
//brav = temp_brav;
//bravname = get_brav_name(brav);
real_brav = temp_brav; // pengfei Li 15-3-2022
bravname = get_brav_name(real_brav);

ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS TYPE",brav);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS TYPE",real_brav);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"BRAVAIS LATTICE NAME",bravname);
return;
}
Expand Down Expand Up @@ -1209,8 +1222,12 @@ void Symmetry::getgroup(int &nrot, int &nrotk, std::ofstream &ofs_running)
//total number of space group operations
//-----------------------------------------------------
nrotk += nrot;
ModuleBase::GlobalFunc::OUT(ofs_running,"PURE POINT GROUP OPERATIONS",nrot);
ModuleBase::GlobalFunc::OUT(ofs_running,"SPACE GROUP OPERATIONS",nrotk);

if(test_brav)
{
ModuleBase::GlobalFunc::OUT(ofs_running,"PURE POINT GROUP OPERATIONS",nrot);
ModuleBase::GlobalFunc::OUT(ofs_running,"SPACE GROUP OPERATIONS",nrotk);
}

//-----------------------------------------------------
//fill the rest of matrices and vectors with zeros
Expand Down Expand Up @@ -1775,4 +1792,4 @@ void Symmetry::print_pos(const double* pos, const int &nat)
}
return;
}
}
}
1 change: 1 addition & 0 deletions source/module_symmetry/symmetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Symmetry : public Symmetry_Basic
int sym_test;
int pbrav;
int ibrav;
int real_brav; // the real ibrav for the cell pengfei Li 3-15-2022
std::string ilattname; //the bravais lattice type of the supercell
std::string plattname; //the bravais lattice type of the primitive cell

Expand Down
28 changes: 18 additions & 10 deletions source/module_symmetry/symmetry_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//#include "../src_pw/global.h"
#include "../module_base/mymath.h"
//#include "symm_other.h"
bool ModuleSymmetry::test_brav = 0;

namespace ModuleSymmetry
{
Expand Down Expand Up @@ -811,7 +812,11 @@ void Symmetry_Basic::setgroup(ModuleBase::Matrix3* symop, int &nop, const int &i
this->matrigen(symgen, 3, symop, nop);
}

ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"ROTATION MATRICES",nop);
if(test_brav)
{
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"ROTATION MATRICES",nop);
}

if(GlobalV::test_symmetry > 1)
{
GlobalV::ofs_running<<" THERE ARE " << nop << " ROTATION MATRICES FOR THE PURE BRAVAIS LATTICE"<<std::endl;
Expand Down Expand Up @@ -939,14 +944,17 @@ void Symmetry_Basic::pointgroup(const int &nrot, int &pgnumber, std::string &pgn
else if(trace == -2 && det == -1) ++ns3; //mohan add 2012-01-15
}

ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C2",nc2);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C3",nc3);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C4",nc4);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C6",nc6);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S1",ns1);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S3",ns3);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S4",ns4);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S6",ns6);
if(test_brav)
{
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C2",nc2);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C3",nc3);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C4",nc4);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"C6",nc6);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S1",ns1);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S3",ns3);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S4",ns4);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"S6",ns6);
}

if(nrot == 2)
{
Expand Down Expand Up @@ -1176,4 +1184,4 @@ void Symmetry_Basic::rotate( ModuleBase::Matrix3 &gmatrix, ModuleBase::Vector3<d
rk = rk%nr3;
return;
}
}
}
4 changes: 4 additions & 0 deletions source/module_symmetry/symmetry_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class Symmetry_Basic
void order_y(double *pos, const int &oldpos, const int &newpos);
void order_z(double *pos, const int &oldpos, const int &newpos);
};

//for test only
extern bool test_brav;

}//end of define namespace

#endif
4 changes: 2 additions & 2 deletions tests/integrate/207_NO_KP_OD/result.ref
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
totaldosref 1189.53
totaltimeref 1.0555
totaldosref 1189.51
totaltimeref 0.84239