ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
md_base.h
Go to the documentation of this file.
1#ifndef MD_BASE_H
2#define MD_BASE_H
3
7
8#include <cstdint>
9
11
21{
22 public:
33 MD_base(
34 const MD_para &mdp_in,
35 const bool cal_stress_in,
36 const bool init_vel,
37 const int my_rank_in,
38 MDCell &mdcell_in);
39 virtual ~MD_base();
40
47 virtual void setup(
48 ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir, DomainDecomposition &decomp);
49
55 virtual void first_half(std::ofstream &ofs);
56
60 virtual void second_half();
61
67 virtual void print_md(std::ofstream &ofs, const bool &cal_stress);
68
73 virtual void write_restart(const std::string &global_out_dir);
74
84 virtual void restart(const std::string &global_readin_dir);
85
86 protected:
90 virtual void update_pos();
91
96 virtual void update_vel();
97
98 public:
100 double get_md_dt() const { return md_dt; }
101
102 bool stop;
103 double t_current;
104 int step_;
106 std::int64_t frozen_freedom_;
109 double potential = 0.0;
110 double kinetic;
111
112 protected:
113 const MD_para &mdp;
115 double energy_ = 0.0;
116
119 double md_dt;
120 double md_tfirst;
121 double md_tlast;
122};
123
124#endif // MD_BASE_H
Domain decomposition for distributed and single-domain neighbor input.
Definition dom_decomp.h:32
Definition mdcell.h:29
double energy_
total energy of the system
Definition md_base.h:115
double md_dt
Time increment (hbar/E_hartree).
Definition md_base.h:119
ModuleBase::matrix stress
stress for this lattice
Definition md_base.h:108
double potential
potential energy
Definition md_base.h:109
bool cal_stress
whether calculate stress
Definition md_base.h:117
virtual void update_pos()
perform one step update of pos due to atomic velocity
Definition md_base.cpp:110
virtual void restart(const std::string &global_readin_dir)
restart MD when md_restart is true
Definition md_base.cpp:289
virtual void write_restart(const std::string &global_out_dir)
write the information into files used for MD restarting
Definition md_base.cpp:270
double md_tfirst
Temperature (in Hartree, 1 Hartree ~ 3E5 K).
Definition md_base.h:120
MD_base(const MD_para &mdp_in, const bool cal_stress_in, const bool init_vel, const int my_rank_in, MDCell &mdcell_in)
construct the integrator from the values it actually uses
Definition md_base.cpp:13
const MD_para & mdp
input parameters used in md
Definition md_base.h:113
ModuleBase::matrix virial
virial for this lattice
Definition md_base.h:107
virtual void print_md(std::ofstream &ofs, const bool &cal_stress)
output MD information such as energy, temperature, and pressure
Definition md_base.cpp:183
virtual void update_vel()
perform half-step update of vel due to atomic force
Definition md_base.cpp:166
int step_
the MD step finished in current calculation
Definition md_base.h:104
double get_md_dt() const
the time increment in a.u., converted from mdp.md_dt
Definition md_base.h:100
int my_rank
MPI rank of the processor.
Definition md_base.h:118
double kinetic
kinetic energy
Definition md_base.h:110
double t_current
current temperature
Definition md_base.h:103
std::int64_t frozen_freedom_
the fixed freedom of the system
Definition md_base.h:106
int step_rst_
the MD step finished in previous calculations
Definition md_base.h:105
virtual void setup(ModuleESolver::ESolver *p_esolver, const std::string &global_readin_dir, DomainDecomposition &decomp)
init before running md, calculate energy, force, and stress of the initial configuration.
Definition md_base.cpp:51
virtual void second_half()
the second half of equation of motion, update velocities
Definition md_base.cpp:103
double md_tlast
Target temperature.
Definition md_base.h:121
virtual void first_half(std::ofstream &ofs)
the first half of equation of motion, update velocities and positions
Definition md_base.cpp:95
virtual ~MD_base()
Definition md_base.cpp:49
bool stop
MD stop or not.
Definition md_base.h:102
Definition matrix.h:15
Definition esolver.h:13
Definition mdcell_cif_io.cpp:34
input parameters used in md
Definition md_parameter.h:12