Skip to content

Commit d48b1b4

Browse files
committed
prepare for PR
2 parents edfefb9 + e7adc07 commit d48b1b4

File tree

47 files changed

+726
-1564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+726
-1564
lines changed

source/Makefile.Objects

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ OBJS_LCAO=evolve_elec.o\
584584
LCAO_set_fs.o\
585585
LCAO_set_st.o\
586586
LCAO_nl_mu.o\
587-
LCAO_nnr.o\
588587
LCAO_set_zero.o\
589588
LCAO_allocate.o\
590589
LCAO_set_mat2d.o\

source/module_base/module_mixing/test/mixing_test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#ifdef _OPENMP
12
#include <omp.h>
3+
#endif
24

35
#include "../broyden_mixing.h"
46
#include "../plain_mixing.h"
@@ -151,7 +153,9 @@ class Mixing_Test : public testing::Test
151153

152154
TEST_F(Mixing_Test, BroydenSolveLinearEq)
153155
{
156+
#ifdef _OPENMP
154157
omp_set_num_threads(1);
158+
#endif
155159
init_method("broyden");
156160
std::vector<double> x_in = xd_ref;
157161
std::vector<double> x_out(3);
@@ -196,7 +200,9 @@ TEST_F(Mixing_Test, BroydenSolveLinearEq)
196200

197201
TEST_F(Mixing_Test, PulaySolveLinearEq)
198202
{
203+
#ifdef _OPENMP
199204
omp_set_num_threads(1);
205+
#endif
200206
init_method("pulay");
201207
std::vector<double> x_in = xd_ref;
202208
std::vector<double> x_out(3);
@@ -242,7 +248,9 @@ TEST_F(Mixing_Test, PulaySolveLinearEq)
242248

243249
TEST_F(Mixing_Test, PlainSolveLinearEq)
244250
{
251+
#ifdef _OPENMP
245252
omp_set_num_threads(1);
253+
#endif
246254
init_method("plain");
247255
std::vector<double> x_in = xd_ref;
248256
std::vector<double> x_out(3);

source/module_elecstate/test/charge_mixing_test.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#include "module_basis/module_pw/pw_basis.h"
1111
#include "module_hamilt_general/module_xc/xc_functional.h"
1212
#undef private
13+
14+
#ifdef _OPENMP
1315
#include <omp.h>
16+
#endif
1417

1518
int FUNC_TYPE = 1;
1619

@@ -116,7 +119,9 @@ class ChargeMixingTest : public ::testing::Test
116119

117120
TEST_F(ChargeMixingTest, SetMixingTest)
118121
{
122+
#ifdef _OPENMP
119123
omp_set_num_threads(1);
124+
#endif
120125
PARAM.input.nspin = 1;
121126
Charge_Mixing CMtest;
122127
CMtest.set_rhopw(&pw_basis, &pw_basis);
@@ -214,7 +219,9 @@ TEST_F(ChargeMixingTest, SetMixingTest)
214219

215220
TEST_F(ChargeMixingTest, InitMixingTest)
216221
{
222+
#ifdef _OPENMP
217223
omp_set_num_threads(1);
224+
#endif
218225
PARAM.input.nspin = 1;
219226
FUNC_TYPE = 1;
220227
Charge_Mixing CMtest;

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -938,24 +938,7 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
938938
}
939939
}
940940

941-
// 2.5) determine whether rdmft needs to get the initial value, added by jghan, 2024-10-25
942-
int one_step_exx = false;
943-
bool get_init_value_rdmft = false;
944-
if( iter == 1 ) get_init_value_rdmft = true; // the case without hybrid functionals
945941
#ifdef __EXX
946-
if( GlobalC::exx_info.info_global.cal_exx )
947-
{
948-
if( this->conv_esolver ) one_step_exx = true;
949-
// the case with hybrid functionals, calculate rdmft just after updateExx, cal once in one inner loop
950-
if( one_step_exx ) get_init_value_rdmft = true;
951-
else get_init_value_rdmft = false;
952-
}
953-
#endif
954-
955-
#ifdef __EXX
956-
957-
if( GlobalC::exx_info.info_global.cal_exx && this->conv_esolver ) one_step_exx = true;
958-
959942
// 3) save exx matrix
960943
if (PARAM.inp.calculation != "nscf")
961944
{
@@ -1037,23 +1020,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
10371020
{
10381021
GlobalC::dftu.initialed_locale = true;
10391022
}
1040-
1041-
// 7) rdmft, added by jghan, 2024-10-25
1042-
if ( PARAM.inp.rdmft == true && get_init_value_rdmft )
1043-
{
1044-
ModuleBase::matrix occ_number_ks(this->pelec->wg);
1045-
for(int ik=0; ik < occ_number_ks.nr; ++ik) { for(int inb=0; inb < occ_number_ks.nc; ++inb) occ_number_ks(ik, inb) /= this->kv.wk[ik]; }
1046-
this->rdmft_solver.update_elec(occ_number_ks, *(this->psi));
1047-
1048-
//initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
1049-
ModuleBase::matrix dE_dOccNum(this->pelec->wg.nr, this->pelec->wg.nc, true);
1050-
psi::Psi<TK> dE_dWfc(this->psi->get_nk(), this->psi->get_nbands(), this->psi->get_nbasis());
1051-
dE_dWfc.zero_out();
1052-
1053-
double Etotal_RDMFT = this->rdmft_solver.run(dE_dOccNum, dE_dWfc);
1054-
// break;
1055-
}
1056-
10571023
}
10581024

10591025
//------------------------------------------------------------------------------

source/module_esolver/set_matrix_grid.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void ESolver_KS_LCAO<TK, TR>::set_matrix_grid(Record_adj& ra)
6868
this->pw_rho->nplane,
6969
this->pw_rho->startz_current,
7070
GlobalC::ucell,
71+
GlobalC::GridD,
7172
dr_uniform,
7273
rcuts,
7374
psi_u,
@@ -85,14 +86,7 @@ void ESolver_KS_LCAO<TK, TR>::set_matrix_grid(Record_adj& ra)
8586
// and allocate the space for H(R) and S(R).
8687
// If k point is used here, allocate HlocR after atom_arrange.
8788
ra.for_2d(this->pv, PARAM.globalv.gamma_only_local, orb_.cutoffs());
88-
89-
if (!PARAM.globalv.gamma_only_local)
90-
{
91-
// need to first calculae lgd.
92-
// using GridT.init.
93-
this->GridT.cal_nnrg(&this->pv, orb_.cutoffs());
94-
}
95-
89+
9690
ModuleBase::timer::tick("ESolver_KS_LCAO", "set_matrix_grid");
9791
return;
9892
}

source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ if(ENABLE_LCAO)
2727
spar_hsr.cpp
2828
spar_st.cpp
2929
spar_u.cpp
30-
LCAO_nnr.cpp
3130
LCAO_set_fs.cpp
3231
LCAO_set_st.cpp
3332
LCAO_nl_mu.cpp

0 commit comments

Comments
 (0)