ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_nep.h
Go to the documentation of this file.
1#ifndef ESOLVER_NEP_H
2#define ESOLVER_NEP_H
3
4#include "esolver.h"
5#ifdef __NEP
6#include "nep.h"
7#endif
8#include <vector>
9#include <string>
10
11namespace ModuleESolver
12{
13
14class ESolver_NEP : public ESolver
15{
16 public:
17#ifdef __NEP
18 ESolver_NEP(const std::string& pot_file): nep(pot_file)
19 {
20 classname = "ESolver_NEP";
21 nep_file = pot_file;
22 }
23#else
24 ESolver_NEP(const std::string& pot_file)
25 {
26 classname = "ESolver_NEP";
27 nep_file = pot_file;
28 }
29#endif
30
37 void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
38
45 void runner(UnitCell& ucell, const int istep) override;
46
53 double cal_energy() override;
54
60 void cal_force(UnitCell& ucell, ModuleBase::matrix& force) override;
61
67 void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) override;
68
74 void after_all_runners(UnitCell& ucell) override;
75
76 private:
82 void type_map(const UnitCell& ucell);
83
92#ifdef __NEP
93 NEP3 nep;
94#endif
95
96 std::string nep_file;
97 std::vector<int> atype = {};
101 std::vector<double> _e;
102 std::vector<double> _f;
103 std::vector<double> _v;
104};
105
106} // namespace ModuleESolver
107
108#endif
Definition matrix.h:19
Definition esolver_nep.h:15
ModuleBase::matrix nep_force
computed atomic forces
Definition esolver_nep.h:99
std::vector< double > _v
temporary storage for virial computation
Definition esolver_nep.h:103
std::vector< int > atype
atom type mapping for NEP model
Definition esolver_nep.h:97
void runner(UnitCell &ucell, const int istep) override
Run the NEP solver for a given ion/md step and unit cell.
Definition esolver_nep.cpp:51
std::vector< double > _f
temporary storage for force computation
Definition esolver_nep.h:102
double cal_energy() override
get the total energy without ion kinetic energy
Definition esolver_nep.cpp:136
void before_all_runners(UnitCell &ucell, const Input_para &inp) override
Initialize the NEP solver with given input parameters and unit cell.
Definition esolver_nep.cpp:30
void cal_stress(UnitCell &ucell, ModuleBase::matrix &stress) override
get the computed lattice virials
Definition esolver_nep.cpp:147
ESolver_NEP(const std::string &pot_file)
Definition esolver_nep.h:24
double nep_potential
computed potential energy
Definition esolver_nep.h:98
ModuleBase::matrix nep_virial
computed lattice virials
Definition esolver_nep.h:100
void cal_force(UnitCell &ucell, ModuleBase::matrix &force) override
get the computed atomic forces
Definition esolver_nep.cpp:141
void after_all_runners(UnitCell &ucell) override
Prints the final total energy of the NEP model to the output file.
Definition esolver_nep.cpp:161
void type_map(const UnitCell &ucell)
determine the type map of NEP model
std::vector< double > _e
temporary storage for energy computation
Definition esolver_nep.h:101
std::string nep_file
NEP related variables for ESolver_NEP class.
Definition esolver_nep.h:96
Definition esolver.h:11
std::string classname
Definition esolver.h:49
Definition unitcell.h:17
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
Definition input_parameter.h:13