ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
nhchain.h
Go to the documentation of this file.
1#ifndef NOSE_HOOVER_H
2#define NOSE_HOOVER_H
3
4#include "md_base.h"
5
12class Nose_Hoover : public MD_base
13{
14 public:
15 Nose_Hoover(const Parameter& param_in, UnitCell& unit_in);
17
18 private:
19 void setup(ModuleESolver::ESolver* p_esolver, const std::string& global_readin_dir);
20 void first_half(std::ofstream& ofs);
21 void second_half();
22 void print_md(std::ofstream& ofs, const bool& cal_stress);
23 void write_restart(const std::string& global_out_dir);
24 void restart(const std::string& global_readin_dir);
25
30 void particle_thermo();
31
36 void baro_thermo();
37
42 void update_baro();
43
48 void vel_baro();
49
54 void target_stress();
55
60 void couple_stress();
61
67 void update_volume(std::ofstream& ofs);
68
69 const int nc_tchain = 1;
70 const int nc_pchain = 1;
71 const static int nys = 7;
72 double w[nys];
73
74 int tdof;
75 double t_target=0.0;
76 double* mass_eta;
77 double* eta;
78 double* v_eta;
79 double* g_eta;
80
82 double mass_omega[6];
83 double v_omega[6];
84 double pstart[6];
85 double pstop[6];
86 double pfreq[6];
87 int pflag[6];
88 int pdim;
89 double p_target[6];
90 double p_hydro = 0.0;
91 double p_current[6] = {0.0};
92 double* mass_peta;
93 double* peta;
94 double* v_peta;
95 double* g_peta;
96 double mtk_term=0;
97 double md_tfreq;
98 double md_pfirst;
99 double md_plast;
100 double md_pfreq;
101};
102
103#endif
base class of md
Definition md_base.h:16
bool cal_stress
whether calculate stress
Definition md_base.h:93
Definition esolver.h:11
Nose Hoover Chain.
Definition nhchain.h:13
int npt_flag
whether NPT ensemble
Definition nhchain.h:81
double p_current[6]
current stress after coupled
Definition nhchain.h:91
double mass_omega[6]
mass of lattice component
Definition nhchain.h:82
double * g_eta
acceleration of thermostats coupled with particles
Definition nhchain.h:79
void restart(const std::string &global_readin_dir)
restart MD when md_restart is true
Definition nhchain.cpp:374
double md_pfreq
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
Definition nhchain.h:100
double w[nys]
scale evolution operator
Definition nhchain.h:72
void couple_stress()
couple stress component due to md_pcouple
Definition nhchain.cpp:842
double p_hydro
target hydrostatic target pressure
Definition nhchain.h:90
void first_half(std::ofstream &ofs)
the first half of equation of motion, update velocities and positions
Definition nhchain.cpp:215
int pflag[6]
control stress components
Definition nhchain.h:87
double pfreq[6]
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
Definition nhchain.h:86
double * mass_peta
mass of thermostats coupled with barostat
Definition nhchain.h:92
int pdim
pdim = pflag[0] + pflag[1] + pflag[2], number of barostatted dims
Definition nhchain.h:88
double pstart[6]
initial stress components
Definition nhchain.h:84
static const int nys
the number of scale evolution operator
Definition nhchain.h:71
double md_tfreq
Oscillation frequency, used to determine qmass of thermostats coupled with particles.
Definition nhchain.h:97
void update_baro()
perform half-step update of barostat velocity
Definition nhchain.cpp:643
void particle_thermo()
perform half-step update of thermostats coupled with particles
Definition nhchain.cpp:477
double p_target[6]
target stress components
Definition nhchain.h:89
void update_volume(std::ofstream &ofs)
perform half-step update of volume
Definition nhchain.cpp:722
void setup(ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir)
init before running md, calculate energy, force, and stress of the initial configuration.
Definition nhchain.cpp:156
double t_target
target temperature
Definition nhchain.h:75
double * v_eta
velocity of thermostats coupled with particles
Definition nhchain.h:78
void second_half()
the second half of equation of motion, update velocities
Definition nhchain.cpp:275
const int nc_pchain
the number of nc for npt
Definition nhchain.h:70
void target_stress()
determine target stress
Definition nhchain.cpp:815
double * g_peta
acceleration of thermostats coupled with barostat
Definition nhchain.h:95
double mtk_term
mtk correction
Definition nhchain.h:96
double * v_peta
velocity of thermostats coupled with barostat
Definition nhchain.h:94
double md_plast
Final pressure.
Definition nhchain.h:99
double * peta
position of thermostats coupled with barostat
Definition nhchain.h:93
int tdof
particle degree of freedom
Definition nhchain.h:74
double * eta
position of thermostats coupled with particles
Definition nhchain.h:77
double * mass_eta
mass of thermostats coupled with particles
Definition nhchain.h:76
void write_restart(const std::string &global_out_dir)
write the information into files used for MD restarting
Definition nhchain.cpp:324
void print_md(std::ofstream &ofs, const bool &cal_stress)
output MD information such as energy, temperature, and pressure
Definition nhchain.cpp:319
double v_omega[6]
velocity of lattice component
Definition nhchain.h:83
void baro_thermo()
perform half-step update of thermostats coupled with barostat
Definition nhchain.cpp:562
void vel_baro()
perform half-step update of velocity due to barostat
Definition nhchain.cpp:690
double pstop[6]
final stress components
Definition nhchain.h:85
double md_pfirst
Initial pressure.
Definition nhchain.h:98
const int nc_tchain
the number of nc for nvt
Definition nhchain.h:69
~Nose_Hoover()
Definition nhchain.cpp:140
Definition parameter.h:13
Definition unitcell.h:16