69 const double& temperature,
70 const double* allmass,
71 const int& frozen_freedom,
87 const double& temperature,
88 const double* allmass,
89 const int& frozen_freedom,
108 const bool& cal_stress,
132 const double* allmass,
133 const bool& cal_stress,
161 const std::string& global_out_dir,
190double target_temp(
const int& istep,
const int& nstep,
const double& tfirst,
const double& tlast);
204 const int& frozen_freedom,
205 const double* allmass,
218 const double* allmass,
231void current_md_info(
const int& my_rank,
const std::string& file_dir,
int& md_step,
double& temperature);
3 elements vector
Definition vector3.h:24
Definition parameter.h:13
base functions in md
Definition for_testing_input_conv.h:228
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:453
double gaussrand()
generate a Gaussian random number
Definition md_func.cpp:11
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:446
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:416
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:248
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:55
double kinetic_energy(const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass)
calculate the ionic kinetic energy
Definition md_func.cpp:43
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:324
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:130
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:108
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:471
void read_vel(const UnitCell &unit_in, ModuleBase::Vector3< double > *vel)
read in atomic velocities from STRU
Definition md_func.cpp:80
void print_stress(std::ofstream &ofs, const ModuleBase::matrix &virial, const ModuleBase::matrix &stress)
output the stress information
Definition md_func.cpp:290
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:229
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:187