ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
dp_forcefield.h
Go to the documentation of this file.
1#ifndef SOURCE_MD_MODULE_DP_DP_FORCEFIELD_H
2#define SOURCE_MD_MODULE_DP_DP_FORCEFIELD_H
3
5
6#ifdef __DPMD
7#ifdef __DPMDC
8namespace deepmd
9{
10namespace hpp
11{
12class DeepPot;
13}
14} // namespace deepmd
15#else
16namespace deepmd
17{
18class DeepPot;
19}
20#endif
21#endif
22
23#include <iosfwd>
24#include <memory>
25#include <string>
26#include <vector>
27
28class UnitCell;
29class MDCell;
31
32namespace ModuleMD
33{
34class DP : public ForceField
35{
36 public:
37 DP(const std::string &pot_file, const std::string &output_dir, std::ofstream &running_log);
38 ~DP() override;
39
40 void initialize(BaseCell &cell, const Input_para &inp) override;
41 void compute(
42 BaseCell &cell,
43 double &energy,
44 ModuleBase::matrix &force,
45 ModuleBase::matrix &stress) override;
46
47 private:
48 void initialize_type_map_(const std::vector<std::string> &type_labels);
49 void compute_mdcell_(MDCell &cell, double &energy, ModuleBase::matrix &stress);
50
51#ifdef __DPMD
52#ifdef __DPMDC
53 std::unique_ptr<deepmd::hpp::DeepPot> dp;
54#else
55 std::unique_ptr<deepmd::DeepPot> dp;
56#endif
57#endif
58 std::string dp_file;
59 std::string output_dir_;
60 std::ofstream &running_log_;
61 std::vector<int> md_type_to_dp_type_;
62 std::vector<double> fparam;
63 std::vector<double> aparam;
64 std::unique_ptr<MDCell> distributed_cell_;
65 std::unique_ptr<DomainDecomposition> decomposition_;
66 bool aparam_nall_ = false;
67 double rescaling = 1.0;
68};
69} // namespace ModuleMD
70
71#endif
Definition basecell.h:9
Domain decomposition for distributed and single-domain neighbor input.
Definition dom_decomp.h:32
Definition mdcell.h:29
Definition matrix.h:15
void compute(BaseCell &cell, double &energy, ModuleBase::matrix &force, ModuleBase::matrix &stress) override
Definition dp_forcefield.cpp:178
void initialize(BaseCell &cell, const Input_para &inp) override
Definition dp_forcefield.cpp:67
DP(const std::string &pot_file, const std::string &output_dir, std::ofstream &running_log)
Definition dp_forcefield.cpp:52
void initialize_type_map_(const std::vector< std::string > &type_labels)
std::unique_ptr< MDCell > distributed_cell_
Definition dp_forcefield.h:64
std::ofstream & running_log_
Definition dp_forcefield.h:60
std::vector< double > fparam
Definition dp_forcefield.h:62
bool aparam_nall_
Definition dp_forcefield.h:66
void compute_mdcell_(MDCell &cell, double &energy, ModuleBase::matrix &stress)
~DP() override
std::unique_ptr< DomainDecomposition > decomposition_
Definition dp_forcefield.h:65
std::vector< double > aparam
Definition dp_forcefield.h:63
std::vector< int > md_type_to_dp_type_
Definition dp_forcefield.h:61
std::string dp_file
Definition dp_forcefield.h:58
std::string output_dir_
Definition dp_forcefield.h:59
double rescaling
Definition dp_forcefield.h:67
Definition forcefield.h:16
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition esolver_forcefields.h:9
Definition input_parameter.h:13