ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Nose Hoover Chain. More...
#include <nhchain.h>
Public Member Functions | |
Nose_Hoover (const Parameter ¶m_in, UnitCell &unit_in) | |
~Nose_Hoover () | |
![]() | |
MD_base (const Parameter ¶m_in, UnitCell &unit_in) | |
virtual | ~MD_base () |
Private Member Functions | |
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. | |
void | first_half (std::ofstream &ofs) |
the first half of equation of motion, update velocities and positions | |
void | second_half () |
the second half of equation of motion, update velocities | |
void | print_md (std::ofstream &ofs, const bool &cal_stress) |
output MD information such as energy, temperature, and pressure | |
void | write_restart (const std::string &global_out_dir) |
write the information into files used for MD restarting | |
void | restart (const std::string &global_readin_dir) |
restart MD when md_restart is true | |
void | particle_thermo () |
perform half-step update of thermostats coupled with particles | |
void | baro_thermo () |
perform half-step update of thermostats coupled with barostat | |
void | update_baro () |
perform half-step update of barostat velocity | |
void | vel_baro () |
perform half-step update of velocity due to barostat | |
void | target_stress () |
determine target stress | |
void | couple_stress () |
couple stress component due to md_pcouple | |
void | update_volume (std::ofstream &ofs) |
perform half-step update of volume | |
Private Attributes | |
const int | nc_tchain = 1 |
the number of nc for nvt | |
const int | nc_pchain = 1 |
the number of nc for npt | |
double | w [nys] |
scale evolution operator | |
int | tdof |
particle degree of freedom | |
double | t_target =0.0 |
target temperature | |
double * | mass_eta |
mass of thermostats coupled with particles | |
double * | eta |
position of thermostats coupled with particles | |
double * | v_eta |
velocity of thermostats coupled with particles | |
double * | g_eta |
acceleration of thermostats coupled with particles | |
int | npt_flag |
whether NPT ensemble | |
double | mass_omega [6] |
mass of lattice component | |
double | v_omega [6] |
velocity of lattice component | |
double | pstart [6] |
initial stress components | |
double | pstop [6] |
final stress components | |
double | pfreq [6] |
Oscillation frequency, used to determine qmass of thermostats coupled with barostat. | |
int | pflag [6] |
control stress components | |
int | pdim |
pdim = pflag[0] + pflag[1] + pflag[2], number of barostatted dims | |
double | p_target [6] |
target stress components | |
double | p_hydro = 0.0 |
target hydrostatic target pressure | |
double | p_current [6] = {0.0} |
current stress after coupled | |
double * | mass_peta |
mass of thermostats coupled with barostat | |
double * | peta |
position of thermostats coupled with barostat | |
double * | v_peta |
velocity of thermostats coupled with barostat | |
double * | g_peta |
acceleration of thermostats coupled with barostat | |
double | mtk_term =0 |
mtk correction | |
double | md_tfreq |
Oscillation frequency, used to determine qmass of thermostats coupled with particles. | |
double | md_pfirst |
Initial pressure. | |
double | md_plast |
Final pressure. | |
double | md_pfreq |
Oscillation frequency, used to determine qmass of thermostats coupled with barostat. | |
Static Private Attributes | |
static const int | nys = 7 |
the number of scale evolution operator | |
Additional Inherited Members | |
![]() | |
bool | stop |
MD stop or not. | |
double | t_current |
current temperature | |
int | step_ |
the MD step finished in current calculation | |
int | step_rst_ |
the MD step finished in previous calculations | |
int | frozen_freedom_ |
the fixed freedom of the system | |
double * | allmass |
atom mass | |
ModuleBase::Vector3< double > * | pos |
atom displacements liuyu modify 2023-03-22 | |
ModuleBase::Vector3< double > * | vel |
atom velocity | |
ModuleBase::Vector3< int > * | ionmbl |
atom is frozen or not | |
ModuleBase::Vector3< double > * | force |
force of each atom | |
ModuleBase::matrix | virial |
virial for this lattice | |
ModuleBase::matrix | stress |
stress for this lattice | |
double | potential =0.0 |
potential energy | |
double | kinetic |
kinetic energy | |
![]() | |
virtual void | update_pos () |
perform one step update of pos due to atomic velocity | |
virtual void | update_vel (const ModuleBase::Vector3< double > *force) |
perform half-step update of vel due to atomic force | |
![]() | |
const MD_para & | mdp |
input parameters used in md | |
UnitCell & | ucell |
unitcell information | |
double | energy_ =0.0 |
total energy of the system | |
bool | cal_stress |
whether calculate stress | |
int | my_rank |
MPI rank of the processor. | |
double | md_dt |
Time increment (hbar/E_hartree) | |
double | md_tfirst |
Temperature (in Hartree, 1 Hartree ~ 3E5 K) | |
double | md_tlast |
Target temperature. | |
Nose Hoover Chain.
Nose-Hoover style non-Hamiltonian equations of motion. [Phys. Rev. A 31, 1695 (1985)] Designed to generate positions and velocities sampled from NVT and NPT ensemble.
init NPT related variables
determine the NPT methods
The lattice must be lower-triangular under tri mode. e11 0 0 e21 e22 0 e31 e32 e33 Under Voigt notation, xx, yy, zz, yz, xz, xy.
determine whether NPT ensemble
allocate thermostats coupled with particles
allocate barostat and thermostats coupled with barostat
w[0] = 1;
Nose_Hoover::~Nose_Hoover | ( | ) |
|
private |
perform half-step update of thermostats coupled with barostat
the freedom of lattice
update kenetic energy of lattice
update force
integrate loop
propogate v_peta
propogate peta
update rescale factor of lattice velocity
propogate g_peta
propogate v_peta
rescale lattice due to thermostats
|
private |
couple stress component due to md_pcouple
|
privatevirtual |
the first half of equation of motion, update velocities and positions
ofs | determine the output files |
update thermostats coupled with barostat if NPT ensemble
update target T
update thermostats coupled with particles
update temperature and stress due to velocity rescaling
couple stress component due to md_pcouple
determine target stress
update v_omega
update vel due to barostat
perform half-step update of vel due to atomic force
perform half-step update of volume
perform one step update of pos due to atomic velocity
perform half-step update of volume
Reimplemented from MD_base.
|
private |
perform half-step update of thermostats coupled with particles
update mass_eta
propogate g_eta
integrate loop
propogate v_eta
propogate eta
update rescale factor of particle velocity
propogate g_eta
propogate v_eta
rescale velocity due to thermostats
|
privatevirtual |
output MD information such as energy, temperature, and pressure
ofs | determine the output files |
cal_stress | whether calculate and output stress |
Reimplemented from MD_base.
|
privatevirtual |
restart MD when md_restart is true
global_readin_dir | directory of files for reading |
npt
Reimplemented from MD_base.
|
privatevirtual |
the second half of equation of motion, update velocities
perform half-step update of vel due to atomic force
update vel due to barostat
update temperature and kinetic energy due to velocity rescaling
update stress due to velocity rescaling
couple stress component due to md_pcouple
update v_omega
update thermostats coupled with particles
update thermostats coupled with barostat if NPT ensemble
Reimplemented from MD_base.
|
privatevirtual |
init before running md, calculate energy, force, and stress of the initial configuration.
p_esolver | the energy solver used in md |
global_readin_dir | directory of files for reading |
determine target temperature
init thermostats coupled with particles
NPT ensemble
determine target stress
couple stress component due to md_pcouple
init barostat
init thermostats coupled with barostat
Reimplemented from MD_base.
|
private |
determine target stress
|
private |
perform half-step update of barostat velocity
|
private |
perform half-step update of volume
ofs | determine the output files |
tri mode, off-diagonal components, first half
Diagonal components
tri mode, off-diagonal components, second half
reset ucell and pos due to change of lattice
|
private |
perform half-step update of velocity due to barostat
Note: I am not sure whether fixed atoms should update here
|
privatevirtual |
write the information into files used for MD restarting
global_out_dir | directory of output files |
npt
Reimplemented from MD_base.
|
private |
position of thermostats coupled with particles
|
private |
acceleration of thermostats coupled with particles
|
private |
acceleration of thermostats coupled with barostat
|
private |
mass of thermostats coupled with particles
|
private |
mass of lattice component
|
private |
mass of thermostats coupled with barostat
|
private |
Initial pressure.
|
private |
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
|
private |
Final pressure.
|
private |
Oscillation frequency, used to determine qmass of thermostats coupled with particles.
|
private |
mtk correction
|
private |
the number of nc for npt
|
private |
the number of nc for nvt
|
private |
whether NPT ensemble
|
staticprivate |
the number of scale evolution operator
|
private |
current stress after coupled
|
private |
target hydrostatic target pressure
|
private |
target stress components
|
private |
pdim = pflag[0] + pflag[1] + pflag[2], number of barostatted dims
|
private |
position of thermostats coupled with barostat
|
private |
control stress components
|
private |
Oscillation frequency, used to determine qmass of thermostats coupled with barostat.
|
private |
initial stress components
|
private |
final stress components
|
private |
target temperature
|
private |
particle degree of freedom
|
private |
velocity of thermostats coupled with particles
|
private |
velocity of lattice component
|
private |
velocity of thermostats coupled with barostat
|
private |
scale evolution operator