26 std::vector<std::map<int, ModuleBase::Vector3<double>>>
kstars;
58 const std::string& k_file_name,
63 std::ofstream& ofs_warning,
65 const std::string& global_out_dir,
66 const bool gamma_only_local,
67 const double kspacing[3],
68 const std::string& kmesh_type,
159 const std::vector<double>& wk_ibz,
160 std::ofstream& ofs_running,
181 const bool update_symmetry,
182 std::ofstream& ofs_running);
198 const std::string& fn,
199 const bool gamma_only_local,
200 const double kspacing[3],
201 const std::string& kmesh_type,
202 const double koffset_in[3],
203 std::ofstream& ofs_running,
204 std::ofstream& ofs_warning,
220 renew(kpoint_number);
229 std::ofstream& ofs_running)
256 void renew(
const int& kpoint_number)
override;
261 return this->spin_mult;
285 std::ofstream& ofs_running)
override;
309 const std::string& fn,
310 const bool gamma_only_local,
311 const double kspacing[3],
312 const std::string& kmesh_type,
314 std::ofstream& ofs_running,
315 std::ofstream& ofs_warning,
330 bool parse_kfile(
const std::string& fn, std::ofstream& ofs_running, std::ofstream& ofs_warning);
346 const std::string& kword,
347 std::ofstream& ofs_running,
348 std::ofstream& ofs_warning);
363 bool read_listed_kpoints(std::ifstream& ifk,
const std::string& kword, std::ofstream& ofs_warning);
379 const bool cartesian,
380 std::ofstream& ofs_warning);
459 void mpi_k(std::ofstream& ofs_running,
const int my_rank,
const int my_pool);
void interpolate_k_between(std::ifstream &ifk, std::vector< ModuleBase::Vector3< double > > &kvec)
Adds k-points linearly between special points.
Definition klist.cpp:423
void mpi_k(std::ofstream &ofs_running, const int my_rank, const int my_pool)
Distributes k-points among MPI processes.
Definition klist.cpp:681
double koffset[3]
used only in automatic k-points
Definition klist.h:244
void reduce_by_symmetry(const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, bool use_symm, std::string &skpt, bool &match, const int my_rank, std::ofstream &ofs_running) override
Reduce the k-points to the irreducible Brillouin zone (IBZ).
Definition klist.cpp:510
void renew_for_testing(const int &kpoint_number)
Definition klist.h:218
int get_nks() const
Definition klist.h:71
void set_nks(int value)
Definition klist.h:108
K_Vectors()
Definition klist.h:28
void set_spin_mult(int value)
Set the spin multiplicity: 1 (no doubling, also for non-collinear nspin=4) or 2 (LSDA,...
Definition klist.h:125
double get_koffset(const int i) const
Definition klist.h:86
void update_use_ibz(const int &nkstot_ibz, const std::vector< ModuleBase::Vector3< double > > &kvec_d_ibz, const std::vector< double > &wk_ibz, std::ofstream &ofs_running, const int my_rank)
Updates the k-points to use the irreducible Brillouin zone (IBZ).
Definition klist.cpp:439
bool read_kpoints_for_testing(const UnitCell &ucell, const std::string &fn, const bool gamma_only_local, const double kspacing[3], const std::string &kmesh_type, const double koffset_in[3], std::ofstream &ofs_running, std::ofstream &ofs_warning, const int my_rank)
Definition klist.h:197
~K_Vectors()
Definition klist.h:29
bool read_kpoints(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_running, std::ofstream &ofs_warning, const int my_rank)
step 1 : generate kpoints
Definition klist.cpp:229
bool read_listed_kpoints(std::ifstream &ifk, const std::string &kword, std::ofstream &ofs_warning)
Read the explicitly listed k points (nkstot > 0 form of KPT).
Definition klist.cpp:366
K_Vectors & operator=(K_Vectors &&rhs)=default
std::vector< int > ik2iktot
[nks] map ik to the global index of k points
Definition klist.h:137
void set_kup_and_kdw_for_testing(std::ofstream &ofs_running)
Definition klist.h:234
K_Vectors & operator=(const K_Vectors &)=default
int get_spin_mult() const
Spin multiplicity of the k-point list: 1 (no doubling, also for non-collinear nspin=4) or 2 (LSDA,...
Definition klist.h:98
void set(const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, const std::string &k_file_name, const int &nspin, const ModuleBase::Matrix3 &reciprocal_vec, const ModuleBase::Matrix3 &latvec, std::ofstream &ofs, std::ofstream &ofs_warning, const bool use_ibz, const std::string &global_out_dir, const bool gamma_only_local, const double kspacing[3], const std::string &kmesh_type, const double koffset[3])
Set up the k-points for the system.
Definition klist.cpp:13
std::vector< int > isk
distinguish spin up and down k points
Definition klist.h:22
bool setup_line_kpoints(std::ifstream &ifk, std::vector< ModuleBase::Vector3< double > > &kvec, const bool cartesian, std::ofstream &ofs_warning)
Build line-mode k points by interpolating between special points.
Definition klist.cpp:395
int spin_factor() const override
Spin multiplicity used when generating the mesh (1/2).
Definition klist.h:259
int get_k_nkstot() const
Definition klist.h:91
void set_nkstot(int value)
Definition klist.h:113
void set_nkstot_nospin(int value)
Definition klist.h:118
int get_nkstot_nospin() const
Definition klist.h:81
int spin_mult
Definition klist.h:243
void set_kup_and_kdw(std::ofstream &ofs_running)
step 4 : *2 kpoints
Definition klist.cpp:477
Parallel_Kpoints para_k
parallel for kpoints
Definition klist.h:33
bool is_uniform_mp() const
Definition klist.cpp:209
std::string get_k_kword() const
Definition klist.h:103
std::vector< std::map< int, ModuleBase::Vector3< double > > > kstars
equal k points to each ibz-kpont, corresponding to a certain symmetry operations. dim: [iks_ibz][(isy...
Definition klist.h:26
bool read_mp_mesh(std::ifstream &ifk, const std::string &kword, std::ofstream &ofs_running, std::ofstream &ofs_warning)
Read the Monkhorst-Pack/Gamma mesh block and generate the mesh.
Definition klist.cpp:317
bool parse_kfile(const std::string &fn, std::ofstream &ofs_running, std::ofstream &ofs_warning)
Read the KPT file and build the k-point list from it.
Definition klist.cpp:254
int get_nkstot() const
Definition klist.h:76
void set_after_vc(const ModuleBase::Matrix3 &G, const ModuleSymmetry::Symmetry &symm, const bool update_symmetry, std::ofstream &ofs_running)
Updates the k-points after a volume change.
Definition klist.cpp:599
void handle_symmetry_mismatch(const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, std::string &skpt, bool &match, const int my_rank, std::ofstream &ofs)
Handle a reciprocal/real lattice Bravais-type mismatch after IBZ reduction.
Definition klist.cpp:168
std::vector< int > ibz_index
map k points (before symmetry reduction) to irreducible k-points
Definition klist.h:138
void renew(const int &kpoint_number) override
Resize the k-point related vectors according to the new k-point number.
Definition klist.cpp:201
bool get_is_mp() const
Definition klist.h:130
void reduce_by_symmetry_for_testing(const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, bool use_symm, std::string &skpt, bool &match, const int my_rank, std::ofstream &ofs_running)
Definition klist.h:223
3x3 matrix and related mathamatical operations
Definition matrix3.h:15
3 elements vector
Definition vector3.h:21
Abstract base class shared by K_Vectors (electrons) and QList (phonons).
Definition reciprocal_grid.h:52
std::string k_kword
Type keyword of the point-list file.
Definition reciprocal_grid.h:178
int nks
Number of points in the current pool (spin-free view).
Definition reciprocal_grid.h:75
int nkstot
Definition reciprocal_grid.h:78
int nkstot_nospin
Definition reciprocal_grid.h:82
int k_nkstot
Total number of points read from a point-list file (0 = auto mesh).
Definition reciprocal_grid.h:176
bool is_mp
Whether this is a Monkhorst-Pack grid.
Definition reciprocal_grid.h:174
Symmetry analysis class.
Definition symmetry.h:24
Parallel_Kpoints class for k-point parallelization.
Definition parallel_kpoints.h:17
Provide the basic information about unitcell.
Definition unitcell.h:16
Parallel_Kpoints class for k-point parallelization.
Abstract base class for reciprocal-space point grids.