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
11 changes: 8 additions & 3 deletions source/module_cell/module_symmetry/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,6 @@ void Symmetry::pricell(double* pos)
//the current test is successful
if (no_diff) ptrans.push_back(ModuleBase::Vector3<double>
(tmp_ptrans[0], tmp_ptrans[1], tmp_ptrans[2]));

//restore the original rotated coordinates by subtracting "ptrans"
for (int it = 0; it < ntype; it++)
{
Expand Down Expand Up @@ -1325,9 +1324,15 @@ void Symmetry::pricell(double* pos)
this->ncell=floor(ncell_double+0.5);
if(this->ncell != ntrans)
{
std::cout << " ERROR: PRICELL: NCELL != NTRANS !" << std::endl;
std::cout << " WARNING: PRICELL: NCELL != NTRANS !" << std::endl;
std::cout << " NCELL=" << ncell << ", NTRANS=" << ntrans << std::endl;
ModuleBase::QUIT();
std::cout << " Suggest solution: Use a larger `symmetry_prec`. " << std::endl;
std::cout << " Now regard the structure as a primitive cell." << std::endl;
this->ncell = 1;
this->ptrans = std::vector<ModuleBase::Vector3<double> >(1, ModuleBase::Vector3<double>(0, 0, 0));
GlobalV::ofs_running << "WARNING: Original cell may have more than one primitive cells, \
but we have to treat it as a primitive cell. Use a larger `symmetry_prec`to avoid this warning." << std::endl;
return;
}
if(std::abs(ncell_double-double(this->ncell)) > this->epsilon*100)
{
Expand Down