Skip to content

Commit fd7b33e

Browse files
committed
update reference data
1 parent 98cfb20 commit fd7b33e

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

source/module_io/io_dmk.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,19 @@ void ModuleIO::write_dmk(const std::vector<std::vector<T>>& dmk,
334334
std::ofstream ofs(fn.c_str());
335335

336336
if (!ofs)
337-
{
338-
ModuleBase::WARNING("ModuleIO::write_dmk", "Can't create DENSITY MATRIX File < " + fn + " >.");
339-
continue;
340-
}
337+
{
338+
ModuleBase::WARNING("ModuleIO::write_dmk", "Can't create DENSITY MATRIX File < " + fn + " >.");
339+
continue;
340+
}
341+
else
342+
{
343+
// std::cout << " Write the density matrix to file " << fn << std::endl;
344+
}
341345

342346
// write the UnitCell information
343347
dmk_write_ucell(ofs, ucell);
344348

349+
345350
ofs << "\n " << nspin; // nspin
346351
ofs << "\n " << std::fixed << std::setprecision(5) << efs[ispin]
347352
<< " (fermi energy)";

source/module_io/write_dmr.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,20 @@ std::string dmr_gen_fname(const int out_type, const int ispin, const bool append
3838
void write_dmr_csr(std::string& fname, hamilt::HContainer<double>* dm_serial, const int istep)
3939
{
4040
// write the head: ION step number, basis number and R loop number
41-
std::ofstream ofs(fname, std::ios::app);
42-
ofs << "STEP: " << istep+1 << std::endl;
41+
42+
std::ofstream ofs;
43+
44+
// mohan update 2025-05-26
45+
if(istep<=0)
46+
{
47+
ofs.open(fname);
48+
}
49+
else if(istep>0)
50+
{
51+
ofs.open(fname, std::ios::app);
52+
}
53+
54+
ofs << "IONIC_STEP: " << istep+1 << std::endl;
4355
ofs << "Matrix Dimension of DM(R): " << dm_serial->get_nbasis() << std::endl;
4456
ofs << "Matrix number of DM(R): " << dm_serial->size_R_loop() << std::endl;
4557

tests/03_NAO_multik/01_NO_KP_15f_ODM/dmrs1_nao.csr.ref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
STEP: 0
1+
IONIC_STEP: 1
22
Matrix Dimension of DM(R): 34
33
Matrix number of DM(R): 93
44
-3 1 1 496

0 commit comments

Comments
 (0)