ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Namespaces | Functions
md_func.h File Reference
#include "source_esolver/esolver.h"
#include <mpi.h>
Include dependency graph for md_func.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MD_func
 base functions in md
 

Functions

double MD_func::gaussrand ()
 generate a Gaussian random number
 
void MD_func::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
 
void MD_func::read_vel (const UnitCell &unit_in, ModuleBase::Vector3< double > *vel)
 read in atomic velocities from STRU
 
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
 
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
 
void MD_func::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
 
double MD_func::kinetic_energy (const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass)
 calculate the ionic kinetic energy
 
void MD_func::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
 
void MD_func::print_stress (std::ofstream &ofs, const ModuleBase::matrix &virial, const ModuleBase::matrix &stress)
 output the stress information
 
void MD_func::dump_info (const int &step, const std::string &global_out_dir, const UnitCell &unit_in, const Parameter &param_in, const ModuleBase::matrix &virial, const ModuleBase::Vector3< double > *force, const ModuleBase::Vector3< double > *vel)
 dump the md information
 
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
 
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
 
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
 
void MD_func::temp_vector (const int &natom, const ModuleBase::Vector3< double > *vel, const double *allmass, ModuleBase::matrix &t_vector)
 get the temperature vectors
 
void MD_func::current_md_info (const int &my_rank, const std::string &file_dir, int &md_step, double &temperature)
 determine thr current md step and temperature