Skip to content

Commit 6b2afdc

Browse files
committed
Convert static function to ordinary function.
1 parent 5dbe07a commit 6b2afdc

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed

source/module_surchem/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
add_library(
22
surchem
33
OBJECT
4+
surchem.cpp
45
H_correction_pw.cpp
56
cal_epsilon.cpp
67
cal_pseudo.cpp

source/module_surchem/cal_pseudo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "surchem.h"
22

3-
atom_in surchem::GetAtom;
3+
// atom_in surchem::GetAtom;
44

55
void surchem::gauss_charge(const UnitCell &cell, PW_Basis &pwb, complex<double> *N)
66
{

source/module_surchem/cal_vcav.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void shape_gradn(const complex<double> *PS_TOTN, PW_Basis &pw, double *eprime)
7373
delete[] PS_TOTN_real;
7474
}
7575

76-
void createcavity(const UnitCell &ucell, PW_Basis &pwb, const complex<double> *PS_TOTN, double *vwork)
76+
void surchem::createcavity(const UnitCell &ucell, PW_Basis &pwb, const complex<double> *PS_TOTN, double *vwork)
7777
{
7878
ModuleBase::Vector3<double> *nablan = new ModuleBase::Vector3<double>[pwb.nrxx];
7979
ModuleBase::GlobalFunc::ZEROS(nablan, pwb.nrxx);

source/module_surchem/surchem.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include "surchem.h"
2+
3+
surchem::surchem()
4+
{
5+
6+
}
7+
8+
surchem::~surchem()
9+
{
10+
11+
}

source/module_surchem/surchem.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,45 @@ class surchem
1717
surchem();
1818
~surchem();
1919

20-
static atom_in GetAtom;
20+
atom_in GetAtom;
2121

22-
static void cal_epsilon(PW_Basis &pwb, const double *PS_TOTN_real, double *epsilon, double *epsilon0);
22+
void cal_epsilon(PW_Basis &pwb, const double *PS_TOTN_real, double *epsilon, double *epsilon0);
2323

24-
static void cal_pseudo(const UnitCell &cell,
24+
void cal_pseudo(const UnitCell &cell,
2525
PW_Basis &pwb,
2626
const complex<double> *Porter_g,
2727
complex<double> *PS_TOTN);
2828

29-
static void gauss_charge(const UnitCell &cell, PW_Basis &pwb, complex<double> *N);
29+
void gauss_charge(const UnitCell &cell, PW_Basis &pwb, complex<double> *N);
3030

31-
static void cal_totn(const UnitCell &cell,
31+
void cal_totn(const UnitCell &cell,
3232
PW_Basis &pwb,
3333
const complex<double> *Porter_g,
3434
complex<double> *N,
3535
complex<double> *TOTN);
3636

37-
static ModuleBase::matrix cal_vcav(const UnitCell &ucell, PW_Basis &pwb, const complex<double> *PS_TOTN, int nspin);
37+
void createcavity(const UnitCell &ucell, PW_Basis &pwb, const complex<double> *PS_TOTN, double *vwork);
3838

39-
static ModuleBase::matrix cal_vel(const UnitCell &cell,
39+
ModuleBase::matrix cal_vcav(const UnitCell &ucell, PW_Basis &pwb, const complex<double> *PS_TOTN, int nspin);
40+
41+
ModuleBase::matrix cal_vel(const UnitCell &cell,
4042
PW_Basis &pwb,
4143
const complex<double> *TOTN,
4244
const complex<double> *PS_TOTN,
4345
int nspin);
4446

45-
static double cal_Ael(const UnitCell &cell, PW_Basis &pwb, const double *TOTN_real, const double *delta_phi_R);
47+
double cal_Ael(const UnitCell &cell, PW_Basis &pwb, const double *TOTN_real, const double *delta_phi_R);
4648

47-
static double cal_Acav(const UnitCell &cell, PW_Basis &pwb, double qs);
49+
double cal_Acav(const UnitCell &cell, PW_Basis &pwb, double qs);
4850

49-
static void minimize_cg(const UnitCell &ucell,
51+
void minimize_cg(const UnitCell &ucell,
5052
PW_Basis &pwb,
5153
double *d_eps,
5254
const complex<double> *tot_N,
5355
complex<double> *phi,
5456
int &ncgsol);
5557

56-
static void Leps2(const UnitCell &ucell,
58+
void Leps2(const UnitCell &ucell,
5759
PW_Basis &pwb,
5860
complex<double> *phi,
5961
double *epsilon, // epsilon from shapefunc, dim=nrxx
@@ -63,7 +65,7 @@ class surchem
6365
complex<double> *phi_work,
6466
complex<double> *lp);
6567

66-
static ModuleBase::matrix v_correction(const UnitCell &cell,
68+
ModuleBase::matrix v_correction(const UnitCell &cell,
6769
PW_Basis &pwb,
6870
const int &nspin,
6971
const double *const *const rho);

source/src_pw/potential.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ ModuleBase::matrix Potential::v_of_rho(const double *const *const rho_in, const
358358
v += H_Hartree_pw::v_hartree(GlobalC::ucell, GlobalC::pw, GlobalV::NSPIN, rho_in);
359359
if (GlobalV::imp_sol)
360360
{
361-
v += surchem::v_correction(GlobalC::ucell, GlobalC::pw, GlobalV::NSPIN, rho_in);
361+
surchem tmp;
362+
v += tmp.v_correction(GlobalC::ucell, GlobalC::pw, GlobalV::NSPIN, rho_in);
362363
}
363364
}
364365

0 commit comments

Comments
 (0)