Skip to content

Commit d4555d4

Browse files
authored
Merge pull request #875 from Qianruipku/SDFT
<refactor>
2 parents 7e42ed7 + fe71dda commit d4555d4

29 files changed

+744
-144
lines changed

source/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ VPATH=./src_global\
1717
:./module_deepks\
1818
:./module_xc\
1919
:./module_esolver\
20+
:./module_surchem\
2021
:./src_pw\
2122
:./src_lcao\
2223
:./src_ions\

source/Makefile.Objects

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ sto_iter.o\
6363
sto_hchi.o\
6464
sto_che.o\
6565

66+
OBJS_SURCHEM=cal_epsilon.o\
67+
cal_pseudo.o\
68+
cal_totn.o\
69+
cal_vcav.o\
70+
cal_vel.o\
71+
corrected_energy.o\
72+
H_correction_pw.o\
73+
minimize_cg.o
74+
6675
OBJS_TOOLS=complexarray.o\
6776
complexmatrix.o \
6877
realarray.o \
@@ -251,6 +260,7 @@ OBJS_FIRST_PRINCIPLES=$(OBJS_MAIN)\
251260
$(OBJS_PW)\
252261
$(OBJS_LCAO)\
253262
$(OBJS_ESOLVER)\
263+
$(OBJS_SURCHEM)\
254264
$(OBJS_XC)\
255265
charge.o \
256266
charge_mixing.o \

source/Makefile.system

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ FFTW_LIB_DIR = ${FFTW_DIR}/lib
1717
#FFTW_LIB_DIR = $(MKLROOT)/lib/intel64
1818
FFTW_LIB = -L${FFTW_LIB_DIR} -lfftw3 -Wl,-rpath=${FFTW_LIB_DIR}
1919

20-
ELPA_INCLUDE_DIR = ${ELPA_DIR}/include/elpa-2021.11.002
2120
ELPA_LIB_DIR = ${ELPA_DIR}/lib
2221
# comment out by mohan 2021-02-06
2322
#ELPA_LIB = -L${ELPA_LIB_DIR} -lelpa_openmp -Wl,-rpath=${ELPA_LIB_DIR}

source/Makefile.vars

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ CPLUSPLUS = icpc
33
CPLUSPLUS_MPI = mpiicpc
44

55
LAPACK_DIR = $(MKLROOT)
6-
# LAPACK_DIR = /public/software/parallel_studio_xe_2019_update3/compilers_and_libraries_2019/linux/mkl
76

8-
FFTW_DIR = /public/software/fftw-3.3.8
7+
FFTW_DIR = /public/software/fftw_3.3.8
98

10-
ELPA_DIR = /public/software/elpa-gitlab
9+
ELPA_DIR = /public/software/elpa_21.05.002
10+
ELPA_INCLUDE_DIR = ${ELPA_DIR}/include/elpa-2021.05.002
1111

12-
CEREAL_DIR = /public/software/cereal-1.3.2
12+
CEREAL_DIR = /public/software/cereal
1313

1414
# LIBXC_DIR = /public/software/libxc-5.0.0
1515

source/input.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ void Input::Default(void)
252252
printe = 100; // must > 0
253253
init_chg = "atomic";
254254
chg_extrap = "atomic"; // xiaohui modify 2015-02-01
255+
out_freq_elec = 0;
256+
out_freq_ion = 0;
255257
out_chg = 0;
256258
out_dm = 0;
257259

@@ -932,6 +934,14 @@ bool Input::Read(const std::string &fn)
932934
{
933935
read_value(ifs, chg_extrap); // xiaohui modify 2015-02-01
934936
}
937+
else if (strcmp("out_freq_elec", word) == 0)
938+
{
939+
read_value(ifs, out_freq_elec);
940+
}
941+
else if (strcmp("out_freq_ion", word) == 0)
942+
{
943+
read_value(ifs, out_freq_ion);
944+
}
935945
else if (strcmp("out_chg", word) == 0)
936946
{
937947
read_value(ifs, out_chg);
@@ -1914,6 +1924,8 @@ void Input::Bcast()
19141924
Parallel_Common::bcast_int(printe);
19151925
Parallel_Common::bcast_string(init_chg);
19161926
Parallel_Common::bcast_string(chg_extrap); // xiaohui modify 2015-02-01
1927+
Parallel_Common::bcast_int(out_freq_elec);
1928+
Parallel_Common::bcast_int(out_freq_ion);
19171929
Parallel_Common::bcast_int(out_chg);
19181930
Parallel_Common::bcast_int(out_dm);
19191931

source/input.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ class Input
197197
int mem_saver; // 1: save psi when nscf calculation.
198198

199199
int printe; // mohan add 2011-03-16
200-
int out_chg; // output charge density.
200+
int out_freq_elec; // the frequency ( >= 0) of electronic iter to output charge density and wavefunction. 0: output only when converged
201+
int out_freq_ion; // the frequency ( >= 0 ) of ionic step to output charge density and wavefunction. 0: output only when ion steps are finished
202+
int out_chg; // output charge density. 0: no; 1: yes
201203
int out_dm; // output density matrix.
202204
int out_pot; // yes or no
203205
int out_wfc_pw; // 0: no; 1: txt; 2: dat

source/input_conv.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ void Input_Conv::Convert(void)
423423
//----------------------------------------------------------
424424
// wavefunction / charge / potential / (2/4)
425425
//----------------------------------------------------------
426+
GlobalV::OUT_FREQ_ELEC = INPUT.out_freq_elec;
427+
GlobalV::OUT_FREQ_ION = INPUT.out_freq_ion;
426428
GlobalC::pot.init_chg = INPUT.init_chg;
427429
GlobalC::pot.chg_extrap = INPUT.chg_extrap; // xiaohui modify 2015-02-01
428430
GlobalC::CHR.out_chg = INPUT.out_chg;

source/module_base/global_variable.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ double PRESS3 = 0.0;
4343
double PRESSURE = 0.0;
4444
std::string RELAX_METHOD = "bfgs";
4545
std::string OUT_LEVEL = "ie";
46+
int OUT_FREQ_ELEC = 0;
47+
int OUT_FREQ_ION = 0;
4648
int RELAX_NMAX = 20;
4749
int MD_NSTEP = 20;
4850
int SCF_NMAX = 50;

source/module_base/global_variable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ extern double PRESS3;
4444
extern double PRESSURE;
4545
extern std::string RELAX_METHOD;
4646
extern std::string OUT_LEVEL;
47+
extern int OUT_FREQ_ELEC;
48+
extern int OUT_FREQ_ION;
4749

4850
extern int RELAX_NMAX; // 8.3
4951
extern int SCF_NMAX; // 8.4

source/module_esolver/esolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
namespace ModuleESolver
99
{
10-
void ESolver:: printag()
10+
void ESolver:: printname()
1111
{
12-
std::cout<<tag<<std::endl;
12+
std::cout<<classname<<std::endl;
1313
}
1414

1515

0 commit comments

Comments
 (0)