Skip to content
Merged
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
10 changes: 5 additions & 5 deletions source/module_cell/module_symmetry/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ bool Symmetry::checksym(const ModuleBase::Matrix3& s, ModuleBase::Vector3<double
// the start atom index.
bool no_diff = false;
ModuleBase::Vector3<double> trans(2.0, 2.0, 2.0);
bool s_flag = 0;
bool s_flag = false;

for (int it = 0; it < ntype; it++)
{
Expand Down Expand Up @@ -1123,7 +1123,7 @@ bool Symmetry::checksym(const ModuleBase::Matrix3& s, ModuleBase::Vector3<double
//the current test is successful
if (no_diff == true)
{
s_flag = 1;
s_flag = true;
//save the detected translation std::vector temporarily
trans.x = gtrans.x;
trans.y = gtrans.y;
Expand Down Expand Up @@ -1560,8 +1560,8 @@ void Symmetry::rhog_symmetry(std::complex<double> *rhogtot,
assert(nrotk <=48 );

//map the gmatrix to inv
int* invmap = new int[nrotk];
this->gmatrix_invmap(kgmatrix, nrotk, invmap);
std::vector<int>invmap(this->nrotk, -1);
this->gmatrix_invmap(kgmatrix, nrotk, invmap.data());

// ---------------------------------------------------
/* This code defines a lambda function called "rotate_recip" that takes
Expand Down Expand Up @@ -1629,6 +1629,7 @@ ModuleBase::timer::tick("Symmetry","group fft grids");
int rot_count=0;
for (int isym = 0; isym < nrotk; ++isym)
{
if (invmap[isym] < 0 || invmap[isym] > nrotk) { continue; }
//tmp variables
int ii, jj, kk=0;
rotate_recip(kgmatrix[invmap[isym]], tmp_gdirect0, ii, jj, kk);
Expand Down Expand Up @@ -1750,7 +1751,6 @@ for (int g_index = 0; g_index < group_index; g_index++)
delete[] symflag;
delete[] isymflag;
delete[] table_xyz;
delete[] invmap;
delete[] count_xyz;
ModuleBase::timer::tick("Symmetry","rhog_symmetry");
}
Expand Down
Loading