ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
klist_io.h
Go to the documentation of this file.
1#ifndef KLIST_IO_H
2#define KLIST_IO_H
3
6
7#include <fstream>
8#include <map>
9#include <string>
10#include <vector>
11
13{
14class Symmetry; // full definition only needed in klist_io.cpp
15}
16
17class UnitCell; // full definition only needed in klist_io.cpp
18
21namespace KListIO
22{
24std::string ibz_kpt_table(int nkstot,
25 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
26 const std::vector<int>& ibz_index,
27 const std::vector<ModuleBase::Vector3<double>>& kvec_d_ibz);
28
30std::string ibz_wk_table(int nkstot_ibz,
31 const std::vector<ModuleBase::Vector3<double>>& kvec_d_ibz,
32 const std::vector<double>& wk_ibz,
33 const std::vector<int>& ibz2bz);
34
36struct LineK
37{
38 std::vector<ModuleBase::Vector3<double>> kpts;
39 std::vector<int> segids;
40 int nks_total = 0;
41};
42
46bool find_kpoints_header(std::ifstream& ifk);
47
51void read_kpt_list(std::ifstream& ifk,
52 int nkstot,
53 std::vector<ModuleBase::Vector3<double>>& kvec,
54 std::vector<double>& wk);
55
59LineK interp_line(std::ifstream& ifk, int nks_special);
60
66void build_kstars(const std::vector<ModuleBase::Vector3<double>>& kvec_d,
67 const std::vector<ModuleBase::Matrix3>& kgmatrix,
68 int nrotkm,
69 const std::vector<ModuleBase::Vector3<double>>& kvec_d_ibz,
70 double epsilon,
71 std::vector<std::map<int, ModuleBase::Vector3<double>>>& kstars);
72
80 std::vector<ModuleBase::Matrix3>& kgmatrix,
81 int nrotkm);
82
85void pack_kpts(const std::vector<int>& isk,
86 const std::vector<double>& wk,
87 const std::vector<ModuleBase::Vector3<double>>& kvec_c,
88 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
89 const std::vector<ModuleBase::Vector3<double>>& kvec_c_full,
90 int nkstot,
91 std::vector<int>& isk_aux,
92 std::vector<double>& wk_aux,
93 std::vector<double>& kvec_c_aux,
94 std::vector<double>& kvec_d_aux,
95 std::vector<double>& kvec_c_full_aux);
96
102void bcast_kstars(std::vector<std::map<int, ModuleBase::Vector3<double>>>& kstars,
103 int nkstot,
104 int my_rank);
105
108void unpack_kpts(const std::vector<int>& isk_aux,
109 const std::vector<double>& wk_aux,
110 const std::vector<double>& kvec_c_aux,
111 const std::vector<double>& kvec_d_aux,
112 const std::vector<double>& kvec_c_full_aux,
113 int nks,
114 int startk,
115 std::vector<int>& isk,
116 std::vector<double>& wk,
117 std::vector<ModuleBase::Vector3<double>>& kvec_c,
118 std::vector<ModuleBase::Vector3<double>>& kvec_d,
119 std::vector<ModuleBase::Vector3<double>>& kvec_c_full);
120
126void fill_full_kvec(bool kc_done,
127 bool kd_done,
128 int nkstot_nospin,
129 const ModuleBase::Matrix3& reciprocal_vec,
130 const std::vector<ModuleBase::Vector3<double>>& kvec_c,
131 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
132 std::vector<ModuleBase::Vector3<double>>& kvec_c_full);
133
139void build_ik2iktot(int my_pool,
140 const std::vector<int>& startk_pool,
141 int spin_mult,
142 int nks,
143 int nkstot,
144 std::vector<int>& ik2iktot);
145
151void expand_spin_kpoints(int spin_mult,
152 std::vector<ModuleBase::Vector3<double>>& kvec_c,
153 std::vector<ModuleBase::Vector3<double>>& kvec_d,
154 std::vector<double>& wk,
155 std::vector<int>& isk,
156 int& nks,
157 int& nkstot);
158
164void write_auto_kfile(const UnitCell& ucell,
165 const std::string& fn,
166 bool gamma_only_local,
167 const double kspacing[3],
168 const std::string& kmesh_type,
169 const double koffset[3],
170 std::ofstream& ofs_warning);
171} // namespace KListIO
172
173#endif // KLIST_IO_H
3x3 matrix and related mathamatical operations
Definition matrix3.h:15
3 elements vector
Definition vector3.h:21
Symmetry analysis class.
Definition symmetry.h:24
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition klist_io.cpp:21
std::string ibz_wk_table(const int nkstot_ibz, const std::vector< ModuleBase::Vector3< double > > &kvec_d_ibz, const std::vector< double > &wk_ibz, const std::vector< int > &ibz2bz)
Render the IBZ weight table (IBZ k-point, weight, multiplicity, origin index).
Definition klist_io.cpp:58
std::string ibz_kpt_table(const int nkstot, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const std::vector< int > &ibz_index, const std::vector< ModuleBase::Vector3< double > > &kvec_d_ibz)
Render the IBZ reduction table ("IBZ" k-point -> originating k-point).
Definition klist_io.cpp:23
int append_time_reversal_ops(const ModuleSymmetry::Symmetry &symm, std::vector< ModuleBase::Matrix3 > &kgmatrix, const int nrotkm)
Definition klist_io.cpp:212
void expand_spin_kpoints(const int spin_mult, std::vector< ModuleBase::Vector3< double > > &kvec_c, std::vector< ModuleBase::Vector3< double > > &kvec_d, std::vector< double > &wk, std::vector< int > &isk, int &nks, int &nkstot)
Definition klist_io.cpp:408
void bcast_kstars(std::vector< std::map< int, ModuleBase::Vector3< double > > > &kstars, const int nkstot, const int my_rank)
Definition klist_io.cpp:320
void read_kpt_list(std::ifstream &ifk, const int nkstot, std::vector< ModuleBase::Vector3< double > > &kvec, std::vector< double > &wk)
Definition klist_io.cpp:95
void write_auto_kfile(const UnitCell &ucell, const std::string &fn, const bool gamma_only_local, const double kspacing[3], const std::string &kmesh_type, const double koffset[3], std::ofstream &ofs_warning)
Definition klist_io.cpp:450
void unpack_kpts(const std::vector< int > &isk_aux, const std::vector< double > &wk_aux, const std::vector< double > &kvec_c_aux, const std::vector< double > &kvec_d_aux, const std::vector< double > &kvec_c_full_aux, const int nks, const int startk, std::vector< int > &isk, std::vector< double > &wk, std::vector< ModuleBase::Vector3< double > > &kvec_c, std::vector< ModuleBase::Vector3< double > > &kvec_d, std::vector< ModuleBase::Vector3< double > > &kvec_c_full)
Definition klist_io.cpp:285
void fill_full_kvec(const bool kc_done, const bool kd_done, const int nkstot_nospin, const ModuleBase::Matrix3 &reciprocal_vec, const std::vector< ModuleBase::Vector3< double > > &kvec_c, const std::vector< ModuleBase::Vector3< double > > &kvec_d, std::vector< ModuleBase::Vector3< double > > &kvec_c_full)
Definition klist_io.cpp:352
void pack_kpts(const std::vector< int > &isk, const std::vector< double > &wk, const std::vector< ModuleBase::Vector3< double > > &kvec_c, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const std::vector< ModuleBase::Vector3< double > > &kvec_c_full, const int nkstot, std::vector< int > &isk_aux, std::vector< double > &wk_aux, std::vector< double > &kvec_c_aux, std::vector< double > &kvec_d_aux, std::vector< double > &kvec_c_full_aux)
Definition klist_io.cpp:252
void build_ik2iktot(const int my_pool, const std::vector< int > &startk_pool, const int spin_mult, const int nks, const int nkstot, std::vector< int > &ik2iktot)
Definition klist_io.cpp:376
void build_kstars(const std::vector< ModuleBase::Vector3< double > > &kvec_d, const std::vector< ModuleBase::Matrix3 > &kgmatrix, const int nrotkm, const std::vector< ModuleBase::Vector3< double > > &kvec_d_ibz, const double epsilon, std::vector< std::map< int, ModuleBase::Vector3< double > > > &kstars)
Definition klist_io.cpp:174
bool find_kpoints_header(std::ifstream &ifk)
Definition klist_io.cpp:79
LineK interp_line(std::ifstream &ifk, const int nks_special)
Definition klist_io.cpp:107
Definition klist_io.h:13
Result of line-mode interpolation between special k-points.
Definition klist_io.h:37
int nks_total
total interpolated k-point count
Definition klist_io.h:40
std::vector< int > segids
segment id per k point (ISSUE#3482)
Definition klist_io.h:39
std::vector< ModuleBase::Vector3< double > > kpts
interpolated k points
Definition klist_io.h:38