|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Nose Hoover Chain. More...
#include <nhchain.h>
Public Member Functions | |
| Nose_Hoover (const MD_para &mdp_in, const bool cal_stress_in, const bool init_vel, const int my_rank_in, MDCell &mdcell_in) | |
| ~Nose_Hoover () | |
| const double * | get_eta () const |
| positions of the thermostats coupled with the particles (md_tchain entries) | |
| const double * | get_v_eta () const |
| velocities of the thermostats coupled with the particles (md_tchain entries) | |
| const double * | get_peta () const |
| positions of the thermostats coupled with the barostat (md_pchain entries) | |
| const double * | get_v_peta () const |
| velocities of the thermostats coupled with the barostat (md_pchain entries) | |
| const double * | get_v_omega () const |
| velocities of the six lattice components | |
| Public Member Functions inherited from MD_base | |
| 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 | |
| virtual | ~MD_base () |
| double | get_md_dt () const |
| the time increment in a.u., converted from mdp.md_dt | |
Private Member Functions | |
| 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. | |
| 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 | |
| std::int64_t | tdof |
| particle degree of freedom | |
| double | t_target = 0.0 |
| target temperature | |
| double * | mass_eta = nullptr |
| mass of thermostats coupled with particles | |
| double * | eta = nullptr |
| position of thermostats coupled with particles | |
| double * | v_eta = nullptr |
| velocity of thermostats coupled with particles | |
| double * | g_eta = nullptr |
| 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 = nullptr |
| mass of thermostats coupled with barostat | |
| double * | peta = nullptr |
| position of thermostats coupled with barostat | |
| double * | v_peta = nullptr |
| velocity of thermostats coupled with barostat | |
| double * | g_peta = nullptr |
| 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 | |
| Public Attributes inherited from MD_base | |
| 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 | |
| std::int64_t | frozen_freedom_ |
| the fixed freedom of the system | |
| ModuleBase::matrix | virial |
| virial for this lattice | |
| ModuleBase::matrix | stress |
| stress for this lattice | |
| double | potential = 0.0 |
| potential energy | |
| double | kinetic |
| kinetic energy | |
| Protected Member Functions inherited from MD_base | |
| virtual void | update_pos () |
| perform one step update of pos due to atomic velocity | |
| virtual void | update_vel () |
| perform half-step update of vel due to atomic force | |
| Protected Attributes inherited from MD_base | |
| const MD_para & | mdp |
| input parameters used in md | |
| MDCell & | mdcell |
| mdcell 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.
| Nose_Hoover::Nose_Hoover | ( | const MD_para & | mdp_in, |
| const bool | cal_stress_in, | ||
| const bool | init_vel, | ||
| const int | my_rank_in, | ||
| MDCell & | mdcell_in ) |
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.
|
inline |
positions of the thermostats coupled with the particles (md_tchain entries)
|
inline |
positions of the thermostats coupled with the barostat (md_pchain entries)
|
inline |
velocities of the thermostats coupled with the particles (md_tchain entries)
|
inline |
velocities of the six lattice components
|
inline |
velocities of the thermostats coupled with the barostat (md_pchain entries)
|
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
Public counterpart of write_restart(): setup() calls it internally when md_restart is set, and a caller that has just written a restart file may read it back through here.
| 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
|
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