37 std::int64_t &frozen_freedom);
45void read_vel(
const UnitCell &unit_in, ModuleBase::Vector3<double> *vel);
61 const double &temperature,
62 const double *allmass,
63 const int &frozen_freedom,
64 const ModuleBase::Vector3<int> frozen,
65 const ModuleBase::Vector3<int> *ionmbl,
67 ModuleBase::Vector3<double> *vel);
80 const double &temperature,
81 const double *allmass,
82 const int &frozen_freedom,
83 ModuleBase::Vector3<double> *vel);
99 ModuleESolver::ESolver *p_esolver,
101 const bool &positions_updated,
103 DomainDecomposition &decomp,
105 const bool &cal_stress,
106 ModuleBase::matrix &virial);
115double kinetic_energy(
const int &natom,
const ModuleBase::Vector3<double> *vel,
const double *allmass);
126 const MDCell &mdcell,
127 const bool &cal_stress,
128 const ModuleBase::matrix &virial,
129 ModuleBase::matrix &stress);
138void print_stress(std::ofstream &ofs,
const ModuleBase::matrix &virial,
const ModuleBase::matrix &stress);
149 const UnitCell &unit_in,
151 ModuleBase::Vector3<int> &frozen,
152 ModuleBase::Vector3<int> *ionmbl);
166 const double &tfirst,
167 const double &tlast);
182 const int &frozen_freedom,
183 const double *allmass,
184 const ModuleBase::Vector3<double> *vel);
185double current_temp(
double &kinetic,
const MDCell &mdcell,
const std::int64_t &frozen_freedom);
189 const MDCell &mdcell,
190 const std::string &file_dir,
192 double &temperature);
Domain decomposition for distributed and single-domain neighbor input.
Definition dom_decomp.h:32
Definition parameter.h:16
base functions in md
Definition md_func.cpp:15
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:535
double gaussrand()
generate a Gaussian random number
Definition md_func.cpp:17
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:524
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:490
double kinetic_energy(const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass)
calculate the ionic kinetic energy
Definition md_func.cpp:49
void current_md_info(const MDCell &mdcell, const std::string &file_dir, int &md_step, double &temperature)
Definition md_func.cpp:609
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:148
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:124
void read_vel(const UnitCell &unit_in, ModuleBase::Vector3< double > *vel)
read in atomic velocities from STRU
Definition md_func.cpp:96
void print_stress(std::ofstream &ofs, const ModuleBase::matrix &virial, const ModuleBase::matrix &stress)
output the stress information
Definition md_func.cpp:441
void compute_stress(const MDCell &mdcell, const bool &cal_stress, const ModuleBase::matrix &virial, ModuleBase::matrix &stress)
calculate the total stress tensor
Definition md_func.cpp:62
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
Definition md_func.cpp:373
std::int64_t global_dof(const MDCell &mdcell)
Definition md_func.cpp:570
void init_vel(MDCell &mdcell, const bool &init_vel, const bool &restart, double &temperature, std::int64_t &frozen_freedom)
Definition md_func.cpp:206