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:
16 const MD_para &mdp_in,
17 const bool cal_stress_in,
18 const bool init_vel,
19 const int my_rank_in,
20 MDCell &mdcell_in);
22
25 const double *get_eta() const { return eta; }
26
29 const double *get_v_eta() const { return v_eta; }
30
33 const double *get_peta() const { return peta; }
34
37 const double *get_v_peta() const { return v_peta; }
38
40 const double *get_v_omega() const { return v_omega; }
41
42 private:
43 void setup(ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir, DomainDecomposition &decomp);
44 void first_half(std::ofstream &ofs);
45 void second_half();
46 void print_md(std::ofstream &ofs, const bool &cal_stress);
47 void write_restart(const std::string &global_out_dir);
48 void restart(const std::string &global_readin_dir);
49
54 void particle_thermo();
55
60 void baro_thermo();
61
66 void update_baro();
67
72 void vel_baro();
73
78 void target_stress();
79
84 void couple_stress();
85
91 void update_volume(std::ofstream &ofs);
92
93 const int nc_tchain = 1;
94 const int nc_pchain = 1;
95 const static int nys = 7;
96 double w[nys];
97
98 std::int64_t tdof;
99 double t_target = 0.0;
100 double *mass_eta = nullptr;
101 double *eta = nullptr;
102 double *v_eta = nullptr;
103 double *g_eta = nullptr;
104
106 double mass_omega[6];
107 double v_omega[6];
108 double pstart[6];
109 double pstop[6];
110 double pfreq[6];
111 int pflag[6];
112 int pdim;
113 double p_target[6];
114 double p_hydro = 0.0;
115 double p_current[6] = {0.0};
116 double *mass_peta = nullptr;
117 double *peta = nullptr;
118 double *v_peta = nullptr;
119 double *g_peta = nullptr;
120 double mtk_term = 0;
121 double md_tfreq;
122 double md_pfirst;
123 double md_plast;
124 double md_pfreq;
125};
126
127#endif
Domain decomposition for distributed and single-domain neighbor input.
Definition dom_decomp.h:32
Definition mdcell.h:29
bool cal_stress
whether calculate stress
Definition md_base.h:117
MD_base(const MD_para &mdp_in, const bool cal_stress_in, const bool init_vel, const int my_rank_in, MDCell &mdcell_in)
construct the integrator from the values it actually uses
Definition md_base.cpp:13
Definition esolver.h:13
int npt_flag
whether NPT ensemble
Definition nhchain.h:105
double p_current[6]
current stress after coupled
Definition nhchain.h:115
double mass_omega[6]
mass of lattice component
Definition nhchain.h:106
double * g_eta
acceleration of thermostats coupled with particles
Definition nhchain.h:103
void restart(const std::string &global_readin_dir)
restart MD when md_restart is true
Definition nhchain.cpp:373
double md_pfreq
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
Definition nhchain.h:124
double w[nys]
scale evolution operator
Definition nhchain.h:96
void couple_stress()
couple stress component due to md_pcouple
Definition nhchain.cpp:856
double p_hydro
target hydrostatic target pressure
Definition nhchain.h:114
void first_half(std::ofstream &ofs)
the first half of equation of motion, update velocities and positions
Definition nhchain.cpp:219
int pflag[6]
control stress components
Definition nhchain.h:111
double pfreq[6]
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
Definition nhchain.h:110
double * mass_peta
mass of thermostats coupled with barostat
Definition nhchain.h:116
int pdim
pdim = pflag[0] + pflag[1] + pflag[2], number of barostatted dims
Definition nhchain.h:112
double pstart[6]
initial stress components
Definition nhchain.h:108
static const int nys
the number of scale evolution operator
Definition nhchain.h:95
const double * get_v_eta() const
velocities of the thermostats coupled with the particles (md_tchain entries)
Definition nhchain.h:29
double md_tfreq
Oscillation frequency, used to determine qmass of thermostats coupled with particles.
Definition nhchain.h:121
void update_baro()
perform half-step update of barostat velocity
Definition nhchain.cpp:642
void particle_thermo()
perform half-step update of thermostats coupled with particles
Definition nhchain.cpp:476
double p_target[6]
target stress components
Definition nhchain.h:113
std::int64_t tdof
particle degree of freedom
Definition nhchain.h:98
const double * get_eta() const
positions of the thermostats coupled with the particles (md_tchain entries)
Definition nhchain.h:25
void update_volume(std::ofstream &ofs)
perform half-step update of volume
Definition nhchain.cpp:733
double t_target
target temperature
Definition nhchain.h:99
double * v_eta
velocity of thermostats coupled with particles
Definition nhchain.h:102
void second_half()
the second half of equation of motion, update velocities
Definition nhchain.cpp:278
const int nc_pchain
the number of nc for npt
Definition nhchain.h:94
const double * get_v_peta() const
velocities of the thermostats coupled with the barostat (md_pchain entries)
Definition nhchain.h:37
const double * get_peta() const
positions of the thermostats coupled with the barostat (md_pchain entries)
Definition nhchain.h:33
void target_stress()
determine target stress
Definition nhchain.cpp:829
double * g_peta
acceleration of thermostats coupled with barostat
Definition nhchain.h:119
double mtk_term
mtk correction
Definition nhchain.h:120
Nose_Hoover(const MD_para &mdp_in, const bool cal_stress_in, const bool init_vel, const int my_rank_in, MDCell &mdcell_in)
Definition nhchain.cpp:9
double * v_peta
velocity of thermostats coupled with barostat
Definition nhchain.h:118
double md_plast
Final pressure.
Definition nhchain.h:123
double * peta
position of thermostats coupled with barostat
Definition nhchain.h:117
double * eta
position of thermostats coupled with particles
Definition nhchain.h:101
double * mass_eta
mass of thermostats coupled with particles
Definition nhchain.h:100
void write_restart(const std::string &global_out_dir)
write the information into files used for MD restarting
Definition nhchain.cpp:323
void print_md(std::ofstream &ofs, const bool &cal_stress)
output MD information such as energy, temperature, and pressure
Definition nhchain.cpp:321
double v_omega[6]
velocity of lattice component
Definition nhchain.h:107
void baro_thermo()
perform half-step update of thermostats coupled with barostat
Definition nhchain.cpp:561
void setup(ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir, DomainDecomposition &decomp)
init before running md, calculate energy, force, and stress of the initial configuration.
Definition nhchain.cpp:163
void vel_baro()
perform half-step update of velocity due to barostat
Definition nhchain.cpp:701
double pstop[6]
final stress components
Definition nhchain.h:109
double md_pfirst
Initial pressure.
Definition nhchain.h:122
const double * get_v_omega() const
velocities of the six lattice components
Definition nhchain.h:40
const int nc_tchain
the number of nc for nvt
Definition nhchain.h:93
~Nose_Hoover()
Definition nhchain.cpp:147
input parameters used in md
Definition md_parameter.h:12