ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Charge_Extra Class Reference

charge extrapolation method More...

#include <charge_extra.h>

Collaboration diagram for Charge_Extra:

Public Member Functions

 Charge_Extra ()
 
 ~Charge_Extra ()
 
void Init_CE (const int &nspin, const int &natom, const int &nrxx, const std::string chg_extrap)
 Initialization of viriables used in charge extrapolation methods.
 
void extrapolate_charge (Parallel_Grid *Pgrid, UnitCell &ucell, Charge *chr, Structure_Factor *sf, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 charge extrapolation method
 
void update_all_dis (const UnitCell &ucell)
 update displacements
 
void update_delta_rho (const UnitCell &ucell, const Charge *chr, const Structure_Factor *sf)
 update the difference of charge density
 

Private Member Functions

void find_alpha_and_beta (const int &natom, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 determine alpha and beta
 

Private Attributes

int istep = 0
 the current step
 
int pot_order
 the specified charge extrapolation method
 
int rho_extr
 the actually used method
 
int nspin
 the number of spins
 
ModuleBase::Vector3< double > * dis_old1 = nullptr
 dis_old2 = pos_old1 - pos_old2
 
ModuleBase::Vector3< double > * dis_old2 = nullptr
 dis_old1 = pos_now - pos_old1
 
ModuleBase::Vector3< double > * dis_now = nullptr
 dis_now = pos_next - pos_now
 
std::vector< std::vector< double > > delta_rho1
 the last step difference of rho and atomic_rho
 
std::vector< std::vector< double > > delta_rho2
 the second last step difference of rho and atomic_rho
 
std::vector< std::vector< double > > delta_rho3
 the third last step difference of rho and atomic_rho
 
double alpha
 parameter used in the second order extrapolation
 
double beta
 parameter used in the second order extrapolation
 

Detailed Description

charge extrapolation method

This class implements several charge extrapolation methods: pot_order=0 : copy the old potential (nothing is done); pot_order=1 : subtract old atomic charge density and sum the new if dynamics is done the routine extrapolates also the difference between the scf charge and the atomic one; pot_order=2 : first order extrapolation: [ \rho(t+dt) = 2\ \rho(t)-\rho(t-dt); ] pot_order=3 : second order extrapolation: [ \rho(t+dt) = \rho(t) + \alpha_0\ (\rho(t) - \rho(t-dt))

The (\alpha_0) and (\beta_0) parameters are calculated in find_alpha_and_beta() so that (|\tau'-\tau(t+dt)|) is minimum. (\tau') and (\tau(t+dt)) are respectively the atomic positions at time t+dt and the extrapolated one: [ \tau(t+dt) = \tau(t) + \alpha_0\ ( \tau(t) - \tau(t-dt) )

Constructor & Destructor Documentation

◆ Charge_Extra()

Charge_Extra::Charge_Extra ( )

◆ ~Charge_Extra()

Charge_Extra::~Charge_Extra ( )

Member Function Documentation

◆ extrapolate_charge()

void Charge_Extra::extrapolate_charge ( Parallel_Grid Pgrid,
UnitCell ucell,
Charge chr,
Structure_Factor sf,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning 
)

charge extrapolation method

Parameters
Pgridparallel grids
ucellthe cell information
chrthe charge density
sfthe structure factor
ofs_runningthe output stream
ofs_warningthe output stream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_alpha_and_beta()

void Charge_Extra::find_alpha_and_beta ( const int &  natom,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning 
)
private

determine alpha and beta

Parameters
natomthe number of atoms
ofs_runningthe output stream
ofs_warningthe output stream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init_CE()

void Charge_Extra::Init_CE ( const int &  nspin,
const int &  natom,
const int &  nrxx,
const std::string  chg_extrap 
)

Initialization of viriables used in charge extrapolation methods.

When Esolver is initialized, ucell.natom is not determined As a result, data structures in Charge_Extra cannot be allocated This is a temporary solution by delaying the allocation But after ucell and Esolver are fully decoupled Init_CE will be removed and everything put back in the constructor

Parameters
nspinthe number of spins
natomthe number of atoms
nrxxthe number of grids
chg_extrapthe charge extrapolation method
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_all_dis()

void Charge_Extra::update_all_dis ( const UnitCell ucell)

update displacements

In the second order extrapolation, the displacements of previous three steps are needed to determine alpha and beta, which are parameters used in this method.

Parameters
ucellthe cell information
Here is the caller graph for this function:

◆ update_delta_rho()

void Charge_Extra::update_delta_rho ( const UnitCell ucell,
const Charge chr,
const Structure_Factor sf 
)

update the difference of charge density

Parameters
ucellthe cell information
chrthe charge density
sfthe structure factor
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ alpha

double Charge_Extra::alpha
private

parameter used in the second order extrapolation

◆ beta

double Charge_Extra::beta
private

parameter used in the second order extrapolation

◆ delta_rho1

std::vector<std::vector<double> > Charge_Extra::delta_rho1
private

the last step difference of rho and atomic_rho

◆ delta_rho2

std::vector<std::vector<double> > Charge_Extra::delta_rho2
private

the second last step difference of rho and atomic_rho

◆ delta_rho3

std::vector<std::vector<double> > Charge_Extra::delta_rho3
private

the third last step difference of rho and atomic_rho

◆ dis_now

ModuleBase::Vector3<double>* Charge_Extra::dis_now = nullptr
private

dis_now = pos_next - pos_now

◆ dis_old1

ModuleBase::Vector3<double>* Charge_Extra::dis_old1 = nullptr
private

dis_old2 = pos_old1 - pos_old2

◆ dis_old2

ModuleBase::Vector3<double>* Charge_Extra::dis_old2 = nullptr
private

dis_old1 = pos_now - pos_old1

◆ istep

int Charge_Extra::istep = 0
private

the current step

◆ nspin

int Charge_Extra::nspin
private

the number of spins

◆ pot_order

int Charge_Extra::pot_order
private

the specified charge extrapolation method

◆ rho_extr

int Charge_Extra::rho_extr
private

the actually used method


The documentation for this class was generated from the following files: