ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
vdwd4.h
Go to the documentation of this file.
1#ifndef VDWD4_H
2#define VDWD4_H
3
4#include "vdw.h"
5
6#include <array>
7#include <string>
8#include <vector>
9
10namespace vdw
11{
12
13class Vdwd4 : public Vdw
14{
15 public:
16 Vdwd4(const UnitCell &unit_in, const std::string &xc_name, const Input_para &input);
17
18 ~Vdwd4() override = default;
19
20 private:
21 std::string xc_name_;
22 std::string model_name_;
23 double cutoff_disp2_ = 0.0; // Bohr, two-body dispersion cutoff
24 double cutoff_disp3_ = 0.0; // Bohr, three-body ATM cutoff
25 double cutoff_cn_ = 0.0; // Bohr, coordination-number cutoff
26 double smooth_width_2b_ = 0.0; // Bohr, two-body cutoff smoothing width
27 double smooth_width_3b_ = 0.0; // Bohr, three-body cutoff smoothing width
28 double total_charge_ = 0.0; // e, total system charge (sum zv*na - nelec)
29
30 void evaluate_impl(const VdwRequest &request, VdwResult &result) override;
31
33 const std::vector<double> &gradient_ha_bohr, const std::vector<int> &atom_indices, VdwResult &result) const;
34 void set_stress_from_sigma(const std::array<double, 9> &sigma_ha, VdwResult &result) const;
35
36 void build_structure(
37 std::vector<int> &numbers,
38 std::vector<double> &positions,
39 std::vector<double> &lattice,
40 std::array<bool, 3> &periodic,
41 std::vector<int> &atom_indices) const;
42
43 // Optional output buffers are caller-owned and non-owning here.
44 // Vdwd4 writes to them during compute() and never stores their pointers.
45 void compute(
46 double &energy_ha,
47 std::vector<double> *gradient_ha_bohr,
48 std::array<double, 9> *sigma_ha,
49 std::vector<int> &atom_indices);
50};
51
52} // namespace vdw
53
54#endif // VDWD4_H
Provide the basic information about unitcell.
Definition unitcell.h:16
Vdw(const UnitCell &unit_in)
Definition vdw.h:43
double cutoff_disp3_
Definition vdwd4.h:24
double smooth_width_3b_
Definition vdwd4.h:27
double smooth_width_2b_
Definition vdwd4.h:26
void set_stress_from_sigma(const std::array< double, 9 > &sigma_ha, VdwResult &result) const
Definition vdwd4.cpp:291
double cutoff_disp2_
Definition vdwd4.h:23
void compute(double &energy_ha, std::vector< double > *gradient_ha_bohr, std::array< double, 9 > *sigma_ha, std::vector< int > &atom_indices)
Definition vdwd4.cpp:179
std::string xc_name_
Definition vdwd4.h:21
Vdwd4(const UnitCell &unit_in, const std::string &xc_name, const Input_para &input)
Definition vdwd4.cpp:88
double cutoff_cn_
Definition vdwd4.h:25
void set_force_from_gradient(const std::vector< double > &gradient_ha_bohr, const std::vector< int > &atom_indices, VdwResult &result) const
Definition vdwd4.cpp:274
double total_charge_
Definition vdwd4.h:28
void evaluate_impl(const VdwRequest &request, VdwResult &result) override
Definition vdwd4.cpp:304
~Vdwd4() override=default
std::string model_name_
Definition vdwd4.h:22
void build_structure(std::vector< int > &numbers, std::vector< double > &positions, std::vector< double > &lattice, std::array< bool, 3 > &periodic, std::vector< int > &atom_indices) const
Definition vdwd4.cpp:118
Definition esolver_fp.h:18
Definition input_parameter.h:13
Definition vdw.h:22
Definition vdw.h:30
Input_para input
Definition test_io_sys_var.cpp:58