67 const double& temperature,
68 const double* allmass,
69 const int& frozen_freedom,
85 const double& temperature,
86 const double* allmass,
87 const int& frozen_freedom,
106 const bool& cal_stress,
130 const double* allmass,
131 const bool& cal_stress,
159 const std::string& global_out_dir,
188double target_temp(
const int& istep,
const int& nstep,
const double& tfirst,
const double& tlast);
202 const int& frozen_freedom,
203 const double* allmass,
216 const double* allmass,
229void current_md_info(
const int& my_rank,
const std::string& file_dir,
int& md_step,
double& temperature);
3 elements vector
Definition vector3.h:22
Definition parameter.h:13
base functions in md
Definition for_testing_input_conv.h:244
double current_temp(double &kinetic, const int &natom, const int &frozen_freedom, const double *allmass, const ModuleBase::Vector3< double > *vel)
get the current temperature
Definition md_func.cpp:452
double gaussrand()
generate a Gaussian random number
Definition md_func.cpp:10
double target_temp(const int &istep, const int &nstep, const double &tfirst, const double &tlast)
get the target temperature of the current md step
Definition md_func.cpp:445
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
Definition md_func.cpp:415
void force_virial(ModuleESolver::ESolver *p_esolver, const int &istep, UnitCell &unit_in, double &potential, ModuleBase::Vector3< double > *force, const bool &cal_stress, ModuleBase::matrix &virial)
calculate energy, forces and virial tensor
Definition md_func.cpp:247
void compute_stress(const UnitCell &unit_in, const ModuleBase::Vector3< double > *vel, const double *allmass, const bool &cal_stress, const ModuleBase::matrix &virial, ModuleBase::matrix &stress)
calculate the total stress tensor
Definition md_func.cpp:54
double kinetic_energy(const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass)
calculate the ionic kinetic energy
Definition md_func.cpp:42
void dump_info(const int &step, const std::string &global_out_dir, const UnitCell &unit_in, const Parameter ¶m_in, const ModuleBase::matrix &virial, const ModuleBase::Vector3< double > *force, const ModuleBase::Vector3< double > *vel)
dump the md information
Definition md_func.cpp:323
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
Definition md_func.cpp:129
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
Definition md_func.cpp:107
void temp_vector(const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass, ModuleBase::matrix &t_vector)
get the temperature vectors
Definition md_func.cpp:470
void read_vel(const UnitCell &unit_in, ModuleBase::Vector3< double > *vel)
read in atomic velocities from STRU
Definition md_func.cpp:79
void print_stress(std::ofstream &ofs, const ModuleBase::matrix &virial, const ModuleBase::matrix &stress)
output the stress information
Definition md_func.cpp:289
void current_md_info(const int &my_rank, const std::string &file_dir, int &md_step, double &temperature)
determine thr current md step and temperature
Definition for_testing_input_conv.h:245
void init_vel(const UnitCell &unit_in, const int &my_rank, const bool &restart, double &temperature, double *allmass, int &frozen_freedom, ModuleBase::Vector3< int > *ionmbl, ModuleBase::Vector3< double > *vel)
initialize the atomic velocities
Definition md_func.cpp:186