Skip to content

Commit b8e0d85

Browse files
committed
move rho_tau_lcao to source_lcao
1 parent c446b3c commit b8e0d85

File tree

8 files changed

+72
-66
lines changed

8 files changed

+72
-66
lines changed

source/Makefile.Objects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ OBJS_ELECSTAT=elecstate.o\
232232
elecstate_pw.o\
233233
elecstate_pw_sdft.o\
234234
elecstate_pw_cal_tau.o\
235-
rho_tau_lcao.o\
236235
elecstate_op.o\
237236
efield.o\
238237
gatefield.o\
@@ -644,6 +643,7 @@ OBJS_LCAO=evolve_elec.o\
644643
LCAO_init_basis.o\
645644
setup_exx.o\
646645
setup_deepks.o\
646+
rho_tau_lcao.o\
647647
center2_orb.o\
648648
center2_orb-orb11.o\
649649
center2_orb-orb21.o\

source/source_estate/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ list(APPEND objects
88
elecstate_pw.cpp
99
elecstate_pw_sdft.cpp
1010
elecstate_pw_cal_tau.cpp
11-
rho_tau_lcao.cpp
1211
module_pot/gatefield.cpp
1312
module_pot/efield.cpp
1413
module_pot/H_Hartree_pw.cpp

source/source_estate/rho_tau_lcao.cpp

Lines changed: 0 additions & 45 deletions
This file was deleted.

source/source_estate/rho_tau_lcao.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

source/source_lcao/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ if(ENABLE_LCAO)
4242
LCAO_init_basis.cpp
4343
setup_exx.cpp
4444
setup_deepks.cpp
45+
rho_tau_lcao.cpp
4546
record_adj.cpp
4647
center2_orb.cpp
4748
center2_orb-orb11.cpp

source/source_lcao/module_hcontainer/hcontainer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H
2-
#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H
1+
#ifndef HCONTAINER_H
2+
#define HCONTAINER_H
33

44
#include "atom_pair.h"
55
#include "source_base/vector3.h"
@@ -507,4 +507,4 @@ class HContainer
507507

508508
} // namespace hamilt
509509

510-
#endif
510+
#endif
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include "rho_tau_lcao.h"
2+
#include "source_hamilt/module_xc/xc_functional.h"
3+
#include "source_lcao/module_gint/gint_interface.h"
4+
5+
void LCAO_domain::dm2rho(std::vector<hamilt::HContainer<double>*> &dmr,
6+
const int nspin,
7+
Charge* chg)
8+
{
9+
ModuleBase::TITLE("LCAO_domain", "dm2rho");
10+
ModuleBase::timer::tick("LCAO_domain", "dm2rho");
11+
12+
for (int is = 0; is < nspin; is++)
13+
{
14+
ModuleBase::GlobalFunc::ZEROS(chg->rho[is], chg->nrxx);
15+
}
16+
17+
ModuleGint::cal_gint_rho(dmr, nspin, chg->rho);
18+
19+
chg->renormalize_rho();
20+
21+
// symmetrize of charge density should be here, mohan 20251023
22+
23+
ModuleBase::timer::tick("LCAO_domain", "dm2rho");
24+
return;
25+
}
26+
27+
28+
void LCAO_domain::dm2tau(std::vector<hamilt::HContainer<double>*> &dmr,
29+
const int nspin,
30+
Charge* chg)
31+
{
32+
ModuleBase::TITLE("LCAO_domain", "dm2tau");
33+
ModuleBase::timer::tick("LCAO_domain", "dm2tau");
34+
35+
if (XC_Functional::get_ked_flag())
36+
{
37+
for (int is = 0; is < nspin; is++)
38+
{
39+
ModuleBase::GlobalFunc::ZEROS(chg->kin_r[is], chg->nrxx);
40+
}
41+
ModuleGint::cal_gint_tau(dmr, nspin, chg->kin_r);
42+
}
43+
44+
ModuleBase::timer::tick("LCAO_domain", "dm2tau");
45+
}
46+
47+

source/source_lcao/rho_tau_lcao.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef RHO_TAU_LCAO_H
2+
#define RHO_TAU_LCAO_H
3+
4+
#include "source_lcao/module_hcontainer/hcontainer.h"
5+
#include "source_estate/module_charge/charge.h"
6+
7+
// generate charge density from different basis or methods
8+
namespace LCAO_domain
9+
{
10+
void dm2rho(std::vector<hamilt::HContainer<double>*> &dmr,
11+
const int nspin,
12+
Charge* chg);
13+
14+
void dm2tau(std::vector<hamilt::HContainer<double>*> &dmr,
15+
const int nspin,
16+
Charge* chg);
17+
18+
}
19+
20+
#endif

0 commit comments

Comments
 (0)