Skip to content

Commit 4afeb3b

Browse files
committed
refactor(md): update output format of MD.
add scf iteration title for pw md, update output format of md
1 parent f95a2f0 commit 4afeb3b

File tree

19 files changed

+132
-84
lines changed

19 files changed

+132
-84
lines changed

source/module_md/FIRE.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ void FIRE::second_half()
8080
ModuleBase::timer::tick("FIRE", "second_half");
8181
}
8282

83-
void FIRE::outputMD()
83+
void FIRE::outputMD(std::ofstream &ofs)
8484
{
85-
Verlet::outputMD();
85+
Verlet::outputMD(ofs);
8686

87-
GlobalV::ofs_running << " LARGEST GRAD (eV/A) : "
87+
ofs << " LARGEST GRAD (eV/A) : "
8888
<< max * ModuleBase::Hartree_to_eV * ModuleBase::ANGSTROM_AU << std::endl;
8989
std::cout << " LARGEST GRAD (eV/A) : "
9090
<< max * ModuleBase::Hartree_to_eV * ModuleBase::ANGSTROM_AU << std::endl;

source/module_md/FIRE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FIRE : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD();
15+
void outputMD(std::ofstream &ofs);
1616
void write_restart();
1717
void restart();
1818
void check_force();

source/module_md/Langevin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ void Langevin::second_half()
4545
ModuleBase::timer::tick("Langevin", "second_half");
4646
}
4747

48-
void Langevin::outputMD()
48+
void Langevin::outputMD(std::ofstream &ofs)
4949
{
50-
Verlet::outputMD();
50+
Verlet::outputMD(ofs);
5151
}
5252

5353
void Langevin::write_restart()

source/module_md/Langevin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Langevin : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD();
15+
void outputMD(std::ofstream &ofs);
1616
void write_restart();
1717
void restart();
1818
void post_force();

source/module_md/MSST.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ void MSST::second_half()
160160
ModuleBase::timer::tick("MSST", "second_half");
161161
}
162162

163-
void MSST::outputMD()
163+
void MSST::outputMD(std::ofstream &ofs)
164164
{
165-
Verlet::outputMD();
165+
Verlet::outputMD(ofs);
166166
}
167167

168168
void MSST::write_restart()

source/module_md/MSST.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MSST : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD();
15+
void outputMD(std::ofstream &ofs);
1616
void write_restart();
1717
void restart();
1818
double extra_term();

source/module_md/NVE.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ void NVE::second_half()
3636
ModuleBase::timer::tick("NVE", "second_half");
3737
}
3838

39-
void NVE::outputMD()
39+
void NVE::outputMD(std::ofstream &ofs)
4040
{
41-
Verlet::outputMD();
41+
Verlet::outputMD(ofs);
4242
}
4343

4444
void NVE::write_restart()

source/module_md/NVE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NVE : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD();
15+
void outputMD(std::ofstream &ofs);
1616
void write_restart();
1717
void restart();
1818

source/module_md/NVT_ADS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ void NVT_ADS::second_half()
6565
ModuleBase::timer::tick("NVT_ADS", "second_half");
6666
}
6767

68-
void NVT_ADS::outputMD()
68+
void NVT_ADS::outputMD(std::ofstream &ofs)
6969
{
70-
Verlet::outputMD();
70+
Verlet::outputMD(ofs);
7171
}
7272

7373
void NVT_ADS::write_restart()

source/module_md/NVT_ADS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NVT_ADS : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD();
15+
void outputMD(std::ofstream &ofs);
1616
void write_restart();
1717
void restart();
1818

0 commit comments

Comments
 (0)