Skip to content

Commit 20267ef

Browse files
committed
add init parameter for construct in sto_func
1 parent d88f6f3 commit 20267ef

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

source/module_hamilt_pw/hamilt_stodft/sto_func.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ template <typename REAL>
77
Sto_Func<REAL>::Sto_Func()
88
{
99
this->tem = Occupy::gaussian_parameter;
10+
this->mu = static_cast<REAL>(0.0);
11+
this->t = static_cast<REAL>(0.0);
12+
this->sigma = static_cast<REAL>(0.0);
13+
this->targ_e = static_cast<REAL>(0.0);
1014
}
1115

1216
template <typename REAL>

source/module_hamilt_pw/hamilt_stodft/sto_func.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class Sto_Func
77
public:
88
Sto_Func();
99
~Sto_Func(){};
10-
REAL tem=0; // temperature
11-
REAL mu=0; // chemical potential
10+
REAL tem; // temperature
11+
REAL mu; // chemical potential
1212
REAL* Emin = nullptr;
1313
REAL* Emax = nullptr;
1414
void set_E_range(REAL* Emin_in, REAL* Emax_in);
@@ -25,14 +25,14 @@ class Sto_Func
2525
REAL nroot_mfd(REAL e);
2626

2727
public:
28-
REAL t=0;
28+
REAL t;
2929
REAL ncos(REAL e);
3030
REAL nsin(REAL e);
3131
REAL n_sin(REAL e);
3232

3333
public:
34-
REAL sigma=0;
35-
REAL targ_e=0;
34+
REAL sigma;
35+
REAL targ_e;
3636
REAL gauss(REAL e);
3737
REAL ngauss(REAL e);
3838
REAL nroot_gauss(REAL e);

0 commit comments

Comments
 (0)