Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions source/module_elecstate/elecstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ namespace elecstate

const double* ElecState::getRho(int spin) const
{
// hamilt::MatrixBlock<double> temp{&(this->charge->rho[spin][0]), 1, this->charge->nrxx}; //
// this->chr->get_nspin(), this->chr->get_nrxx()};
return &(this->charge->rho[spin][0]);
}

void ElecState::fixed_weights(const std::vector<double>& ocp_kb, const int& nbands, const double& nelec)
{

assert(nbands > 0);
assert(nelec > 0.0);

Expand Down Expand Up @@ -56,6 +53,7 @@ void ElecState::fixed_weights(const std::vector<double>& ocp_kb, const int& nban
return;
}


void ElecState::init_nelec_spin()
{
this->nelec_spin.resize(PARAM.inp.nspin);
Expand All @@ -66,6 +64,7 @@ void ElecState::init_nelec_spin()
}
}


void ElecState::calculate_weights()
{
ModuleBase::TITLE("ElecState", "calculate_weights");
Expand All @@ -74,8 +73,8 @@ void ElecState::calculate_weights()
return;
}

int nbands = this->ekb.nc;
int nks = this->ekb.nr;
const int nbands = this->ekb.nc;
const int nks = this->ekb.nr;

if (!Occupy::use_gaussian_broadening && !Occupy::fixed_occupations)
{
Expand Down Expand Up @@ -176,6 +175,7 @@ void ElecState::calculate_weights()
return;
}


void ElecState::calEBand()
{
ModuleBase::TITLE("ElecState", "calEBand");
Expand Down Expand Up @@ -205,10 +205,13 @@ void ElecState::calEBand()
return;
}

void ElecState::init_scf(const int istep, const ModuleBase::ComplexMatrix& strucfac, ModuleSymmetry::Symmetry& symm, const void* wfcpw)

void ElecState::init_scf(const int istep,
const ModuleBase::ComplexMatrix& strucfac,
ModuleSymmetry::Symmetry& symm,
const void* wfcpw)
{
//---------Charge part-----------------
// core correction potential.
//! core correction potential.
if (!PARAM.inp.use_paw)
{
this->charge->set_rho_core(strucfac);
Expand All @@ -218,23 +221,22 @@ void ElecState::init_scf(const int istep, const ModuleBase::ComplexMatrix& struc
this->charge->set_rho_core_paw();
}

//--------------------------------------------------------------------
// (2) other effective potentials need charge density,
//! other effective potentials need charge density,
// choose charge density from ionic step 0.
//--------------------------------------------------------------------
if (istep == 0)
{
this->charge->init_rho(this->eferm, strucfac, symm, (const void*)this->klist, wfcpw);
this->charge->check_rho(); // check the rho
}

// renormalize the charge density
//! renormalize the charge density
this->charge->renormalize_rho();

//---------Potential part--------------
//! initialize the potential
this->pot->init_pot(istep, this->charge);
}


void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
const K_Vectors* klist_in,
int nk_in,
Expand All @@ -252,6 +254,4 @@ void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
this->wg.create(nk_in, PARAM.inp.nbands);
}



} // namespace elecstate
Loading