#include <charge_mixing.h>
|
| Charge_Mixing () |
|
| ~Charge_Mixing () |
|
void | set_mixing (const std::string &mixing_mode_in, const double &mixing_beta_in, const int &mixing_ndim_in, const double &mixing_gg0_in, const bool &mixing_tau_in, const double &mixing_beta_mag_in, const double &mixing_gg0_mag_in, const double &mixing_gg0_min_in, const double &mixing_angle_in, const bool &mixing_dmr_in, double &omega_in, double &tpiba_in) |
| Set all private mixing paramters.
|
|
void | close_kerker_gg0 () |
|
void | init_mixing () |
| initialize mixing, including constructing mixing and allocating memory for mixing data
|
|
void | allocate_mixing_dmr (const int nnr) |
| allocate memory of dmr_mdata
|
|
void | mix_rho (Charge *chr) |
| charge mixing
|
|
void | mix_dmr (elecstate::DensityMatrix< double, double > *DM) |
| density matrix mixing, only for LCAO
|
|
void | mix_dmr (elecstate::DensityMatrix< std::complex< double >, double > *DM) |
|
double | get_drho (Charge *chr, const double nelec) |
| Get the drho between rho and rho_save, similar for get_dkin.
|
|
double | get_dkin (Charge *chr, const double nelec) |
|
void | mix_reset () |
| reset mixing, actually we only call init_mixing() to reset mixing instead of this function
|
|
void | set_rhopw (ModulePW::PW_Basis *rhopw_in, ModulePW::PW_Basis *rhodpw_in) |
| Set the smooth and dense grids.
|
|
const std::string & | get_mixing_mode () const |
|
double | get_mixing_beta () const |
|
int | get_mixing_ndim () const |
|
double | get_mixing_gg0 () const |
|
Base_Mixing::Mixing * | get_mixing () const |
|
bool | if_scf_oscillate (const int iteration, const double drho, const int iternum_used, const double threshold) |
|
|
void | mix_rho_recip (Charge *chr) |
| charge mixing for reciprocal space
|
|
void | mix_rho_real (Charge *chr) |
| charge mixing for real space
|
|
void | Kerker_screen_recip (std::complex< double > *rhog) |
| Kerker screen method for reciprocal space.
|
|
void | Kerker_screen_real (double *rho) |
| Kerker screen method for real space.
|
|
double | inner_product_recip_rho (std::complex< double > *rho1, std::complex< double > *rho2) |
| Inner product of two complex vectors.
|
|
double | inner_product_recip_simple (std::complex< double > *rho1, std::complex< double > *rho2) |
|
double | inner_product_recip_hartree (std::complex< double > *rho1, std::complex< double > *rho2) |
|
double | inner_product_real (double *rho1, double *rho2) |
| Inner product of two double vectors.
|
|
void | divide_data (std::complex< double > *data_d, std::complex< double > *&data_s, std::complex< double > *&data_hf) |
| divide rho/tau to smooth and high frequency parts
|
|
void | combine_data (std::complex< double > *data_d, std::complex< double > *&data_s, std::complex< double > *&data_hf) |
| gather smooth and high frequency parts to rho/tau
|
|
void | clean_data (std::complex< double > *&data_s, std::complex< double > *&data_hf) |
| clean smooth and high frequency parts
|
|
◆ Charge_Mixing()
Charge_Mixing::Charge_Mixing |
( |
| ) |
|
◆ ~Charge_Mixing()
Charge_Mixing::~Charge_Mixing |
( |
| ) |
|
◆ allocate_mixing_dmr()
void Charge_Mixing::allocate_mixing_dmr |
( |
const int |
nnr | ) |
|
allocate memory of dmr_mdata
- Parameters
-
nnr | size of real-space density matrix |
◆ clean_data()
void Charge_Mixing::clean_data |
( |
std::complex< double > *& |
data_s, |
|
|
std::complex< double > *& |
data_hf |
|
) |
| |
|
private |
clean smooth and high frequency parts
- Parameters
-
data_d | dense data |
data_s | smooth data |
data_hf | high frequency data = dense data - smooth data |
◆ close_kerker_gg0()
void Charge_Mixing::close_kerker_gg0 |
( |
| ) |
|
|
inline |
◆ combine_data()
void Charge_Mixing::combine_data |
( |
std::complex< double > * |
data_d, |
|
|
std::complex< double > *& |
data_s, |
|
|
std::complex< double > *& |
data_hf |
|
) |
| |
|
private |
gather smooth and high frequency parts to rho/tau
- Parameters
-
data_d | dense data |
data_s | smooth data |
data_hf | high frequency data = dense data - smooth data |
◆ divide_data()
void Charge_Mixing::divide_data |
( |
std::complex< double > * |
data_d, |
|
|
std::complex< double > *& |
data_s, |
|
|
std::complex< double > *& |
data_hf |
|
) |
| |
|
private |
divide rho/tau to smooth and high frequency parts
- Parameters
-
data_d | dense data |
data_s | smooth data |
data_hf | high frequency data = dense data - smooth data |
◆ get_dkin()
double Charge_Mixing::get_dkin |
( |
Charge * |
chr, |
|
|
const double |
nelec |
|
) |
| |
◆ get_drho()
double Charge_Mixing::get_drho |
( |
Charge * |
chr, |
|
|
const double |
nelec |
|
) |
| |
Get the drho between rho and rho_save, similar for get_dkin.
◆ get_mixing()
◆ get_mixing_beta()
double Charge_Mixing::get_mixing_beta |
( |
| ) |
const |
|
inline |
◆ get_mixing_gg0()
double Charge_Mixing::get_mixing_gg0 |
( |
| ) |
const |
|
inline |
◆ get_mixing_mode()
const std::string & Charge_Mixing::get_mixing_mode |
( |
| ) |
const |
|
inline |
◆ get_mixing_ndim()
int Charge_Mixing::get_mixing_ndim |
( |
| ) |
const |
|
inline |
◆ if_scf_oscillate()
bool Charge_Mixing::if_scf_oscillate |
( |
const int |
iteration, |
|
|
const double |
drho, |
|
|
const int |
iternum_used, |
|
|
const double |
threshold |
|
) |
| |
◆ init_mixing()
void Charge_Mixing::init_mixing |
( |
| ) |
|
initialize mixing, including constructing mixing and allocating memory for mixing data
this function should be called at eachiterinit()
◆ inner_product_real()
double Charge_Mixing::inner_product_real |
( |
double * |
rho1, |
|
|
double * |
rho2 |
|
) |
| |
|
private |
Inner product of two double vectors.
◆ inner_product_recip_hartree()
double Charge_Mixing::inner_product_recip_hartree |
( |
std::complex< double > * |
rho1, |
|
|
std::complex< double > * |
rho2 |
|
) |
| |
|
private |
◆ inner_product_recip_rho()
double Charge_Mixing::inner_product_recip_rho |
( |
std::complex< double > * |
rho1, |
|
|
std::complex< double > * |
rho2 |
|
) |
| |
|
private |
Inner product of two complex vectors.
inner_product_recip_rho is used for charge, like get_drho()
inner_product_recip_hartree and inner_product_recip_simple are used for charge mixing
inner_product_recip_simple is only used for test
Actually, I am not sure if the definition of inner product for NSPIN=4 is correct, need to be checked.
◆ inner_product_recip_simple()
double Charge_Mixing::inner_product_recip_simple |
( |
std::complex< double > * |
rho1, |
|
|
std::complex< double > * |
rho2 |
|
) |
| |
|
private |
◆ Kerker_screen_real()
void Charge_Mixing::Kerker_screen_real |
( |
double * |
rho | ) |
|
|
private |
Kerker screen method for real space.
- Parameters
-
rho | charge density in real space |
consider a resize for mixing_angle
implement Kerker for density and magnetization separately
inverse FT
◆ Kerker_screen_recip()
void Charge_Mixing::Kerker_screen_recip |
( |
std::complex< double > * |
rhog | ) |
|
|
private |
Kerker screen method for reciprocal space.
- Parameters
-
rhog | charge density in reciprocal space |
consider a resize for mixing_angle
implement Kerker for density and magnetization separately
new mixing method only support nspin=2 not nspin=4
◆ mix_dmr() [1/2]
density matrix mixing, only for LCAO
- Parameters
-
DM | pointer of DensityMatrix object |
◆ mix_dmr() [2/2]
◆ mix_reset()
void Charge_Mixing::mix_reset |
( |
| ) |
|
reset mixing, actually we only call init_mixing() to reset mixing instead of this function
◆ mix_rho()
void Charge_Mixing::mix_rho |
( |
Charge * |
chr | ) |
|
◆ mix_rho_real()
void Charge_Mixing::mix_rho_real |
( |
Charge * |
chr | ) |
|
|
private |
charge mixing for real space
- Parameters
-
◆ mix_rho_recip()
void Charge_Mixing::mix_rho_recip |
( |
Charge * |
chr | ) |
|
|
private |
charge mixing for reciprocal space
- Parameters
-
◆ set_mixing()
void Charge_Mixing::set_mixing |
( |
const std::string & |
mixing_mode_in, |
|
|
const double & |
mixing_beta_in, |
|
|
const int & |
mixing_ndim_in, |
|
|
const double & |
mixing_gg0_in, |
|
|
const bool & |
mixing_tau_in, |
|
|
const double & |
mixing_beta_mag_in, |
|
|
const double & |
mixing_gg0_mag_in, |
|
|
const double & |
mixing_gg0_min_in, |
|
|
const double & |
mixing_angle_in, |
|
|
const bool & |
mixing_dmr_in, |
|
|
double & |
omega_in, |
|
|
double & |
tpiba_in |
|
) |
| |
Set all private mixing paramters.
- Parameters
-
mixing_mode_in | mixing mode: "plain", "broyden", "pulay" |
mixing_beta_in | mixing beta |
mixing_ndim_in | mixing ndim |
mixing_gg0_in | mixing gg0 for Kerker screen |
mixing_tau_in | whether to use tau mixing |
mixing_beta_mag_in | mixing beta for magnetism |
mixing_gg0_mag_in | mixing gg0 for Kerker screen for magnetism |
mixing_gg0_min_in | minimum kerker coefficient |
mixing_angle_in | mixing angle for nspin=4 |
mixing_dmr_in | whether to mixing real space density matrix |
omega_in | omega for non-linear core correction |
tpiba_in | 2*pi/beta for non-linear core correction |
◆ set_rhopw()
Set the smooth and dense grids.
- Parameters
-
rhopw_in | smooth grid |
rhodpw_in | dense grid when double grid is used, otherwise same as rhopw |
◆ _drho_history
std::vector<double> Charge_Mixing::_drho_history |
|
private |
history of drho used to determine the oscillation, size is scf_nmax
◆ dmr_mdata
Mixing data for real space density matrix.
◆ mixing
Mixing object to mix charge density, kinetic energy density and compensation density.
◆ mixing_angle
double Charge_Mixing::mixing_angle = 0.0 |
|
private |
◆ mixing_beta
double Charge_Mixing::mixing_beta = 0.8 |
|
private |
◆ mixing_beta_mag
double Charge_Mixing::mixing_beta_mag = 1.6 |
|
private |
mixing beta for magnetism
◆ mixing_dmr
bool Charge_Mixing::mixing_dmr = false |
|
private |
whether to mixing real space density matrix
◆ mixing_gg0
double Charge_Mixing::mixing_gg0 = 0.0 |
|
private |
mixing gg0 for Kerker screen
◆ mixing_gg0_mag
double Charge_Mixing::mixing_gg0_mag = 0.0 |
|
private |
mixing gg0 for Kerker screen for magnetism
◆ mixing_gg0_min
double Charge_Mixing::mixing_gg0_min = 0.1 |
|
private |
minimum kerker coefficient
◆ mixing_highf
The high_frequency part is mixed by plain mixing method.
◆ mixing_mode
std::string Charge_Mixing::mixing_mode = "broyden" |
|
private |
mixing mode: "plain", "broyden", "pulay"
◆ mixing_ndim
int Charge_Mixing::mixing_ndim = 8 |
|
private |
mixing ndim for broyden and pulay
◆ mixing_restart_count
int Charge_Mixing::mixing_restart_count = 0 |
◆ mixing_restart_last
int Charge_Mixing::mixing_restart_last = 0 |
◆ mixing_restart_step
int Charge_Mixing::mixing_restart_step = 0 |
◆ mixing_tau
bool Charge_Mixing::mixing_tau = false |
|
private |
whether to use tau mixing
◆ new_e_iteration
bool Charge_Mixing::new_e_iteration = true |
|
private |
◆ nhat_mdata
Mixing data for compensation density.
◆ omega
double* Charge_Mixing::omega = nullptr |
|
private |
omega for non-linear core correction
◆ rho_mdata
Mixing data for charge density.
◆ rhodpw
dense grid, same as rhopw for ncpp.
◆ rhopw
◆ tau_mdata
Mixing data for kinetic energy density.
◆ tpiba
double* Charge_Mixing::tpiba = nullptr |
|
private |
2*pi/beta for non-linear core correction
◆ tpiba2
double* Charge_Mixing::tpiba2 = nullptr |
|
private |
2*pi/beta^2 for non-linear core correction
The documentation for this class was generated from the following files: