Skip to content

Commit 99823cf

Browse files
committed
save
1 parent 1aca681 commit 99823cf

File tree

5 files changed

+38
-55
lines changed

5 files changed

+38
-55
lines changed

abaInstall_HZWpara.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ rm -rf build
44
cmake -B build -DCMAKE_INSTALL_PREFIX=/public1/home/t6s000394/jghan/software/abacus-develop/rdmft-abacus/ -DCMAKE_CXX_COMPILER=icpx -DMPI_CXX_COMPILER=mpiicpc -DELPA_DIR=/public1/home/t6s000394/jghan/software/elpa-2021.11/ -DLibxc_DIR=/public1/home/t6s000394/jghan/software/libxc/ -DLIBRI_DIR=/public1/home/t6s000394/jghan/software/LibRI -DLIBCOMM_DIR=/public1/home/t6s000394/jghan/software/LibComm -DCEREAL_INCLUDE_DIR=/public1/home/t6s000394/jghan/software/cereal/cereal-1.3.2/include
55

66
#cmake --build build -j 52 2>job.err
7-
cmake --build build -j 8
7+
cmake --build build -j 16
88

99
cmake --install build

source/module_rdmft/cal_V_rdmft.cpp

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,40 @@
44
//==========================================================
55

66
#include "rdmft.h"
7+
#include "module_rdmft/rdmft_tools.h"
78

8-
// #ifdef __EXX
9-
// #include "module_ri/RI_2D_Comm.h"
10-
// #include "module_ri/Exx_LRI.h"
11-
// #endif
12-
// #include "module_hamilt_general/operator.h"
13-
// #include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
14-
// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h"
15-
// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h"
16-
// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h"
17-
// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h"
18-
// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h"
9+
#include "module_psi/psi.h"
10+
#include "module_elecstate/module_dm/cal_dm_psi.h"
1911

2012
namespace rdmft
2113
{
2214

2315

16+
17+
template <typename TK, typename TR>
18+
void RDMFT<TK, TR>::get_DM_XC(std::vector< std::vector<TK> >& DM_XC)
19+
{
20+
// get wk_funEta_wfc = wk*g(eta)*conj(wfc)
21+
psi::Psi<TK> wk_funEta_wfc(wfc);
22+
conj_psi(wk_funEta_wfc);
23+
occNum_MulPsi(ParaV, wk_fun_occNum, wk_funEta_wfc, 0);
24+
25+
// get the special DM_XC used in constructing V_exx_XC
26+
for(int ik=0; ik<wfc.get_nk(); ++ik)
27+
{
28+
// after this, be careful with wfc.get_pointer(), we can use &wfc(ik,inbn,inbs) instead
29+
wfc.fix_k(ik);
30+
wk_funEta_wfc.fix_k(ik);
31+
TK* DM_Kpointer = DM_XC[ik].data();
32+
#ifdef __MPI
33+
elecstate::psiMulPsiMpi(wk_funEta_wfc, wfc, DM_Kpointer, ParaV->desc_wfc, ParaV->desc);
34+
#else
35+
elecstate::psiMulPsi(wk_funEta_wfc, wfc, DM_Kpointer);
36+
#endif
37+
}
38+
}
39+
40+
2441
template <typename TK, typename TR>
2542
void RDMFT<TK, TR>::cal_V_TV()
2643
{
@@ -315,22 +332,8 @@ void RDMFT<TK, TR>::cal_V_XC()
315332

316333

317334

318-
319-
320-
321-
322-
323-
324-
325-
326-
327-
328-
329-
330-
331-
332-
333-
334-
335+
template class RDMFT<double, double>;
336+
template class RDMFT<std::complex<double>, double>;
337+
template class RDMFT<std::complex<double>, std::complex<double>>;
335338

336339
}

source/module_rdmft/rdmft.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "module_base/blas_connector.h"
99
#include "module_base/scalapack_connector.h"
1010
#include "module_base/timer.h"
11-
#include "module_psi/psi.h"
11+
// #include "module_psi/psi.h"
1212
#include "module_hamilt_pw/hamilt_pwdft/global.h"
1313

1414
// #include "module_elecstate/module_dm/cal_dm_psi.h"
@@ -209,30 +209,6 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
209209
}
210210

211211

212-
template <typename TK, typename TR>
213-
void RDMFT<TK, TR>::get_DM_XC(std::vector< std::vector<TK> >& DM_XC)
214-
{
215-
// get wk_funEta_wfc = wk*g(eta)*conj(wfc)
216-
psi::Psi<TK> wk_funEta_wfc(wfc);
217-
conj_psi(wk_funEta_wfc);
218-
occNum_MulPsi(ParaV, wk_fun_occNum, wk_funEta_wfc, 0);
219-
220-
// get the special DM_XC used in constructing V_exx_XC
221-
for(int ik=0; ik<wfc.get_nk(); ++ik)
222-
{
223-
// after this, be careful with wfc.get_pointer(), we can use &wfc(ik,inbn,inbs) instead
224-
wfc.fix_k(ik);
225-
wk_funEta_wfc.fix_k(ik);
226-
TK* DM_Kpointer = DM_XC[ik].data();
227-
#ifdef __MPI
228-
elecstate::psiMulPsiMpi(wk_funEta_wfc, wfc, DM_Kpointer, ParaV->desc_wfc, ParaV->desc);
229-
#else
230-
elecstate::psiMulPsi(wk_funEta_wfc, wfc, DM_Kpointer);
231-
#endif
232-
}
233-
}
234-
235-
236212
template <typename TK, typename TR>
237213
void RDMFT<TK, TR>::cal_Hk_Hpsi()
238214
{

source/module_rdmft/rdmft.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "module_parameter/parameter.h"
1111

12+
#include "module_psi/psi.h"
1213
#include "module_base/matrix.h"
1314
#include "module_cell/module_neighbor/sltk_grid_driver.h"
1415
#include "module_cell/unitcell.h"

source/module_rdmft/update_state_rdmft.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//==========================================================
55

66
#include "rdmft.h"
7+
#include "module_rdmft/rdmft_tools.h"
78
#include "module_elecstate/module_dm/cal_dm_psi.h"
89
#include "module_elecstate/module_dm/density_matrix.h"
910
#include "module_elecstate/module_charge/symmetry_rho.h"
@@ -189,7 +190,9 @@ void RDMFT<TK, TR>::update_occNumber(const ModuleBase::matrix& occ_number_in)
189190

190191

191192

192-
193+
template class RDMFT<double, double>;
194+
template class RDMFT<std::complex<double>, double>;
195+
template class RDMFT<std::complex<double>, std::complex<double>>;
193196

194197
}
195198

0 commit comments

Comments
 (0)