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
elecstate::Potential Class Reference

#include <potential_new.h>

Inheritance diagram for elecstate::Potential:
Collaboration diagram for elecstate::Potential:

Public Member Functions

 Potential ()
 
 Potential (const ModulePW::PW_Basis *rho_basis_in, const ModulePW::PW_Basis *rho_basis_smooth_in, const UnitCell *ucell_in, const ModuleBase::matrix *vloc_in, Structure_Factor *structure_factors_in, surchem *solvent_in, double *etxc_in, double *vtxc_in)
 
 ~Potential ()
 
void init_pot (int istep, const Charge *const chg)
 
void pot_register (const std::vector< std::string > &components_list)
 
void update_from_charge (const Charge *const chg, const UnitCell *const ucell)
 
void get_vnew (const Charge *chg, ModuleBase::matrix &vnew)
 
PotBaseget_pot_type (const std::string &pot_type)
 
ModuleBase::matrixget_effective_v ()
 
const ModuleBase::matrixget_effective_v () const
 
double * get_effective_v (int is)
 
const double * get_effective_v (int is) const
 
ModuleBase::matrixget_effective_vofk ()
 
const ModuleBase::matrixget_effective_vofk () const
 
double * get_effective_vofk (int is)
 
const double * get_effective_vofk (int is) const
 
ModuleBase::matrixget_veff_smooth ()
 
const ModuleBase::matrixget_veff_smooth () const
 
ModuleBase::matrixget_vofk_smooth ()
 
const ModuleBase::matrixget_vofk_smooth () const
 
template<typename FPTYPE >
FPTYPE * get_veff_smooth_data ()
 
template<typename FPTYPE >
FPTYPE * get_vofk_smooth_data ()
 
double * get_fixed_v ()
 
const double * get_fixed_v () const
 
const ModulePW::PW_Basisget_rho_basis () const
 
double get_vl_of_0 () const
 get the value of vloc at G=0;
 
template<>
float * get_veff_smooth_data ()
 
template<>
double * get_veff_smooth_data ()
 
template<>
float * get_vofk_smooth_data ()
 
template<>
double * get_vofk_smooth_data ()
 
- Public Member Functions inherited from elecstate::PotBase
 PotBase ()
 
virtual ~PotBase ()
 

Private Member Functions

void cal_v_eff (const Charge *const chg, const UnitCell *const ucell, ModuleBase::matrix &v_eff) override
 
void cal_fixed_v (double *vl_pseudo) override
 
void interpolate_vrs ()
 
void allocate ()
 

Private Attributes

std::vector< double > v_effective_fixed
 
ModuleBase::matrix v_effective
 
ModuleBase::matrix veff_smooth
 
ModuleBase::matrix vofk_smooth
 
ModuleBase::matrix v_xc
 
float * s_veff_smooth = nullptr
 
float * s_vofk_smooth = nullptr
 
double * d_veff_smooth = nullptr
 
double * d_vofk_smooth = nullptr
 
ModuleBase::matrix vofk_effective
 
bool fixed_done = false
 
double * etxc_ = nullptr
 
double * vtxc_ = nullptr
 
double vl_of_0 = 0.0
 
std::vector< PotBase * > components
 
const UnitCellucell_ = nullptr
 
const ModuleBase::matrixvloc_ = nullptr
 
Structure_Factorstructure_factors_ = nullptr
 
surchemsolvent_ = nullptr
 
bool use_gpu_ = false
 

Additional Inherited Members

- Public Attributes inherited from elecstate::PotBase
bool fixed_mode = 0
 
bool dynamic_mode = 0
 
- Protected Attributes inherited from elecstate::PotBase
const ModulePW::PW_Basisrho_basis_ = nullptr
 
const ModulePW::PW_Basisrho_basis_smooth_ = nullptr
 

Detailed Description

Potential is the main class of potentials module, it contains:

  1. Constructors and deconstructor
  2. Func init_pot() a. need istep for update_for_tddft(); b. need Charge for update_from_charge(); c. it will reset fixed_done to false, v_effective_fixed will be calculated; d. it should be called after Charge is initialized; e. it can only be called once in one SCF loop
  3. Func pot_register() and components a. need vector<string> for choose target potentials b. "local", PotLocal introduces local pseudopotential part of potentials; c. "hartree", PotHartree introduces Coulombic interaction of electrons part of potentials; d. "xc", PotXC introduces exchange-correlation including meta-gga part of potentials; e. "surchem", PotSurChem introduces surface chemistry part of potentials; f. "efield", PotEfield introduces electronic field including dipole correction part of potentials; g. "gatefield", PotGate introduces gate field part of potentials;
  4. Func update_from_charge() a. regenerate v_effective b. if Meta-GGA is choosed, it will regenerate vofk_effective
  5. Func update_for_tddft() a. in principle, it should be added to components, but it related to real time(istep) b. it should be called after update_from_charge() as a compensation;
  6. Func get_vnew() a. this function is designed for a special demand:
    1. update etxc and vtxc when SCF converged and
    2. use the final delta_V_eff for calculating force correction
  7. Func write_potential()
  8. Func write_elecstat_pot()
  9. interfaces for v_effective_fixed/v_effective/vofk_effective
  10. Func interpolate_vrs() a. interpolate v_effective on the smooth mesh

Constructor & Destructor Documentation

◆ Potential() [1/2]

elecstate::Potential::Potential ( )
inline

◆ Potential() [2/2]

elecstate::Potential::Potential ( const ModulePW::PW_Basis rho_basis_in,
const ModulePW::PW_Basis rho_basis_smooth_in,
const UnitCell ucell_in,
const ModuleBase::matrix vloc_in,
Structure_Factor structure_factors_in,
surchem solvent_in,
double *  etxc_in,
double *  vtxc_in 
)
Here is the call graph for this function:

◆ ~Potential()

elecstate::Potential::~Potential ( )

Member Function Documentation

◆ allocate()

void elecstate::Potential::allocate ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_fixed_v()

void elecstate::Potential::cal_fixed_v ( double *  vl_pseudo)
overrideprivatevirtual

Reimplemented from elecstate::PotBase.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_v_eff()

void elecstate::Potential::cal_v_eff ( const Charge *const  chg,
const UnitCell *const  ucell,
ModuleBase::matrix v_eff 
)
overrideprivatevirtual

Reimplemented from elecstate::PotBase.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_effective_v() [1/4]

ModuleBase::matrix & elecstate::Potential::get_effective_v ( )
inline
Here is the caller graph for this function:

◆ get_effective_v() [2/4]

const ModuleBase::matrix & elecstate::Potential::get_effective_v ( ) const
inline

◆ get_effective_v() [3/4]

double * elecstate::Potential::get_effective_v ( int  is)
inline

◆ get_effective_v() [4/4]

const double * elecstate::Potential::get_effective_v ( int  is) const
inline

◆ get_effective_vofk() [1/4]

ModuleBase::matrix & elecstate::Potential::get_effective_vofk ( )
inline
Here is the caller graph for this function:

◆ get_effective_vofk() [2/4]

const ModuleBase::matrix & elecstate::Potential::get_effective_vofk ( ) const
inline

◆ get_effective_vofk() [3/4]

double * elecstate::Potential::get_effective_vofk ( int  is)
inline

◆ get_effective_vofk() [4/4]

const double * elecstate::Potential::get_effective_vofk ( int  is) const
inline

◆ get_fixed_v() [1/2]

double * elecstate::Potential::get_fixed_v ( )
inline
Here is the caller graph for this function:

◆ get_fixed_v() [2/2]

const double * elecstate::Potential::get_fixed_v ( ) const
inline

◆ get_pot_type()

PotBase * elecstate::Potential::get_pot_type ( const std::string &  pot_type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_rho_basis()

const ModulePW::PW_Basis * elecstate::Potential::get_rho_basis ( ) const
inline

◆ get_veff_smooth() [1/2]

ModuleBase::matrix & elecstate::Potential::get_veff_smooth ( )
inline
Here is the caller graph for this function:

◆ get_veff_smooth() [2/2]

const ModuleBase::matrix & elecstate::Potential::get_veff_smooth ( ) const
inline

◆ get_veff_smooth_data() [1/3]

template<>
float * elecstate::Potential::get_veff_smooth_data ( )

◆ get_veff_smooth_data() [2/3]

template<>
double * elecstate::Potential::get_veff_smooth_data ( )

◆ get_veff_smooth_data() [3/3]

template<typename FPTYPE >
FPTYPE * elecstate::Potential::get_veff_smooth_data ( )
Here is the caller graph for this function:

◆ get_vl_of_0()

double elecstate::Potential::get_vl_of_0 ( ) const
inline

get the value of vloc at G=0;

Returns
vl(0)
Here is the caller graph for this function:

◆ get_vnew()

void elecstate::Potential::get_vnew ( const Charge chg,
ModuleBase::matrix vnew 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_vofk_smooth() [1/2]

ModuleBase::matrix & elecstate::Potential::get_vofk_smooth ( )
inline

◆ get_vofk_smooth() [2/2]

const ModuleBase::matrix & elecstate::Potential::get_vofk_smooth ( ) const
inline

◆ get_vofk_smooth_data() [1/3]

template<>
float * elecstate::Potential::get_vofk_smooth_data ( )

◆ get_vofk_smooth_data() [2/3]

template<>
double * elecstate::Potential::get_vofk_smooth_data ( )

◆ get_vofk_smooth_data() [3/3]

template<typename FPTYPE >
FPTYPE * elecstate::Potential::get_vofk_smooth_data ( )

◆ init_pot()

void elecstate::Potential::init_pot ( int  istep,
const Charge *const  chg 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolate_vrs()

void elecstate::Potential::interpolate_vrs ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pot_register()

void elecstate::Potential::pot_register ( const std::vector< std::string > &  components_list)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_from_charge()

void elecstate::Potential::update_from_charge ( const Charge *const  chg,
const UnitCell *const  ucell 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ components

std::vector<PotBase*> elecstate::Potential::components
private

◆ d_veff_smooth

double* elecstate::Potential::d_veff_smooth = nullptr
private

◆ d_vofk_smooth

double * elecstate::Potential::d_vofk_smooth = nullptr
private

◆ etxc_

double* elecstate::Potential::etxc_ = nullptr
private

◆ fixed_done

bool elecstate::Potential::fixed_done = false
private

◆ s_veff_smooth

float* elecstate::Potential::s_veff_smooth = nullptr
private

◆ s_vofk_smooth

float * elecstate::Potential::s_vofk_smooth = nullptr
private

◆ solvent_

surchem* elecstate::Potential::solvent_ = nullptr
private

◆ structure_factors_

Structure_Factor* elecstate::Potential::structure_factors_ = nullptr
private

◆ ucell_

const UnitCell* elecstate::Potential::ucell_ = nullptr
private

◆ use_gpu_

bool elecstate::Potential::use_gpu_ = false
private

◆ v_effective

ModuleBase::matrix elecstate::Potential::v_effective
private

◆ v_effective_fixed

std::vector<double> elecstate::Potential::v_effective_fixed
private

◆ v_xc

ModuleBase::matrix elecstate::Potential::v_xc
private

◆ veff_smooth

ModuleBase::matrix elecstate::Potential::veff_smooth
private

◆ vl_of_0

double elecstate::Potential::vl_of_0 = 0.0
private

◆ vloc_

const ModuleBase::matrix* elecstate::Potential::vloc_ = nullptr
private

◆ vofk_effective

ModuleBase::matrix elecstate::Potential::vofk_effective
private

◆ vofk_smooth

ModuleBase::matrix elecstate::Potential::vofk_smooth
private

◆ vtxc_

double* elecstate::Potential::vtxc_ = nullptr
private

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