ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
klist.h
Go to the documentation of this file.
1
3
8#include <iostream>
9#include <fstream>
10
11namespace Test_Deepks
12{
14{
15public:
16
17 ModuleBase::Vector3<double> *kvec_c; // Cartesian coordinates of k points
18 std::vector<ModuleBase::Vector3<double>> kvec_d; // Direct coordinates of k points
19
20 double *wk; // wk, weight of k points
21
22 int *isk; // distinguish spin up and down k points
23
24 int nkstot; // total number of k points
25
26 int nmp[3]; // Number of Monhorst-Pack
27
28 K_Vectors();
29 ~K_Vectors();
30
31 void set(
32 const std::string &k_file_name,
33 const int& nspin,
34 const ModuleBase::Matrix3 &reciprocal_vec,
35 const ModuleBase::Matrix3 &latvec,
36 bool &GAMMA_ONLY_LOCAL,
37 std::ofstream &ofs_running,
38 std::ofstream &ofs_warning);
39
40private:
41 int nspin;
42 bool kc_done;
43 bool kd_done;
44 double koffset[3]; // used only in automatic k-points.
45 std::string k_kword; //LiuXh add 20180619
46 int k_nkstot; //LiuXh add 20180619
47
48 // step 1 : generate kpoints
49 bool read_kpoints(
50 const std::string &fn,
51 bool &GAMMA_ONLY_LOCAL,
52 std::ofstream &ofs_warning,
53 std::ofstream &ofs_running);
54 void Monkhorst_Pack(const int *nmp_in,const double *koffset_in,const int tipo);
55 double Monkhorst_Pack_formula( const int &k_type, const double &offset,
56 const int& n, const int &dim);
57
58 // step 2 : set both kvec and kved; normalize weight
59 void set_both_kvec(const ModuleBase::Matrix3 &G,const ModuleBase::Matrix3 &Rm, std::ofstream &ofs_running);
60 void renew(const int &kpoint_number);
61 void normalize_wk( const int &degspin );
62
63 // step 3 : *2 or *4 kpoints.
64 // *2 for LSDA
65 // *4 for non-collinear
66 void set_kup_and_kdw(std::ofstream &ofs_running);
67
68 // step 4
69 // print k lists.
70 void print_klists(std::ofstream &fn_running);
71};
72}
3x3 matrix and related mathamatical operations
Definition matrix3.h:19
3 elements vector
Definition vector3.h:22
Definition klist.h:14
ModuleBase::Vector3< double > * kvec_c
Definition klist.h:17
int k_nkstot
Definition klist.h:46
K_Vectors()
Definition klist_1.cpp:6
void Monkhorst_Pack(const int *nmp_in, const double *koffset_in, const int tipo)
Definition klist_1.cpp:400
void print_klists(std::ofstream &fn_running)
Definition klist_1.cpp:570
int nspin
Definition klist.h:41
void normalize_wk(const int &degspin)
Definition klist_1.cpp:496
std::vector< ModuleBase::Vector3< double > > kvec_d
Definition klist.h:18
double Monkhorst_Pack_formula(const int &k_type, const double &offset, const int &n, const int &dim)
Definition klist_1.cpp:389
void renew(const int &kpoint_number)
Definition klist_1.cpp:98
void set_both_kvec(const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &Rm, std::ofstream &ofs_running)
Definition klist_1.cpp:438
~K_Vectors()
Definition klist_1.cpp:21
std::string k_kword
Definition klist.h:45
bool read_kpoints(const std::string &fn, bool &GAMMA_ONLY_LOCAL, std::ofstream &ofs_warning, std::ofstream &ofs_running)
Definition klist_1.cpp:117
int nkstot
Definition klist.h:24
int * isk
Definition klist.h:22
int nmp[3]
Definition klist.h:26
double koffset[3]
Definition klist.h:44
void set_kup_and_kdw(std::ofstream &ofs_running)
Definition klist_1.cpp:523
double * wk
Definition klist.h:20
void set(const std::string &k_file_name, const int &nspin, const ModuleBase::Matrix3 &reciprocal_vec, const ModuleBase::Matrix3 &latvec, bool &GAMMA_ONLY_LOCAL, std::ofstream &ofs_running, std::ofstream &ofs_warning)
Definition klist_1.cpp:29
bool kc_done
Definition klist.h:42
bool kd_done
Definition klist.h:43
Definition klist.h:12