Skip to content

Commit 65d35ba

Browse files
authored
Merge pull request #857 from YuLiu98/develop
update the default value of md_tfreq
2 parents 16237d8 + 4afeb3b commit 65d35ba

22 files changed

+155
-96
lines changed

docs/input-main.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,11 @@ This part of variables are used to control the molecular dynamics calculations.
10281028
10291029
- **Type**: Real
10301030
- **Description**:
1031-
- Oscillation frequency, used to determine Qmass of NHC;
1032-
- 1/(md_tfreq*md_dt) is collision probability in Anderson method.
1033-
- **Default**: 1.0
1031+
- When md_type = 1, md_tfreq controls the frequency of the temperature oscillations during the simulation. If it is too large, the
1032+
temperature will fluctuate violently; if it is too small, the temperature will take a very long time to equilibrate with the atomic system.
1033+
- When md_type = 3, md_tfreq*md_dt is the collision probability in Anderson method.
1034+
- If md_tfreq is not set in INPUT, md_tfreq will be autoset to be 1/40/md_dt.
1035+
- **Default**: 1/40/md_dt
10341036
10351037
#### md_mnhc
10361038

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/MD_parameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MD_parameters
3131
msst_tscale = 0.01;
3232

3333
// NHC
34-
md_tfreq = 1;
34+
md_tfreq = 0;
3535
md_mnhc = 4;
3636

3737
// Langevin

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

0 commit comments

Comments
 (0)