|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
base functions in md More...
Functions | |
| double | gaussrand () |
| generate a Gaussian random number | |
| double | kinetic_energy (const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass) |
| calculate the ionic kinetic energy | |
| void | compute_stress (const MDCell &mdcell, const bool &cal_stress, const ModuleBase::matrix &virial, ModuleBase::matrix &stress) |
| calculate the total stress tensor | |
| void | read_vel (const UnitCell &unit_in, ModuleBase::Vector3< double > *vel) |
| read in atomic velocities from STRU | |
| void | rescale_vel (const int &natom, const double &temperature, const double *allmass, const int &frozen_freedom, ModuleBase::Vector3< double > *vel) |
| rescale the velocity to the target temperature | |
| void | rand_vel (const int &natom, const double &temperature, const double *allmass, const int &frozen_freedom, const ModuleBase::Vector3< int > frozen, const ModuleBase::Vector3< int > *ionmbl, const int &my_rank, ModuleBase::Vector3< double > *vel) |
| generate atomic velocities that satisfy the Boltzmann distribution | |
| void | init_vel (MDCell &mdcell, const bool &init_vel, const bool &restart, double &temperature, std::int64_t &frozen_freedom) |
| void | force_virial (ModuleESolver::ESolver *p_esolver, const int &istep, const bool &positions_updated, MDCell &mdcell, DomainDecomposition &decomp, double &potential, const bool &cal_stress, ModuleBase::matrix &virial) |
| calculate energy, forces and virial tensor | |
| void | print_stress (std::ofstream &ofs, const ModuleBase::matrix &virial, const ModuleBase::matrix &stress) |
| output the stress information | |
| void | get_mass_mbl (const UnitCell &unit_in, double *allmass, ModuleBase::Vector3< int > &frozen, ModuleBase::Vector3< int > *ionmbl) |
| obtain the atomic mass and whether the freedom is fixed | |
| double | target_temp (const int &istep, const int &nstep, const double &tfirst, const double &tlast) |
| get the target temperature of the current md step | |
| double | current_temp (double &kinetic, const int &natom, const int &frozen_freedom, const double *allmass, const ModuleBase::Vector3< double > *vel) |
| get the current temperature | |
| double | current_temp (double &kinetic, const MDCell &mdcell, const std::int64_t &frozen_freedom) |
| std::int64_t | global_dof (const MDCell &mdcell) |
| void | current_md_info (const MDCell &mdcell, const std::string &file_dir, int &md_step, double &temperature) |
base functions in md
Namespace MD_func contains several functions used in md.
| void MD_func::compute_stress | ( | const MDCell & | mdcell, |
| const bool & | cal_stress, | ||
| const ModuleBase::matrix & | virial, | ||
| ModuleBase::matrix & | stress ) |
calculate the total stress tensor
| mdcell | MD cell information |
| cal_stress | whether calculate stress |
| virial | lattice virial tensor |
| stress | total stress tensor |
| void MD_func::current_md_info | ( | const MDCell & | mdcell, |
| const std::string & | file_dir, | ||
| int & | md_step, | ||
| double & | temperature ) |
| double MD_func::current_temp | ( | double & | kinetic, |
| const int & | natom, | ||
| const int & | frozen_freedom, | ||
| const double * | allmass, | ||
| const ModuleBase::Vector3< double > * | vel ) |
get the current temperature
| kinetic | kinetic energy |
| natom | the number of atoms |
| frozen_freedom | the fixed freedom |
| allmass | atomic mass |
| vel | atomic velocities |
| double MD_func::current_temp | ( | double & | kinetic, |
| const MDCell & | mdcell, | ||
| const std::int64_t & | frozen_freedom ) |
| void MD_func::force_virial | ( | ModuleESolver::ESolver * | p_esolver, |
| const int & | istep, | ||
| const bool & | positions_updated, | ||
| MDCell & | mdcell, | ||
| DomainDecomposition & | decomp, | ||
| double & | potential, | ||
| const bool & | cal_stress, | ||
| ModuleBase::matrix & | virial ) |
calculate energy, forces and virial tensor
| p_esolver | enrergy solver |
| istep | current md step |
| positions_updated | whether ionic positions have drifted in this run; the initial force evaluation of a run (including a restarted run) passes false so the charge-extrapolation history is not advanced |
| mdcell | MD cell information |
| potential | potential energy |
| cal_stress | whether calculate stress |
| virial | lattice virial tensor |
| double MD_func::gaussrand | ( | ) |
generate a Gaussian random number
| void MD_func::get_mass_mbl | ( | const UnitCell & | unit_in, |
| double * | allmass, | ||
| ModuleBase::Vector3< int > & | frozen, | ||
| ModuleBase::Vector3< int > * | ionmbl ) |
obtain the atomic mass and whether the freedom is fixed
| unit_in | unitcell information |
| allmass | atomic mass |
| frozen | the fixed freedom along three directions |
| ionmbl | determine whether the atomic freedom is fixed |
| std::int64_t MD_func::global_dof | ( | const MDCell & | mdcell | ) |
| void MD_func::init_vel | ( | MDCell & | mdcell, |
| const bool & | init_vel, | ||
| const bool & | restart, | ||
| double & | temperature, | ||
| std::int64_t & | frozen_freedom ) |
| double MD_func::kinetic_energy | ( | const int & | natom, |
| const ModuleBase::Vector3< double > * | vel, | ||
| const double * | allmass ) |
calculate the ionic kinetic energy
| natom | the number of atoms |
| vel | the atomic velocities |
| allmass | atomic mass |
| void MD_func::print_stress | ( | std::ofstream & | ofs, |
| const ModuleBase::matrix & | virial, | ||
| const ModuleBase::matrix & | stress ) |
output the stress information
| ofs | determine the output files |
| virial | lattice virial tensor |
| stress | total stress tensor |
| void MD_func::rand_vel | ( | const int & | natom, |
| const double & | temperature, | ||
| const double * | allmass, | ||
| const int & | frozen_freedom, | ||
| const ModuleBase::Vector3< int > | frozen, | ||
| const ModuleBase::Vector3< int > * | ionmbl, | ||
| const int & | my_rank, | ||
| ModuleBase::Vector3< double > * | vel ) |
generate atomic velocities that satisfy the Boltzmann distribution
| natom | the number of atoms |
| temperature | ion temperature |
| allmass | atomic mass |
| frozen_freedom | the fixed freedom |
| frozen | the fixed freedom along three directions |
| ionmbl | determine whether the atomic freedom is fixed |
| my_rank | MPI rank of the processor |
| vel | the genarated atomic velocities |
| void MD_func::read_vel | ( | const UnitCell & | unit_in, |
| ModuleBase::Vector3< double > * | vel ) |
read in atomic velocities from STRU
| unit_in | unitcell information |
| vel | the read-in atomic velocities |
| void MD_func::rescale_vel | ( | const int & | natom, |
| const double & | temperature, | ||
| const double * | allmass, | ||
| const int & | frozen_freedom, | ||
| ModuleBase::Vector3< double > * | vel ) |
rescale the velocity to the target temperature
| natom | the number of atoms |
| temperature | ion temperature |
| allmass | atomic mass |
| frozen_freedom | the fixed freedom |
| vel | the genarated atomic velocities |
| double MD_func::target_temp | ( | const int & | istep, |
| const int & | nstep, | ||
| const double & | tfirst, | ||
| const double & | tlast ) |
get the target temperature of the current md step
| istep | the current md step |
| nstep | the total md step |
| tfirst | the initial temperature |
| tlast | the final temperature |