diff --git a/source/module_cell/klist.h b/source/module_cell/klist.h index 0117493b6b..43753982a4 100644 --- a/source/module_cell/klist.h +++ b/source/module_cell/klist.h @@ -1,6 +1,79 @@ #ifndef K_VECTORS_H #define K_VECTORS_H +/* + On the refactor to remove GlobalV and GlobalC from class implementation + 2024/03/30 Kirk0830 + + What IS kpoint? + kpoint remarks translational symmetry of a crystal wavefunction. Each kpoint represents a translational + symmetry that the wavefunction can only strictly recover itself after a specific translation operation. + A more modern understanding is the translational operator and Hamiltonian operator is commutable, thus + the eigenstates of the translational operator can be used to linearly combined to form the eigenstates of + Hamiltonian operator. + + For programming, what can kpoint class have? + 0. Basic + kpoint class is for storing kpoint related information, certainly it should have functionalities to read + and even write ABACUS KPT files. Therefore it is a class, if compactly impelemented, it should hold the + kpoint coordinates data, and have methods for I/O the kpoint coordinates. + Comparatively the old implementation let kpoint know about nspin, the number of spin channels. However + it is, totally unaccpectable, because the translational symmetry has nothing related to the spin symmetry. + + 1. Symmetry: kpoint reduction, irreducible Brillouin zone + More specifically, the import of kpoints from external files, should be accompied with a kpoint processing, + such as the reduction of kpoints by symmetry operations. + Then it comes to the question "How to determine and reduce the number of kpoints according to symmetry". + In symmetry module, there are symmetrical operations instantiated according to the symmetry detected by + program. Imposing these operations on kpoints, if any two kpoints are equivalent, then they are the same, + and one of them should be removed. + + 2. Parallelization + At least for planewave, the parallelization on kpoints is natural. Prsent parallelization strategy is to + distribute kpoints by simple % and // way. + + Regulations on implementing MPI related functions: + 1. no matter if it is really MPI environment, always keep the workflow strictly unchanged, and if it is + non-MPI, then some functions are left empty but they are still be called in workflow. Which means it is + bad to implement functions like: + #ifdef __MPI + void mpi_k() + { + // do something + } + #endif + , it is recommended to implement like: + void mpi_k() + { + #ifdef __MPI + // do something + #endif + } + + Future demands: HFX q-grid, phonon q-grid + Thus it needs a new name, might be "BrillouinZoneSamplingGenerator" or something. + bz_sampl.h + + namespace bz_sampl{ + static int nprocs; + static int iproc; + + std::tuple, std::vector> generate(const int& nspin, + const std::string& fkpt, + const int& irank, + const int& nrank); + } + + // in esolver_ks.h + std::vector kpoints; + // in esolver_ks.cpp + // let what to be static? + + result = bz_sampl::generate(nspin, fkpt, irank, nrank); + kpoints = std::get<0>(result); + kweights = std::get<1>(result); +*/ + #include #include "module_base/global_function.h" @@ -34,24 +107,109 @@ class K_Vectors K_Vectors(); ~K_Vectors(); - void set( - const ModuleSymmetry::Symmetry &symm, - const std::string &k_file_name, - const int& nspin, - const ModuleBase::Matrix3 &reciprocal_vec, - const ModuleBase::Matrix3 &latvec); + void set(const ModuleSymmetry::Symmetry &symm, + const std::string &k_file_name, + const int& nspin, + const ModuleBase::Matrix3 &reciprocal_vec, + const ModuleBase::Matrix3 &latvec); - void ibz_kpoint(const ModuleSymmetry::Symmetry &symm, bool use_symm,std::string& skpt, const UnitCell &ucell, bool& match); + void ibz_kpoint(const ModuleSymmetry::Symmetry &symm, + bool use_symm,std::string& skpt, + const UnitCell& ucell, + bool& match); //LiuXh add 20180515 - void set_after_vc( - const ModuleSymmetry::Symmetry &symm, - const std::string &k_file_name, - const int& nspin, - const ModuleBase::Matrix3 &reciprocal_vec, - const ModuleBase::Matrix3 &latvec); + void set_after_vc(const ModuleSymmetry::Symmetry &symm, + const std::string &k_file_name, + const int& nspin, + const ModuleBase::Matrix3 &reciprocal_vec, + const ModuleBase::Matrix3 &latvec); //get global index for ik inline int getik_global(const int& ik) const; +// REFACTORING K_Vectors functions below >>> +private: + // newly built functions on refactor to remove GlobalC::Pkpoints and parallel_kpoints class + K_Vectors(const std::string& fkpt, + const double& lat0, + const std::vector>& avecs, + const std::vector>& bvecs, + const int& npools, + const int& nprocs_inpool); + + // partial alternative to set() function + bool build_kpt(const std::string& fkpt); + + // I/O functions + // read ABACUS KPT file + void read_abacus_kpt(const std::string& fkpt); + // from special kpoints specified in KPT file, generate a kpoint-path + static void interpolate_knodes(const std::vector>& knodes, //< [in] special kpoints direct coordinates + const std::vector& nks, //< [in] number of kpoints in each segment + std::vector>& kvec, //< [out] kpoints direct coordinates + std::vector& kseg_ids, //< [out] segment ids of kpoints + int& nkstot, //< [out] total number of kpoints + std::vector& wk); //< [out] weight of kpoints + // convert kspacing to exact Monkhorst-Pack mesh dimensions + static std::vector kspacing_tompmesh(const std::vector>& bvecs, //< [in] reciprocal lattice vectors + const double& lat0, //< [in] lattice_constant + const std::vector& kspacing); //< [in] kspacing + // overloaded version for ModuleBase::Matrix3 + static std::vector kspacing_tompmesh(const ModuleBase::Matrix3& bmat, //< [in] reciprocal lattice matrix + const double& lat0, //< [in] lattice_constant + const std::vector& kspacing); //< [in] kspacing + // write Monkhorst-Pack kpoints to KPT file + static std::string write_abacus_mpkmesh(const std::string& center, //< [in] can be "Gamma" or "Monkhorst-Pack" + const std::vector& nmp, //< [in] number of Monkhorst-Pack kpoints + const std::vector& shifts); //< [in] shifts of Monkhorst-Pack kpoints + // write Line mode kpoints to KPT file + static std::string write_abacus_kline(const std::string& scale, //< [in] can be "Direct" or "Cartesian" + const std::vector>& kvec, //< [in] kpoints coordinates + const std::vector& nks); //< [in] number of kpoints in each segment + // overloaded version for ModuleBase::Vector3, which is not safe and has partially been deprecated by new compilers like icpx + static std::string write_abacus_kline(const std::string& scale, //< [in] can be "Direct" or "Cartesian" + const std::vector>& kvec, //< [in] kpoints coordinates + const std::vector& nks); //< [in] number of kpoints in each segment + + // Synchronize + // synchronize between alpha and beta spin. Because kpoint does not distinguish spin physically, this way + // is just a computational implementation convention, rather than physically strict/correct way. + void sync_kvec_betweenspin(const int& nspin); // because in principle there is forever 1 set of kpoints, + // the special treatment like treating different spin + // kpoints separately is not physically correct. Thus the + // nspin is set as one parameter instead of a member variable. + // synchronize between kvec_c and kvec_d + void sync_kvec_betweencd(const bool& direct, //< [in] true is from kvec_d to kvec_c, false is from kvec_c to kvec_d + const ModuleBase::Matrix3& t); //< [in] transformation matrix + // synchronize between MPI processes + void sync_kvec_betweenproc(); + + std::vector> kvec(const std::vector& iks, + const bool& direct = true, + const bool& irreducible = true) const + { + std::vector> kvecs(iks.size()); + std::transform(iks.begin(), iks.end(), kvecs.begin(), [&](const int& ik) + { + return kvec(ik, direct, irreducible); + }); + return kvecs; + } + std::vector kvec(const int& ik, + const bool& direct = true, + const bool& irreducible = true) const + { + if((direct)&&(irreducible)) return kvec_d_[ikibz2ik_[ik]]; + if((direct)&&(!irreducible)) return kvec_d_[ik]; + if((!direct)&&(irreducible)) return kvec_c_[ikibz2ik_[ik]]; + if((!direct)&&(!irreducible)) return kvec_c_[ik]; + return std::vector(); + } + std::vector> kvec_c_; + std::vector> kvec_d_; + std::vector ik2ikibz_; // mapping from kpoint index to irreducible kpoint index + std::vector ikibz2ik_; // mapping from irreducible kpoint index to kpoint index +// <<< REFACTORING K_Vectors functions above + private: int nspin; bool kc_done; @@ -65,9 +223,13 @@ class K_Vectors // step 1 : generate kpoints bool read_kpoints(const std::string &fn); // return 0: something wrong. - void Monkhorst_Pack(const int *nmp_in,const double *koffset_in,const int tipo); - double Monkhorst_Pack_formula( const int &k_type, const double &offset, - const int& n, const int &dim); + void monkhorst_pack(const int *nmp_in, + const double *koffset_in, + const int tipo); + double Monkhorst_Pack_formula(const int &k_type, + const double &offset, + const int& n, + const int &dim); // step 2 : set both kvec and kved; normalize weight void update_use_ibz( void ); diff --git a/source/module_cell/klist_mpi.cpp b/source/module_cell/klist_mpi.cpp new file mode 100644 index 0000000000..cd4111c32d --- /dev/null +++ b/source/module_cell/klist_mpi.cpp @@ -0,0 +1,9 @@ +/* +Note: on the plan of removal of GlobalC::parallel_kpoints +it is totally unreasonable to have such a class, it is very ridiculous that kpoints itself +cannot divide the MPI comm world. +Path: source/module_cell/parallel_kpoints.h, after refactor this class will be removed and +the functions will be moved to module_cell/klist_mpi.cpp + +parallel_kpoints is instantiated in global.cpp, it's life span is presently unknown. +*/ diff --git a/source/module_cell/test/klist_test.cpp b/source/module_cell/test/klist_test.cpp index 54bfa5e358..68f775b961 100644 --- a/source/module_cell/test/klist_test.cpp +++ b/source/module_cell/test/klist_test.cpp @@ -227,7 +227,7 @@ TEST_F(KlistTest, MP) kv->koffset[2] = 0; kv->nspin = 1; int k_type = 0; - kv->Monkhorst_Pack(kv->nmp,kv->koffset,k_type); + kv->monkhorst_pack(kv->nmp,kv->koffset,k_type); /* std::cout << " " <nkstot;ik++) @@ -244,7 +244,7 @@ TEST_F(KlistTest, MP) kv1->koffset[2] = 1; kv1->nspin = 1; k_type = 1; - kv1->Monkhorst_Pack(kv1->nmp,kv1->koffset,k_type); + kv1->monkhorst_pack(kv1->nmp,kv1->koffset,k_type); //std::cout << " " <nkstot;ik++) { @@ -775,4 +775,269 @@ TEST_F(KlistTest, IbzKpointIsMP) remove("tmp_klist_4"); } +TEST_F(KlistTest, KspacingTompmesh) +{ + std::vector> bvecs(3); + bvecs[0] = std::vector{1.2345,2.3456,3.4567}; + bvecs[1] = std::vector{4.5678,5.6789,6.7890}; + bvecs[2] = std::vector{7.8901,8.9012,9.0123}; + double lat0 = 1.8897261254578281; + std::vector kspacing = {0.1,0.2,0.3}; + std::vector result = kv->kspacing_tompmesh(bvecs,lat0,kspacing); + EXPECT_EQ(result.size(),3); +} + +TEST_F(KlistTest, WriteAbacusKline) +{ + std::vector> kvecs = { + {0.0,0.0,0.0}, + {0.1,0.1,0.1}, + {0.2,0.2,0.2}, + {0.3,0.3,0.3} + }; + std::vector nks = {10, 1, 10, 1}; + std::string result_d = kv->write_abacus_kline("Direct", kvecs, nks); + std::string result_c = kv->write_abacus_kline("Cartesian", kvecs, nks); + EXPECT_THAT(result_d, testing::HasSubstr("Line_Direct")); + EXPECT_THAT(result_d, testing::HasSubstr(" 0.0000000000 0.0000000000 0.0000000000 10")); + EXPECT_THAT(result_d, testing::HasSubstr(" 0.3000000000 0.3000000000 0.3000000000 1")); + EXPECT_THAT(result_c, testing::HasSubstr("Line_Cartesian")); + EXPECT_THAT(result_c, testing::HasSubstr(" 0.0000000000 0.0000000000 0.0000000000 10")); + EXPECT_THAT(result_c, testing::HasSubstr(" 0.3000000000 0.3000000000 0.3000000000 1")); +} + +TEST_F(KlistTest, WriteAbacusMpkmesh) +{ + std::string result = kv->write_abacus_mpkmesh("Gamma", {10, 10, 10}, {0, 0, 0}); + EXPECT_THAT(result, testing::HasSubstr("Gamma")); + EXPECT_THAT(result, testing::HasSubstr("10 10 10 0 0 0")); +} + +TEST_F(KlistTest, SyncKvecBetweencd) +{ + kv->nspin = 1; + kv->nkstot = 2; + kv->nks = 2; + kv->renew(kv->nkstot); + kv->kvec_d[0].x = 0.0; + kv->kvec_d[0].y = 0.0; + kv->kvec_d[0].z = 0.0; + kv->kvec_d[1].x = 0.1; + kv->kvec_d[1].y = 0.1; + kv->kvec_d[1].z = 0.1; + kv->kvec_c[0].x = 1.0; + kv->kvec_c[0].y = 1.0; + kv->kvec_c[0].z = 1.0; + kv->kvec_c[1].x = 1.1; + kv->kvec_c[1].y = 1.1; + kv->kvec_c[1].z = 1.1; + ModuleBase::Matrix3 G = {1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0}; + ModuleBase::Matrix3 R = {1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0}; + kv->sync_kvec_betweencd(true, R); + EXPECT_DOUBLE_EQ(kv->kvec_c[0].x, 0.0); + EXPECT_DOUBLE_EQ(kv->kvec_c[0].y, 0.0); + EXPECT_DOUBLE_EQ(kv->kvec_c[0].z, 0.0); + EXPECT_DOUBLE_EQ(kv->kvec_c[1].x, 0.1); + EXPECT_DOUBLE_EQ(kv->kvec_c[1].y, 0.1); + EXPECT_DOUBLE_EQ(kv->kvec_c[1].z, 0.1); + kv->kvec_c[0].x = 1.0; + kv->kvec_c[0].y = 1.0; + kv->kvec_c[0].z = 1.0; + kv->kvec_c[1].x = 1.1; + kv->kvec_c[1].y = 1.1; + kv->kvec_c[1].z = 1.1; + kv->sync_kvec_betweencd(false, G); + EXPECT_DOUBLE_EQ(kv->kvec_d[0].x, 1.0); + EXPECT_DOUBLE_EQ(kv->kvec_d[0].y, 1.0); + EXPECT_DOUBLE_EQ(kv->kvec_d[0].z, 1.0); + EXPECT_DOUBLE_EQ(kv->kvec_d[1].x, 1.1); + EXPECT_DOUBLE_EQ(kv->kvec_d[1].y, 1.1); + EXPECT_DOUBLE_EQ(kv->kvec_d[1].z, 1.1); +} + +TEST_F(KlistTest, SyncKvecBetweenspin) +{ + kv->nspin = 1; + kv->nkstot = 2; + kv->nks = 2; + kv->renew(kv->nkstot); + kv->kvec_d[0].x = 0.0; + kv->kvec_d[0].y = 0.0; + kv->kvec_d[0].z = 0.0; + kv->kvec_d[1].x = 0.1; + kv->kvec_d[1].y = 0.1; + kv->kvec_d[1].z = 0.1; + kv->kvec_c[0].x = 1.0; + kv->kvec_c[0].y = 1.0; + kv->kvec_c[0].z = 1.0; + kv->kvec_c[1].x = 1.1; + kv->kvec_c[1].y = 1.1; + kv->kvec_c[1].z = 1.1; + kv->sync_kvec_betweenspin(2); + EXPECT_EQ(kv->kvec_c.size(), 4); + EXPECT_EQ(kv->kvec_d.size(), 4); + for(int i=0;i<2;i++) + { + EXPECT_DOUBLE_EQ(kv->kvec_c[i].x, kv->kvec_c[i+2].x); + EXPECT_DOUBLE_EQ(kv->kvec_c[i].y, kv->kvec_c[i+2].y); + EXPECT_DOUBLE_EQ(kv->kvec_c[i].z, kv->kvec_c[i+2].z); + EXPECT_DOUBLE_EQ(kv->kvec_d[i].x, kv->kvec_d[i+2].x); + EXPECT_DOUBLE_EQ(kv->kvec_d[i].y, kv->kvec_d[i+2].y); + EXPECT_DOUBLE_EQ(kv->kvec_d[i].z, kv->kvec_d[i+2].z); + } +} + +TEST_F(KlistTest, InterpolateKnodes) +{ + std::vector> knodes = { + {0.0,0.0,0.0}, + {0.1,0.1,0.1}, + {0.2,0.2,0.2}, + {0.3,0.3,0.3} + }; + std::vector nks = {10, 1, 10, 1}; + std::vector> kvec; + std::vector kseg_ids; + K_Vectors::interpolate_knodes(knodes, nks, kvec, kseg_ids, kv->nkstot, kv->wk); + EXPECT_EQ(kvec.size(), 22); + std::vector> kvec_ref; + for(int i=0;i<11;i++) + { + kvec_ref.push_back({i*0.1/10, i*0.1/10, i*0.1/10}); + } + for(int i=0;i<11;i++) + { + kvec_ref.push_back({i*0.1/10 + 0.2, i*0.1/10 + 0.2, i*0.1/10 + 0.2}); + } + EXPECT_EQ(kseg_ids.size(), 22); + std::vector kseg_ids_ref = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + for(int i=0;i<22;i++) + { + EXPECT_DOUBLE_EQ(kvec[i].x, kvec_ref[i].x); + EXPECT_DOUBLE_EQ(kvec[i].y, kvec_ref[i].y); + EXPECT_DOUBLE_EQ(kvec[i].z, kvec_ref[i].z); + EXPECT_EQ(kseg_ids[i], kseg_ids_ref[i]); + } +} + +TEST_F(KlistTest, ReadAbacusKpt) +{ + std::string k_file = "./support/KPT"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 8*8*8); + EXPECT_EQ(kv->kvec_d.size(), 8*8*8); + EXPECT_EQ(kv->kvec_c.size(), 8*8*8); // but does not have values + EXPECT_TRUE(kv->kd_done); + EXPECT_FALSE(kv->kc_done); + EXPECT_TRUE(kv->is_mp); +} + +TEST_F(KlistTest, ReadAbacusKpt1) +{ + std::string k_file = "./support/KPT1"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 8*8*8); + EXPECT_EQ(kv->kvec_d.size(), 8*8*8); + EXPECT_EQ(kv->kvec_c.size(), 8*8*8); // but does not have values + EXPECT_TRUE(kv->kd_done); + EXPECT_FALSE(kv->kc_done); + EXPECT_TRUE(kv->is_mp); +} + +TEST_F(KlistTest, ReadAbacusKpt2) +{ + std::string k_file = "./support/KPT2"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 122); + EXPECT_EQ(kv->kvec_d.size(), 122); + EXPECT_EQ(kv->kvec_c.size(), 0); + EXPECT_TRUE(kv->kd_done); + EXPECT_FALSE(kv->kc_done); + EXPECT_FALSE(kv->is_mp); + + EXPECT_EQ(kv->kl_segids.size(), 122); + std::vector kseg_ids_ref; + for(int i = 0; i <= 100; i++) + { + kseg_ids_ref.push_back(0); + } + for(int i = 101; i <= 121; i++) + { + kseg_ids_ref.push_back(1); + } + for(int i = 0; i < 122; i++) + { + EXPECT_EQ(kv->kl_segids[i], kseg_ids_ref[i]); + } +} + +TEST_F(KlistTest, ReadAbacusKpt4) +{ + std::string k_file = "./support/KPT4"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 5); + EXPECT_EQ(kv->kvec_d.size(), 0); + EXPECT_EQ(kv->kvec_c.size(), 5); + EXPECT_FALSE(kv->kd_done); + EXPECT_TRUE(kv->kc_done); + EXPECT_FALSE(kv->is_mp); + EXPECT_EQ(kv->kvec_c[0].x, 0.0); EXPECT_EQ(kv->kvec_c[0].y, 0.0); EXPECT_EQ(kv->kvec_c[0].z, 0.0); + EXPECT_EQ(kv->kvec_c[1].x, 0.0); EXPECT_EQ(kv->kvec_c[1].y, 0.0); EXPECT_EQ(kv->kvec_c[1].z, 1.0); + EXPECT_EQ(kv->kvec_c[2].x, 0.5); EXPECT_EQ(kv->kvec_c[2].y, 0.0); EXPECT_EQ(kv->kvec_c[2].z, 1.0); + EXPECT_EQ(kv->kvec_c[3].x, 0.75); EXPECT_EQ(kv->kvec_c[3].y, 0.75); EXPECT_EQ(kv->kvec_c[3].z, 0.0); + EXPECT_EQ(kv->kvec_c[4].x, 0.5); EXPECT_EQ(kv->kvec_c[4].y, 0.5); EXPECT_EQ(kv->kvec_c[4].z, 0.5); +} + +TEST_F(KlistTest, ReadAbacusKpt5) +{ + /* TestCase line_cartesian */ + std::string k_file = "./support/KPT5"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 51); + EXPECT_EQ(kv->kvec_d.size(), 0); + EXPECT_EQ(kv->kvec_c.size(), 51); + EXPECT_FALSE(kv->kd_done); + EXPECT_TRUE(kv->kc_done); + EXPECT_FALSE(kv->is_mp); + std::vector kseg_ids_ref(51, 0); + for(int i = 0; i < 51; i++) + { + EXPECT_EQ(kv->kl_segids[i], kseg_ids_ref[i]); + } +} + +TEST_F(KlistTest, ReadAbacusKpt6) +{ + std::string k_file = "./support/KPT6"; + kv->nspin = 1; + kv->read_abacus_kpt(k_file); + EXPECT_EQ(kv->nkstot, 6); + EXPECT_EQ(kv->kvec_d.size(), 6); + EXPECT_EQ(kv->kvec_c.size(), 0); + EXPECT_TRUE(kv->kd_done); + EXPECT_FALSE(kv->kc_done); + EXPECT_FALSE(kv->is_mp); + EXPECT_EQ(kv->kvec_d[0].x, 0.0); EXPECT_EQ(kv->kvec_d[0].y, 0.0); EXPECT_EQ(kv->kvec_d[0].z, 0.0); + EXPECT_EQ(kv->kvec_d[1].x, 0.0); EXPECT_EQ(kv->kvec_d[1].y, 0.0); EXPECT_EQ(kv->kvec_d[1].z, 1.0); + EXPECT_EQ(kv->kvec_d[2].x, 0.5); EXPECT_EQ(kv->kvec_d[2].y, 0.0); EXPECT_EQ(kv->kvec_d[2].z, 1.0); + EXPECT_EQ(kv->kvec_d[3].x, 0.75); EXPECT_EQ(kv->kvec_d[3].y, 0.75); EXPECT_EQ(kv->kvec_d[3].z, 0.0); + EXPECT_EQ(kv->kvec_d[4].x, 0.5); EXPECT_EQ(kv->kvec_d[4].y, 0.5); EXPECT_EQ(kv->kvec_d[4].z, 0.5); + EXPECT_EQ(kv->kvec_d[5].x, 0.0); EXPECT_EQ(kv->kvec_d[5].y, 0.0); EXPECT_EQ(kv->kvec_d[5].z, 0.0); +} + +TEST_F(KlistTest, BuildKpt) +{ + +} + #undef private diff --git a/source/module_hamilt_lcao/module_deepks/test/klist.h b/source/module_hamilt_lcao/module_deepks/test/klist.h index e4fa22b0d7..3a1a8c4e90 100644 --- a/source/module_hamilt_lcao/module_deepks/test/klist.h +++ b/source/module_hamilt_lcao/module_deepks/test/klist.h @@ -51,7 +51,7 @@ class K_Vectors bool &GAMMA_ONLY_LOCAL, std::ofstream &ofs_warning, std::ofstream &ofs_running); - void Monkhorst_Pack(const int *nmp_in,const double *koffset_in,const int tipo); + void monkhorst_pack(const int *nmp_in,const double *koffset_in,const int tipo); double Monkhorst_Pack_formula( const int &k_type, const double &offset, const int& n, const int &dim); diff --git a/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp b/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp index f08ae19065..5c984e0856 100644 --- a/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp +++ b/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp @@ -184,7 +184,7 @@ namespace Test_Deepks ifk >> nmp[0] >> nmp[1] >> nmp[2]; ifk >> koffset[0] >> koffset[1] >> koffset[2]; - this->Monkhorst_Pack(nmp, koffset, k_type); + this->monkhorst_pack(nmp, koffset, k_type); } else if (nkstot > 0) { @@ -396,7 +396,7 @@ namespace Test_Deepks } //add by dwan - void K_Vectors::Monkhorst_Pack(const int *nmp_in, const double *koffset_in, const int k_type) + void K_Vectors::monkhorst_pack(const int *nmp_in, const double *koffset_in, const int k_type) { const int mpnx = nmp_in[0]; const int mpny = nmp_in[1];