Skip to content

Commit

Permalink
Update elecstate_pw.h (#5651)
Browse files Browse the repository at this point in the history
* Update elecstate_pw.h

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
mohanchen and pre-commit-ci-lite[bot] authored Nov 30, 2024
1 parent 8ef9cba commit a6631a6
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions source/module_elecstate/elecstate_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ElecStatePW : public ElecState
{
private:
using Real = typename GetTypeReal<T>::type;

public:
ElecStatePW(ModulePW::PW_Basis_K* wfc_basis_in,
Charge* chg_in,
Expand All @@ -26,46 +27,59 @@ class ElecStatePW : public ElecState
ModulePW::PW_Basis* rhodpw_in,
ModulePW::PW_Basis* rhopw_in,
ModulePW::PW_Basis_Big* bigpw_in);
// void init(Charge* chg_in):charge(chg_in){} override;

~ElecStatePW();
// interface for HSolver to calculate rho from Psi

//! interface for HSolver to calculate rho from Psi
virtual void psiToRho(const psi::Psi<T, Device>& psi);
// return current electronic density rho, as a input for constructing Hamiltonian
// const double* getRho(int spin) const override;
virtual void cal_tau(const psi::Psi<T, Device>& psi);

// update charge density for next scf step
// void getNewRho() override;
virtual void cal_tau(const psi::Psi<T, Device>& psi);

Real* becsum = nullptr;
// init rho_data and kin_r_data

//! init rho_data and kin_r_data
void init_rho_data();
Real ** rho = nullptr, ** kin_r = nullptr; //[Device] [spin][nrxx] rho and kin_r
Real** rho = nullptr;
Real** kin_r = nullptr; //[Device] [spin][nrxx] rho and kin_r

protected:

ModulePW::PW_Basis* rhopw_smooth = nullptr;

ModulePW::PW_Basis_K* basis = nullptr;

UnitCell* ucell = nullptr;

const pseudopot_cell_vnl* ppcell = nullptr;

// calculate electronic charge density on grid points or density matrix in real space
// the consequence charge density rho saved into rho_out, preparing for charge mixing.
//! calculate electronic charge density on grid points or density matrix in real space
//! the consequence charge density rho saved into rho_out, preparing for charge mixing.
void updateRhoK(const psi::Psi<T, Device>& psi); // override;
// sum over all pools for rho and ebands

//! sum over all pools for rho and ebands
void parallelK();
// calcualte rho for each k

//! calcualte rho for each k
void rhoBandK(const psi::Psi<T, Device>& psi);
// add to the charge density in reciprocal space the part which is due to the US augmentation.

//! add to the charge density in reciprocal space the part which is due to the US augmentation.
void add_usrho(const psi::Psi<T, Device>& psi);
// \sum_lm Q_lm(r) \sum_i <psi_i|beta_l><beta_m|psi_i> w_i

//! Non-local pseudopotentials
//! \sum_lm Q_lm(r) \sum_i <psi_i|beta_l><beta_m|psi_i> w_i
void addusdens_g(const Real* becsum, T* rhog);

Device * ctx = {};

bool init_rho = false;

mutable T* vkb = nullptr;
Real * rho_data = nullptr, * kin_r_data = nullptr;
T * wfcr = nullptr, * wfcr_another_spin = nullptr;

Real* rho_data = nullptr;
Real* kin_r_data = nullptr;
T* wfcr = nullptr;
T* wfcr_another_spin = nullptr;

private:
using meta_op = hamilt::meta_pw_op<Real, Device>;
using elecstate_pw_op = elecstate::elecstate_pw_op<Real, Device>;
Expand All @@ -85,4 +99,4 @@ class ElecStatePW : public ElecState

} // namespace elecstate

#endif
#endif

0 comments on commit a6631a6

Please sign in to comment.