ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_forcefields.h
Go to the documentation of this file.
1#ifndef ESOLVER_FORCEFIELDS_H
2#define ESOLVER_FORCEFIELDS_H
3
4#include "esolver.h"
5#include <iosfwd>
6#include <memory>
7
8namespace ModuleMD
9{
10class ForceField;
11}
12
13namespace ModuleESolver
14{
16{
17 public:
18 esolver_forcefields(std::unique_ptr<ModuleMD::ForceField> potential, std::ofstream &running_log);
20
21 void before_all_runners(BaseCell &cell, const Input_para &inp) override;
22 void runner(BaseCell &cell, int istep) override;
23 double cal_energy() override;
24 void cal_force(BaseCell &cell, ModuleBase::matrix &force) override;
25 void cal_stress(BaseCell &cell, ModuleBase::matrix &stress) override;
26 void after_all_runners(BaseCell &cell) override;
27
28 private:
29 std::unique_ptr<ModuleMD::ForceField> potential_;
30 std::ofstream &running_log_;
31 double energy_ = 0.0;
34};
35} // namespace ModuleESolver
36
37#endif
Definition basecell.h:9
Definition matrix.h:15
ESolver()
Definition esolver.h:15
std::unique_ptr< ModuleMD::ForceField > potential_
Definition esolver_forcefields.h:29
void cal_force(BaseCell &cell, ModuleBase::matrix &force) override
calcualte forces for the atoms in the given cell
Definition esolver_forcefields.cpp:46
double cal_energy() override
calculate total energy of a given system
Definition esolver_forcefields.cpp:44
void before_all_runners(BaseCell &cell, const Input_para &inp) override
initialize the energy solver by using input parameters and cell modules
Definition esolver_forcefields.cpp:24
ModuleBase::matrix force_
Definition esolver_forcefields.h:32
std::ofstream & running_log_
Definition esolver_forcefields.h:30
void cal_stress(BaseCell &cell, ModuleBase::matrix &stress) override
calcualte stress of given cell
Definition esolver_forcefields.cpp:65
void after_all_runners(BaseCell &cell) override
perform post processing calculations
Definition esolver_forcefields.cpp:85
double energy_
Definition esolver_forcefields.h:31
ModuleBase::matrix stress_
Definition esolver_forcefields.h:33
esolver_forcefields(std::unique_ptr< ModuleMD::ForceField > potential, std::ofstream &running_log)
Definition esolver_forcefields.cpp:16
void runner(BaseCell &cell, int istep) override
run energy solver
Definition esolver_forcefields.cpp:31
Definition forcefield.h:16
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
Definition esolver_forcefields.h:9
Definition input_parameter.h:13