forked from deepmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7d52c5
commit 3b096c6
Showing
8 changed files
with
212 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,46 @@ | ||
#include "./elecstate_pw_sdft.h" | ||
|
||
#include "module_base/global_function.h" | ||
#include "module_base/global_variable.h" | ||
#include "module_parameter/parameter.h" | ||
#include "module_base/timer.h" | ||
#include "module_base/global_function.h" | ||
#include "module_hamilt_general/module_xc/xc_functional.h" | ||
#include "module_parameter/parameter.h" | ||
namespace elecstate | ||
{ | ||
void ElecStatePW_SDFT::psiToRho(const psi::Psi<std::complex<double>>& psi) | ||
|
||
template <typename Device> | ||
void ElecStatePW_SDFT<Device>::psiToRho(const psi::Psi<std::complex<double>>& psi) | ||
{ | ||
ModuleBase::TITLE(this->classname, "psiToRho"); | ||
ModuleBase::timer::tick(this->classname, "psiToRho"); | ||
for (int is = 0; is < PARAM.inp.nspin; is++) | ||
{ | ||
ModuleBase::TITLE(this->classname, "psiToRho"); | ||
ModuleBase::timer::tick(this->classname, "psiToRho"); | ||
for(int is=0; is < PARAM.inp.nspin; is++) | ||
{ | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->rho[is], this->charge->nrxx); | ||
if (XC_Functional::get_func_type() == 3) | ||
{ | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); | ||
} | ||
} | ||
|
||
if(GlobalV::MY_STOGROUP == 0) | ||
{ | ||
this->calEBand(); | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->rho[is], this->charge->nrxx); | ||
if (XC_Functional::get_func_type() == 3) | ||
{ | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); | ||
} | ||
} | ||
|
||
if (GlobalV::MY_STOGROUP == 0) | ||
{ | ||
this->calEBand(); | ||
|
||
for(int is=0; is<PARAM.inp.nspin; is++) | ||
{ | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->rho[is], this->charge->nrxx); | ||
} | ||
for (int is = 0; is < PARAM.inp.nspin; is++) | ||
{ | ||
ModuleBase::GlobalFunc::ZEROS(this->charge->rho[is], this->charge->nrxx); | ||
} | ||
|
||
for (int ik = 0; ik < psi.get_nk(); ++ik) | ||
{ | ||
psi.fix_k(ik); | ||
this->updateRhoK(psi); | ||
} | ||
this->parallelK(); | ||
for (int ik = 0; ik < psi.get_nk(); ++ik) | ||
{ | ||
psi.fix_k(ik); | ||
this->updateRhoK(psi); | ||
} | ||
ModuleBase::timer::tick(this->classname, "psiToRho"); | ||
return; | ||
this->parallelK(); | ||
} | ||
} | ||
ModuleBase::timer::tick(this->classname, "psiToRho"); | ||
return; | ||
} | ||
|
||
template class ElecStatePW_SDFT<base_device::DEVICE_CPU>; | ||
} // namespace elecstate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.