10#ifndef RECIPROCAL_GRID_H
11#define RECIPROCAL_GRID_H
37void restrict_kpt(ModuleBase::Vector3<double>& kvec,
double epsilon);
41 const ModuleBase::Vector3<double>& second,
55 std::vector<ModuleBase::Vector3<double>>
kvec_c;
57 std::vector<ModuleBase::Vector3<double>>
kvec_d;
61 std::vector<double>
wk;
65 int nmp[3] = {0, 0, 0};
94 virtual void renew(
const int& kpoint_number);
100 void Monkhorst_Pack(
const int* nmp_in,
const double* koffset_in,
const int k_type);
119 std::ofstream& ofs_running,
120 std::ofstream& ofs_warning);
154 std::vector<double>& wk_ibz,
155 std::vector<int>& ibz_index,
156 std::vector<int>& ibz2bz);
171 std::ofstream& ofs_running) = 0;
206 std::vector<ModuleBase::Matrix3>& kgmatrix,
3x3 matrix and related mathamatical operations
Definition matrix3.h:15
3 elements vector
Definition vector3.h:21
virtual ~ReciprocalGrid()=default
bool kd_done
Whether the direct coordinates have been computed.
Definition reciprocal_grid.h:72
std::string k_kword
Type keyword of the point-list file.
Definition reciprocal_grid.h:178
std::vector< ModuleBase::Vector3< double > > kvec_c
Cartesian coordinates of the points, in unit of 2*pi/lat0.
Definition reciprocal_grid.h:55
std::vector< int > kl_segids
Index of the k-line segment each point belongs to.
Definition reciprocal_grid.h:67
void normalize_wk(const int °spin)
Normalize the weights so that they sum to the spin degeneracy.
Definition reciprocal_grid.cpp:256
ReciprocalGrid & operator=(ReciprocalGrid &&)=default
int nmp[3]
Monkhorst-Pack grid dimensions.
Definition reciprocal_grid.h:65
void reduce_ibz(const ModuleBase::Matrix3 *rot_ops, int nrotkm, const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &k_lattice, const ModuleBase::Matrix3 *kkmatrix, double epsilon, std::vector< ModuleBase::Vector3< double > > &vec_ibz, std::vector< double > &wk_ibz, std::vector< int > &ibz_index, std::vector< int > &ibz2bz)
Star (IBZ) reduction primitive shared by k-points and q-points.
Definition reciprocal_grid.cpp:336
std::vector< ModuleBase::Vector3< double > > kvec_c_full
Cartesian coordinates of the full (unreduced) mesh, in unit of 2*pi/lat0.
Definition reciprocal_grid.h:59
double Monkhorst_Pack_formula(const int &k_type, const double &offset, const int &n, const int &dim)
Coordinate of a point generated by the Monkhorst-Pack scheme.
Definition reciprocal_grid.cpp:68
void kvec_c2d(const ModuleBase::Matrix3 &latvec)
Convert Cartesian to direct coordinates.
Definition reciprocal_grid.cpp:171
std::vector< double > wk
Weight of each point.
Definition reciprocal_grid.h:61
int nks
Number of points in the current pool (spin-free view).
Definition reciprocal_grid.h:75
std::vector< ModuleBase::Vector3< double > > kvec_d
Direct coordinates of the points.
Definition reciprocal_grid.h:57
bool build_star_ops(const UnitCell &ucell, const ModuleSymmetry::Symmetry &symm, bool use_symm, ModuleBase::Matrix3 &k_vec, std::vector< ModuleBase::Matrix3 > &kgmatrix, int &nrotkm) const
Build the reciprocal-space point-group operations for star reduction.
Definition reciprocal_grid.cpp:465
ReciprocalGrid & operator=(const ReciprocalGrid &)=default
virtual 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)=0
Reduce this grid according to symmetry operations.
int nkstot
Definition reciprocal_grid.h:78
void Monkhorst_Pack(const int *nmp_in, const double *koffset_in, const int k_type)
Generate a Monkhorst-Pack mesh.
Definition reciprocal_grid.cpp:82
void print_klists(std::ofstream &ofs) const
Print the points in both Cartesian and direct coordinates.
Definition reciprocal_grid.cpp:294
int nkstot_nospin
Definition reciprocal_grid.h:82
std::vector< int > ngk
Number of plane waves for each point (filled by the PW basis).
Definition reciprocal_grid.h:63
int k_nkstot
Total number of points read from a point-list file (0 = auto mesh).
Definition reciprocal_grid.h:176
void set_both_kvec(const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &R, std::string &skpt, std::ofstream &ofs_running, std::ofstream &ofs_warning)
Set both the direct and Cartesian coordinates, and print the table.
Definition reciprocal_grid.cpp:187
bool kc_done
Whether the Cartesian coordinates have been computed.
Definition reciprocal_grid.h:70
virtual void renew(const int &kpoint_number)
Resize the point-related containers.
Definition reciprocal_grid.cpp:57
virtual int spin_factor() const
Spin-like multiplicity used by renew() (1 for q-points).
Definition reciprocal_grid.h:182
bool is_mp
Whether this is a Monkhorst-Pack grid.
Definition reciprocal_grid.h:174
void kvec_d2c(const ModuleBase::Matrix3 &reciprocal_vec)
Convert direct to Cartesian coordinates.
Definition reciprocal_grid.cpp:129
Symmetry analysis class.
Definition symmetry.h:24
Provide the basic information about unitcell.
Definition unitcell.h:16
void restrict_kpt(ModuleBase::Vector3< double > &kvec, double epsilon)
Fold a point into (-0.5, 0.5] in direct coordinates.
Definition reciprocal_grid.cpp:36
bool kpoints_equivalent(const ModuleBase::Vector3< double > &first, const ModuleBase::Vector3< double > &second, const double epsilon)
Compare reciprocal fractional coordinates modulo integer reciprocal vectors.
Definition reciprocal_grid.cpp:23