Skip to content

Commit c1c8d76

Browse files
committed
just save
1 parent 85c4833 commit c1c8d76

File tree

8 files changed

+44
-26
lines changed

8 files changed

+44
-26
lines changed

abaInstall_HZWpara.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ rm -r build
22

33
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
44

5-
cmake --build build -j 8 2>job.err
5+
cmake --build build -j 16 2>job.err
66

77
cmake --install build

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(const Input_para& inp, UnitCell
266266
{
267267
// rdmft_solver.init( this->UHM.GG, this->UHM.GK, this->orb_con.ParaV, ucell, this->kv, *(this->pelec),
268268
// GlobalV::DFT_FUNCTIONAL, GlobalV::rdmft_power_alpha);
269-
rdmft_solver.init( this->GG, this->GK, &(this->pv), ucell, this->kv, *(this->pelec),
270-
this->orb_, PARAM.inp.dft_functional, 1.0);
269+
rdmft_solver.init( this->GG, this->GK, this->pv, ucell, this->kv, *(this->pelec),
270+
this->orb_, two_center_bundle_, PARAM.inp.dft_functional, 1.0);
271271

272272
// the initialization and necessary calculations of these quantities have been completed in init()
273273
// rdmft_solver.update_ion(ucell, LM, *(this->pw_rho), GlobalC::ppcell.vloc, this->sf.strucFac, this->LOC);

source/module_hamilt_general/module_xc/xc_functional.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ int XC_Functional::func_type = 0;
1919
bool XC_Functional::use_libxc = true;
2020
double XC_Functional::hybrid_alpha = 0.25;
2121

22+
23+
// #include <xc.h>
2224
// added by jghan, 2024-10-10
2325
// std::map<xc_func_type, double> scaling_factor_xc = { {XC_GGA_X_ITYH, 1.0} };
2426
// std::map<xc_func_type, double> scaling_factor_xc;
2527
// scaling_factor_xc[XC_GGA_X_B88] = 1.0;
28+
std::map<int, double> scaling_factor_xc = { {XC_GGA_X_ITYH, 1.0} };
2629

2730
void XC_Functional::set_hybrid_alpha(const double alpha_in)
2831
{

source/module_hamilt_general/module_xc/xc_functional.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ class XC_Functional
8585
// added by jghan, 2024-07-07
8686
// as a scaling factor for different xc-functionals
8787
// static std::vector<double> scaling_factor_xc;
88-
static std::map<xc_func_type, double> scaling_factor_xc;
88+
// static std::map<xc_func_type, double> scaling_factor_xc;
89+
static std::map<int, double> scaling_factor_xc;
8990

9091
public:
9192
static std::vector<int> get_func_id() { return func_id; }

source/module_hamilt_general/module_xc/xc_functional_libxc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace XC_Functional_Libxc
4343
const double &omega, // volume of cell
4444
const double tpiba,
4545
const Charge* const chr, // charge density
46-
const std::map<xc_func_type, double>* scaling_factor = nullptr); // added by jghan, 2024-10-10
46+
const std::map<int, double>* scaling_factor = nullptr); // added by jghan, 2024-10-10
4747

4848
// for mGGA functional
4949
extern std::tuple<double,double,ModuleBase::matrix,ModuleBase::matrix> v_xc_meta(

source/module_hamilt_general/module_xc/xc_functional_libxc_vxc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ std::tuple<double,double,ModuleBase::matrix> XC_Functional_Libxc::v_xc_libxc( /
1919
const double &omega, // volume of cell
2020
const double tpiba,
2121
const Charge* const chr,
22-
const std::map<xc_func_type, double>* scaling_factor)
22+
const std::map<int, double>* scaling_factor)
2323
{
2424
ModuleBase::TITLE("XC_Functional_Libxc","v_xc_libxc");
2525
ModuleBase::timer::tick("XC_Functional_Libxc","v_xc_libxc");
@@ -115,7 +115,7 @@ std::tuple<double,double,ModuleBase::matrix> XC_Functional_Libxc::v_xc_libxc( /
115115
if( scaling_factor == nullptr ) ;
116116
else
117117
{
118-
auto pair_factor = scaling_factor->find(func);
118+
auto pair_factor = scaling_factor->find(func.info->number);
119119
if( pair_factor != scaling_factor->end() ) factor = pair_factor->second;
120120
}
121121

source/module_rdmft/rdmft.cpp

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,36 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
111111
// create desc[] and something about MPI to Eij(nbands*nbands)
112112
std::ofstream ofs_running;
113113
std::ofstream ofs_warning;
114-
para_Eij.set_block_size(GlobalV::NB2D);
115-
para_Eij.set_proc_dim(GlobalV::DSIZE);
116-
para_Eij.comm_2D = ParaV->comm_2D;
117-
para_Eij.blacs_ctxt = ParaV->blacs_ctxt;
118-
para_Eij.set_local2global( GlobalV::NBANDS, GlobalV::NBANDS, ofs_running, ofs_warning );
119-
para_Eij.set_desc( GlobalV::NBANDS, GlobalV::NBANDS, para_Eij.get_row_size(), false );
114+
// para_Eij.set_block_size(GlobalV::NB2D);
115+
// para_Eij.set_proc_dim(GlobalV::DSIZE);
116+
// para_Eij.comm_2D = ParaV->comm_2D;
117+
// para_Eij.blacs_ctxt = ParaV->blacs_ctxt;
118+
// para_Eij.set_local2global( GlobalV::NBANDS, GlobalV::NBANDS, ofs_running, ofs_warning );
119+
// para_Eij.set_desc( GlobalV::NBANDS, GlobalV::NBANDS, para_Eij.get_row_size(), false );
120+
para_Eij.set(nbands_total, nbands_total, PARAM.inp.nb2d, ParaV->blacs_ctxt);
121+
122+
// // learn from "module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp"
123+
// int try_nb = para_Eij.init(GlobalV::NBANDS, GlobalV::NBANDS, PARAM.inp.nb2d, DIAG_WORLD); // DIAG_WORLD is wrong
124+
// try_nb += para_Eij.set_nloc_wfc_Eij(GlobalV::NBANDS, ofs_running, ofs_warning);
125+
// if (try_nb != 0)
126+
// {
127+
// para_Eij.set(GlobalV::NBANDS, GlobalV::NBANDS, 1, para_Eij.blacs_ctxt);
128+
// try_nb = para_Eij.set_nloc_wfc_Eij(GlobalV::NBANDS, GlobalV::ofs_running, GlobalV::ofs_warning);
129+
// }
130+
// para_Eij.set_desc_wfc_Eij(GlobalV::NBANDS, GlobalV::NBANDS, para_Eij.nrow);
131+
120132

121133
//
122-
occ_number.create(nk_total, GlobalV::NBANDS);
123-
wg.create(nk_total, GlobalV::NBANDS);
124-
wk_fun_occNum.create(nk_total, GlobalV::NBANDS);
125-
occNum_wfcHamiltWfc.create(nk_total, GlobalV::NBANDS);
126-
Etotal_n_k.create(nk_total, GlobalV::NBANDS);
127-
wfcHwfc_TV.create(nk_total, GlobalV::NBANDS);
128-
wfcHwfc_hartree.create(nk_total, GlobalV::NBANDS);
129-
wfcHwfc_XC.create(nk_total, GlobalV::NBANDS);
130-
wfcHwfc_exx_XC.create(nk_total, GlobalV::NBANDS);
131-
wfcHwfc_dft_XC.create(nk_total, GlobalV::NBANDS);
134+
occ_number.create(nk_total, nbands_total);
135+
wg.create(nk_total, nbands_total);
136+
wk_fun_occNum.create(nk_total, nbands_total);
137+
occNum_wfcHamiltWfc.create(nk_total, nbands_total);
138+
Etotal_n_k.create(nk_total, nbands_total);
139+
wfcHwfc_TV.create(nk_total, nbands_total);
140+
wfcHwfc_hartree.create(nk_total, nbands_total);
141+
wfcHwfc_XC.create(nk_total, nbands_total);
142+
wfcHwfc_exx_XC.create(nk_total, nbands_total);
143+
wfcHwfc_dft_XC.create(nk_total, nbands_total);
132144

133145
//
134146
wfc.resize(nk_total, ParaV->ncol_bands, ParaV->nrow); // test ParaV->nrow
@@ -189,12 +201,12 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
189201
if (GlobalC::exx_info.info_ri.real_number)
190202
{
191203
Vxc_fromRI_d = new Exx_LRI<double>(GlobalC::exx_info.info_ri);
192-
Vxc_fromRI_d->init(MPI_COMM_WORLD, *kv);
204+
Vxc_fromRI_d->init(MPI_COMM_WORLD, *kv, *orb);
193205
}
194206
else
195207
{
196208
Vxc_fromRI_c = new Exx_LRI<std::complex<double>>(GlobalC::exx_info.info_ri);
197-
Vxc_fromRI_c->init(MPI_COMM_WORLD, *kv);
209+
Vxc_fromRI_c->init(MPI_COMM_WORLD, *kv, *orb);
198210
}
199211
}
200212

@@ -349,7 +361,7 @@ void RDMFT<TK, TR>::update_charge()
349361
Symmetry_rho srho;
350362
for (int is = 0; is < nspin; is++)
351363
{
352-
srho.begin(is, *(this->charge), rho_basis, GlobalC::Pgrid, GlobalC::ucell.symm);
364+
srho.begin(is, *(this->charge), rho_basis, GlobalC::ucell.symm);
353365
}
354366
/*********** what's this? When we use PBE-functional, this can't be deleted *************/
355367

source/module_rdmft/rdmft.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class RDMFT
8484
/****** these parameters are passed in from outside, don't need delete ******/
8585
Parallel_Orbitals* ParaV = nullptr;
8686
Parallel_2D para_Eij;
87+
// Parallel_Orbitals para_Eij;
8788

8889
// GK and GG are used for multi-k grid integration and gamma only algorithms respectively
8990
Gint_k* GK = nullptr;
@@ -105,6 +106,7 @@ class RDMFT
105106

106107
int nk_total = 0;
107108
int nspin = 1;
109+
int nbands_total = PARAM.inp.nbands;
108110
std::string XC_func_rdmft;
109111
double alpha_power = 0.656; // 0.656 for soilds, 0.525 for dissociation of H2, 0.55~0.58 for HEG
110112

0 commit comments

Comments
 (0)