ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MD_base Class Reference

base class of md More...

#include <md_base.h>

Inheritance diagram for MD_base:
Collaboration diagram for MD_base:

Public Member Functions

 MD_base (const Parameter &param_in, UnitCell &unit_in)
 
virtual ~MD_base ()
 
virtual void setup (ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir)
 init before running md, calculate energy, force, and stress of the initial configuration.
 
virtual void first_half (std::ofstream &ofs)
 the first half of equation of motion, update velocities and positions
 
virtual void second_half ()
 the second half of equation of motion, update velocities
 
virtual void print_md (std::ofstream &ofs, const bool &cal_stress)
 output MD information such as energy, temperature, and pressure
 
virtual void write_restart (const std::string &global_out_dir)
 write the information into files used for MD restarting
 

Public Attributes

bool stop
 MD stop or not.
 
double t_current
 current temperature
 
int step_
 the MD step finished in current calculation
 
int step_rst_
 the MD step finished in previous calculations
 
int frozen_freedom_
 the fixed freedom of the system
 
double * allmass
 atom mass
 
ModuleBase::Vector3< double > * pos
 atom displacements liuyu modify 2023-03-22
 
ModuleBase::Vector3< double > * vel
 atom velocity
 
ModuleBase::Vector3< int > * ionmbl
 atom is frozen or not
 
ModuleBase::Vector3< double > * force
 force of each atom
 
ModuleBase::matrix virial
 virial for this lattice
 
ModuleBase::matrix stress
 stress for this lattice
 
double potential =0.0
 potential energy
 
double kinetic
 kinetic energy
 

Protected Member Functions

virtual void restart (const std::string &global_readin_dir)
 restart MD when md_restart is true
 
virtual void update_pos ()
 perform one step update of pos due to atomic velocity
 
virtual void update_vel (const ModuleBase::Vector3< double > *force)
 perform half-step update of vel due to atomic force
 

Protected Attributes

const MD_paramdp
 input parameters used in md
 
UnitCellucell
 unitcell information
 
double energy_ =0.0
 total energy of the system
 
bool cal_stress
 whether calculate stress
 
int my_rank
 MPI rank of the processor.
 
double md_dt
 Time increment (hbar/E_hartree)
 
double md_tfirst
 Temperature (in Hartree, 1 Hartree ~ 3E5 K)
 
double md_tlast
 Target temperature.
 

Detailed Description

base class of md

This class implements the velocity-Verlet method. The system is assumed to be isolated in the sense that it cannot exchange energy or particles with its environment, so that the energy of the system does not change with time.

Constructor & Destructor Documentation

◆ MD_base()

MD_base::MD_base ( const Parameter param_in,
UnitCell unit_in 
)

convert to a.u. unit

Here is the call graph for this function:

◆ ~MD_base()

MD_base::~MD_base ( )
virtual

Member Function Documentation

◆ first_half()

void MD_base::first_half ( std::ofstream &  ofs)
virtual

the first half of equation of motion, update velocities and positions

Parameters
ofsdetermine the output files

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_md()

void MD_base::print_md ( std::ofstream &  ofs,
const bool &  cal_stress 
)
virtual

output MD information such as energy, temperature, and pressure

Parameters
ofsdetermine the output files
cal_stresswhether calculate and output stress

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restart()

void MD_base::restart ( const std::string &  global_readin_dir)
protectedvirtual

restart MD when md_restart is true

Parameters
global_readin_dirdirectory of files for reading

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ second_half()

void MD_base::second_half ( void  )
virtual

the second half of equation of motion, update velocities

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup()

void MD_base::setup ( ModuleESolver::ESolver p_esolver,
const std::string &  global_readin_dir 
)
virtual

init before running md, calculate energy, force, and stress of the initial configuration.

Parameters
p_esolverthe energy solver used in md
global_readin_dirdirectory of files for reading

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pos()

void MD_base::update_pos ( )
protectedvirtual

perform one step update of pos due to atomic velocity

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_vel()

void MD_base::update_vel ( const ModuleBase::Vector3< double > *  force)
protectedvirtual

perform half-step update of vel due to atomic force

Parameters
forceatomic forces
Here is the caller graph for this function:

◆ write_restart()

void MD_base::write_restart ( const std::string &  global_out_dir)
virtual

write the information into files used for MD restarting

Parameters
global_out_dirdirectory of output files

Reimplemented in FIRE, Langevin, MSST, Nose_Hoover, and Verlet.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allmass

double* MD_base::allmass

atom mass

◆ cal_stress

bool MD_base::cal_stress
protected

whether calculate stress

◆ energy_

double MD_base::energy_ =0.0
protected

total energy of the system

◆ force

ModuleBase::Vector3<double>* MD_base::force

force of each atom

◆ frozen_freedom_

int MD_base::frozen_freedom_

the fixed freedom of the system

◆ ionmbl

ModuleBase::Vector3<int>* MD_base::ionmbl

atom is frozen or not

◆ kinetic

double MD_base::kinetic

kinetic energy

◆ md_dt

double MD_base::md_dt
protected

Time increment (hbar/E_hartree)

◆ md_tfirst

double MD_base::md_tfirst
protected

Temperature (in Hartree, 1 Hartree ~ 3E5 K)

◆ md_tlast

double MD_base::md_tlast
protected

Target temperature.

◆ mdp

const MD_para& MD_base::mdp
protected

input parameters used in md

◆ my_rank

int MD_base::my_rank
protected

MPI rank of the processor.

◆ pos

ModuleBase::Vector3<double>* MD_base::pos

atom displacements liuyu modify 2023-03-22

◆ potential

double MD_base::potential =0.0

potential energy

◆ step_

int MD_base::step_

the MD step finished in current calculation

◆ step_rst_

int MD_base::step_rst_

the MD step finished in previous calculations

◆ stop

bool MD_base::stop

MD stop or not.

◆ stress

ModuleBase::matrix MD_base::stress

stress for this lattice

◆ t_current

double MD_base::t_current

current temperature

◆ ucell

UnitCell& MD_base::ucell
protected

unitcell information

◆ vel

ModuleBase::Vector3<double>* MD_base::vel

atom velocity

◆ virial

ModuleBase::matrix MD_base::virial

virial for this lattice


The documentation for this class was generated from the following files: