Skip to content

Commit ced3357

Browse files
committed
clang-format change.
1 parent 1158136 commit ced3357

File tree

4 files changed

+636
-664
lines changed

4 files changed

+636
-664
lines changed

source/source_lcao/module_deepks/test/LCAO_deepks_test.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,7 @@ void test_deepks<T>::check_pdm()
162162
template <typename T>
163163
void test_deepks<T>::check_descriptor(std::vector<torch::Tensor>& descriptor)
164164
{
165-
DeePKS_domain::cal_descriptor(ucell.nat,
166-
this->ld.deepks_param,
167-
this->ld.pdm,
168-
descriptor);
165+
DeePKS_domain::cal_descriptor(ucell.nat, this->ld.deepks_param, this->ld.pdm, descriptor);
169166
DeePKS_domain::check_descriptor(this->ld.deepks_param, ucell, "./", descriptor, 0);
170167
this->compare_with_ref("deepks_desc.dat", "descriptor_ref.dat");
171168
}
@@ -221,12 +218,7 @@ void test_deepks<T>::check_gvepsl(torch::Tensor& gdmepsl)
221218
std::vector<torch::Tensor> gevdm;
222219
DeePKS_domain::cal_gevdm(ucell.nat, this->ld.deepks_param, this->ld.pdm, gevdm);
223220
torch::Tensor gvepsl;
224-
DeePKS_domain::cal_gvepsl(ucell.nat,
225-
this->ld.deepks_param,
226-
gevdm,
227-
gdmepsl,
228-
gvepsl,
229-
0);
221+
DeePKS_domain::cal_gvepsl(ucell.nat, this->ld.deepks_param, gevdm, gdmepsl, gvepsl, 0);
230222
DeePKS_domain::check_tensor<double>(gvepsl, "gvepsl.dat", 0); // 0 for rank
231223
this->compare_with_ref("gvepsl.dat", "gvepsl_ref.dat");
232224
}
Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,69 @@
1-
///klist : adapted from klist from source_pw/module_pwdft
2-
///deals with k point sampling
1+
/// klist : adapted from klist from source_pw/module_pwdft
2+
/// deals with k point sampling
33

4-
#include "source_base/vector3.h"
4+
#include "source_base/global_function.h"
55
#include "source_base/matrix3.h"
66
#include "source_base/memory.h"
7-
#include "source_base/global_function.h"
8-
#include <iostream>
7+
#include "source_base/vector3.h"
8+
99
#include <fstream>
10+
#include <iostream>
1011

1112
namespace Test_Deepks
1213
{
1314
class K_Vectors
1415
{
15-
public:
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
16+
public:
17+
ModuleBase::Vector3<double>* kvec_c; // Cartesian coordinates of k points
18+
std::vector<ModuleBase::Vector3<double>> kvec_d; // Direct coordinates of k points
1919

20-
double *wk; // wk, weight of k points
20+
double* wk; // wk, weight of k points
2121

22-
int *isk; // distinguish spin up and down k points
22+
int* isk; // distinguish spin up and down k points
2323

24-
int nkstot; // total number of k points
24+
int nkstot; // total number of k points
2525

26-
int nmp[3]; // Number of Monhorst-Pack
26+
int nmp[3]; // Number of Monhorst-Pack
2727

2828
K_Vectors();
2929
~K_Vectors();
3030

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);
31+
void set(const std::string& k_file_name,
32+
const int& nspin,
33+
const ModuleBase::Matrix3& reciprocal_vec,
34+
const ModuleBase::Matrix3& latvec,
35+
bool& GAMMA_ONLY_LOCAL,
36+
std::ofstream& ofs_running,
37+
std::ofstream& ofs_warning);
3938

40-
private:
39+
private:
4140
int nspin;
4241
bool kc_done;
4342
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
43+
double koffset[3]; // used only in automatic k-points.
44+
std::string k_kword; // LiuXh add 20180619
45+
int k_nkstot; // LiuXh add 20180619
4746

4847
// 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);
48+
bool read_kpoints(const std::string& fn,
49+
bool& GAMMA_ONLY_LOCAL,
50+
std::ofstream& ofs_warning,
51+
std::ofstream& ofs_running);
52+
void Monkhorst_Pack(const int* nmp_in, const double* koffset_in, const int tipo);
53+
double Monkhorst_Pack_formula(const int& k_type, const double& offset, const int& n, const int& dim);
5754

5855
// 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 );
56+
void set_both_kvec(const ModuleBase::Matrix3& G, const ModuleBase::Matrix3& Rm, std::ofstream& ofs_running);
57+
void renew(const int& kpoint_number);
58+
void normalize_wk(const int& degspin);
6259

6360
// step 3 : *2 or *4 kpoints.
6461
// *2 for LSDA
6562
// *4 for non-collinear
66-
void set_kup_and_kdw(std::ofstream &ofs_running);
63+
void set_kup_and_kdw(std::ofstream& ofs_running);
6764

6865
// step 4
6966
// print k lists.
70-
void print_klists(std::ofstream &fn_running);
67+
void print_klists(std::ofstream& fn_running);
7168
};
72-
}
69+
} // namespace Test_Deepks

0 commit comments

Comments
 (0)