Skip to content

Commit

Permalink
Refactor: modify decimal digit of wfc to 8 (#5820)
Browse files Browse the repository at this point in the history
* Refactor: modify decimal digit of wfc to 8

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
YuLiu98 and pre-commit-ci-lite[bot] authored Jan 6, 2025
1 parent 9732d79 commit 1b49590
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/hefei-namd/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Example case for Hefei-NAMD.
If cal_syns = 1 , the maximum displacement of all atoms in one step dmax(bohr) need to be set for calculating asynchronous overlap matrix.
Find overlap matrix file in OUT.autotest/data-0-S and wavefunction file in OUT.autotest/LOWF_GAMMA_S1.dat .
Find overlap matrix file in OUT.autotest/data-0-S and wavefunction file in OUT.autotest/WFC_NAO_GAMMA1.dat .
4 changes: 2 additions & 2 deletions examples/wfc/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The wave function is output in a file called 'WAVEFUNC1.txt'

For LCAO basis:
- set 'out_wfc_lcao' to '1'
Several `LOWF_K_#.dat` files will be output in multi-k calculation and
`LOWF_GAMMA_S1.dat` in gamma-only calculation.
Several `WFC_NAO_K#.txt` files will be output in multi-k calculation and
`WFC_NAO_GAMMA1.txt` in gamma-only calculation.


For the wave functions in Real Space:
Expand Down
10 changes: 6 additions & 4 deletions source/module_io/write_wfc_nao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ void wfc_nao_write2file(const std::string &name, const double* ctot, const int n
ofs << "\n" << wg(ik,i) << " (Occupations)";
for (int j=0; j<nlocal; j++)
{
if (j % 5 == 0) ofs << "\n";
if (j % 5 == 0) { ofs << "\n";
}
ofs << ctot[i*nlocal + j] << " ";
}
}
Expand Down Expand Up @@ -173,8 +174,8 @@ void wfc_nao_write2file_complex(const std::string &name, const std::complex<doub
{
ModuleBase::WARNING("ModuleIO::write_wfc_nao","Can't write local orbital wave functions.");
}
ofs << std::setprecision(25);
ofs << ik+1 << " (index of k points)" << std::endl;
ofs << std::setprecision(8);
ofs << ik+1 << " (index of k points)" << std::endl;
ofs << kvec_c.x << " " << kvec_c.y << " " << kvec_c.z << std::endl;
ofs << nbands << " (number of bands)" << std::endl;
ofs << nlocal << " (number of orbitals)";
Expand All @@ -189,7 +190,8 @@ void wfc_nao_write2file_complex(const std::string &name, const std::complex<doub
ofs << "\n" << wg(ik,i) << " (Occupations)";
for (int j=0; j<nlocal; j++)
{
if (j % 5 == 0) ofs << "\n";
if (j % 5 == 0) { ofs << "\n";
}
ofs << ctot[i*nlocal + j].real() << " " << ctot[i*nlocal + j].imag() << " ";
}
}
Expand Down

0 comments on commit 1b49590

Please sign in to comment.