Skip to content

Commit 1b49590

Browse files
Refactor: modify decimal digit of wfc to 8 (#5820)
* 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>
1 parent 9732d79 commit 1b49590

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

examples/hefei-namd/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Example case for Hefei-NAMD.
22
If cal_syns = 1 , the maximum displacement of all atoms in one step dmax(bohr) need to be set for calculating asynchronous overlap matrix.
3-
Find overlap matrix file in OUT.autotest/data-0-S and wavefunction file in OUT.autotest/LOWF_GAMMA_S1.dat .
3+
Find overlap matrix file in OUT.autotest/data-0-S and wavefunction file in OUT.autotest/WFC_NAO_GAMMA1.dat .

examples/wfc/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The wave function is output in a file called 'WAVEFUNC1.txt'
1111

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

1717

1818
For the wave functions in Real Space:

source/module_io/write_wfc_nao.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void wfc_nao_write2file(const std::string &name, const double* ctot, const int n
108108
ofs << "\n" << wg(ik,i) << " (Occupations)";
109109
for (int j=0; j<nlocal; j++)
110110
{
111-
if (j % 5 == 0) ofs << "\n";
111+
if (j % 5 == 0) { ofs << "\n";
112+
}
112113
ofs << ctot[i*nlocal + j] << " ";
113114
}
114115
}
@@ -173,8 +174,8 @@ void wfc_nao_write2file_complex(const std::string &name, const std::complex<doub
173174
{
174175
ModuleBase::WARNING("ModuleIO::write_wfc_nao","Can't write local orbital wave functions.");
175176
}
176-
ofs << std::setprecision(25);
177-
ofs << ik+1 << " (index of k points)" << std::endl;
177+
ofs << std::setprecision(8);
178+
ofs << ik+1 << " (index of k points)" << std::endl;
178179
ofs << kvec_c.x << " " << kvec_c.y << " " << kvec_c.z << std::endl;
179180
ofs << nbands << " (number of bands)" << std::endl;
180181
ofs << nlocal << " (number of orbitals)";
@@ -189,7 +190,8 @@ void wfc_nao_write2file_complex(const std::string &name, const std::complex<doub
189190
ofs << "\n" << wg(ik,i) << " (Occupations)";
190191
for (int j=0; j<nlocal; j++)
191192
{
192-
if (j % 5 == 0) ofs << "\n";
193+
if (j % 5 == 0) { ofs << "\n";
194+
}
193195
ofs << ctot[i*nlocal + j].real() << " " << ctot[i*nlocal + j].imag() << " ";
194196
}
195197
}

0 commit comments

Comments
 (0)