|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Pseudopot_upf class for reading pseudopotential files. More...
#include <read_pp.h>
Public Member Functions | |
| Pseudopot_upf () | |
| Default constructor. | |
| ~Pseudopot_upf () | |
| Destructor. | |
| int | init_pseudo_reader (const std::string &fn, std::string &type, Atom_pseudo &pp) |
| Initialize pseudopotential reader. | |
| void | print_pseudo_upf (std::ofstream &ofs, Atom_pseudo &pp) |
| Print pseudopotential information. | |
| int | average_p (const double &lambda, Atom_pseudo &pp, const bool lspinorb) |
| Average pseudopotential. | |
| void | set_empty_element (Atom_pseudo &pp) |
| Set empty element for BSSE. | |
| void | set_upf_q (Atom_pseudo &pp) |
| Set UPF Q function. | |
| void | complete_default (Atom_pseudo &pp, const double pseudo_rcut) |
| Complete default values. | |
Public Attributes | |
| std::string | relativistic |
| relativistic: no, scalar, full | |
| int | lmax_rho |
| maximum angular momentum component in rho (should be 2*lmax) | |
| double | xmin |
| the minimum x of the linear mesh | |
| double | rmax |
| the maximum radius of the mesh | |
| double | zmesh |
| the nuclear charge used for mesh | |
| double | dx |
| int | lloc |
| bool | q_with_l |
| if .true. qfunc is pseudized in | |
| int | nqf |
| number of Q coefficients | |
| bool | coulomb_potential = false |
| Dynamic arrays. | |
| ModuleBase::matrix | chi |
| chi(nwfc,mesh) atomic wavefcts | |
| std::vector< int > | kbeta = {} |
| kbeta(nbeta):number of mesh points for projector i (must be .le. mesh ) | |
| std::vector< std::string > | els_beta = {} |
| els_beta(nwfc):label for the beta | |
| std::vector< int > | nchi = {} |
| nchi(nwfc) value of pseudo-n for wavefcts | |
| std::vector< double > | epseu = {} |
| epseu(nwfc) pseudo one-particle energy | |
| std::vector< double > | rcut_chi = {} |
| rcut_chi(nwfc) cutoff inner radius | |
| std::vector< double > | rcutus_chi = {} |
| rcutus_chi(nwfc) ultrasoft outer radius | |
| std::vector< double > | rinner = {} |
| rinner(2*lmax+1) r_L | |
| ModuleBase::matrix | qfunc |
| qfunc(nbeta*(nbeta+1)/2,mesh) Q_{mu,nu}(|r|) function for |r|> r_L | |
| ModuleBase::realArray | qfcoef |
| qfcoef(nbeta,nbeta,2*lmax+1,nqf) coefficients for Q for |r|<r_L | |
| std::vector< double > | rcut = {} |
| cut-off radius(nbeta) | |
| std::vector< double > | rcutus = {} |
| ultrasoft cut-off radius (nbeta) | |
| int | nd |
| nl_5 // Number of nonzero Dij | |
| int | spd_loc |
| VWR format. | |
| int | iTB_s |
| TB s orbital index. | |
| int | iTB_p |
| TB p orbital index. | |
| int | iTB_d |
| TB d orbital index. | |
Private Member Functions | |
| void | skip_number (std::ifstream &ifs, bool mesh_changed) |
| Skip the last number if the mesh is even. | |
| int | read_pseudo_upf (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF format pseudopotential. | |
| int | read_pseudo_vwr (std::ifstream &ifs, Atom_pseudo &pp) |
| Read VWR format pseudopotential. | |
| int | read_pseudo_blps (std::ifstream &ifs, Atom_pseudo &pp) |
| Read BLPS format pseudopotential. | |
| void | read_pseudo_header (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential header. | |
| void | read_pseudo_mesh (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential mesh. | |
| void | read_pseudo_nlcc (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential NLCC. | |
| void | read_pseudo_local (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential local potential. | |
| void | read_pseudo_nl (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential non-local potential. | |
| void | read_pseudo_pswfc (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential pseudo wavefunctions. | |
| void | read_pseudo_rhoatom (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential atomic charge density. | |
| void | read_pseudo_addinfo (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential additional info. | |
| void | read_pseudo_so (std::ifstream &ifs, Atom_pseudo &pp) |
| Read pseudopotential spin-orbit coupling. | |
| int | read_pseudo_upf201 (std::ifstream &ifs, Atom_pseudo &pp) |
| UPF201 format. | |
| void | read_pseudo_upf201_header (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF201 header. | |
| void | read_pseudo_upf201_mesh (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF201 mesh. | |
| void | read_pseudo_upf201_nonlocal (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF201 non-local potential. | |
| void | read_pseudo_upf201_pswfc (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF201 pseudo wavefunctions. | |
| void | read_pseudo_upf201_so (std::ifstream &ifs, Atom_pseudo &pp) |
| Read UPF201 spin-orbit coupling. | |
| void | getnameval (std::ifstream &, int &, std::string *, std::string *) |
| Get name-value pair from input stream. | |
| void | complete_default_atom (Atom_pseudo &pp, const double pseudo_rcut) |
| void | complete_default_vl (Atom_pseudo &pp) |
Private Attributes | |
| bool | mesh_changed = false |
| if the mesh is even, it will be changed to odd | |
Friends | |
| class | AtomPseudoTest |
| the unit tests drive the private format readers and the complete_default_* helpers directly; see source_cell/test/ | |
| class | AtomSpecTest |
| class | NCPPTest |
| class | ReadPPTest |
Pseudopot_upf class for reading pseudopotential files.
This class handles reading various pseudopotential formats (UPF, VWR, BLPS). It supports UPF format versions including UPF201.
| Pseudopot_upf::Pseudopot_upf | ( | ) |
Default constructor.
PP_INFO PP_HEADER PP_MESH PP_NLCC PP_LOCAL PP_NONLOCAL PP_PSWFC PP_PSRHOATOM addinfo
| Pseudopot_upf::~Pseudopot_upf | ( | ) |
Destructor.
| int Pseudopot_upf::average_p | ( | const double & | lambda, |
| Atom_pseudo & | pp, | ||
| const bool | lspinorb ) |
Average pseudopotential.
| lambda | averaging parameter |
| pp | atom pseudopotential object |
| lspinorb | whether spin-orbit is enabled |
| void Pseudopot_upf::complete_default | ( | Atom_pseudo & | pp, |
| const double | pseudo_rcut ) |
Complete default values.
| pp | atom pseudopotential object |
| pseudo_rcut | pseudo cut-off radius |
|
private |
|
private |
|
private |
Get name-value pair from input stream.
| ifs | input file stream |
| ival | integer value (output) |
| sval1 | string value 1 (output) |
| sval2 | string value 2 (output) |
| int Pseudopot_upf::init_pseudo_reader | ( | const std::string & | fn, |
| std::string & | type, | ||
| Atom_pseudo & | pp ) |
Initialize pseudopotential reader.
| fn | filename |
| type | pseudopotential type (output) |
| pp | atom pseudopotential object (output) |
| void Pseudopot_upf::print_pseudo_upf | ( | std::ofstream & | ofs, |
| Atom_pseudo & | pp ) |
Print pseudopotential information.
| ofs | output file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential additional info.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read BLPS format pseudopotential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential header.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential local potential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential mesh.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential non-local potential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential NLCC.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential pseudo wavefunctions.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential atomic charge density.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read pseudopotential spin-orbit coupling.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF format pseudopotential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
UPF201 format.
Read UPF201 format pseudopotential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF201 header.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF201 mesh.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF201 non-local potential.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF201 pseudo wavefunctions.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read UPF201 spin-orbit coupling.
| ifs | input file stream |
| pp | atom pseudopotential object |
|
private |
Read VWR format pseudopotential.
| ifs | input file stream |
| pp | atom pseudopotential object |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
| void Pseudopot_upf::set_empty_element | ( | Atom_pseudo & | pp | ) |
Set empty element for BSSE.
| pp | atom pseudopotential object |
| void Pseudopot_upf::set_upf_q | ( | Atom_pseudo & | pp | ) |
Set UPF Q function.
| pp | atom pseudopotential object |
For USPP we set the augmentation charge as an l-dependent array in all cases. This is already the case when upfq_with_l is .true. For vanderbilt US pseudos, where nqf and rinner are non zero, we do here what otherwise would be done multiple times in many parts of the code (such as in init_us_1, addusforce_r, bp_calc_btq, compute_qdipol) whenever the q_l(r) were to be constructed. For simple rrkj3 pseudos we duplicate the information contained in q(r) for all q_l(r).
This requires a little extra memory but unifies the treatment of q_l(r) and allows further weaking with the augmentation charge.
|
private |
Skip the last number if the mesh is even.
| ifs | input file stream |
| mesh_changed | whether mesh was changed |
|
friend |
the unit tests drive the private format readers and the complete_default_* helpers directly; see source_cell/test/
|
friend |
|
friend |
|
friend |
| ModuleBase::matrix Pseudopot_upf::chi |
chi(nwfc,mesh) atomic wavefcts
| bool Pseudopot_upf::coulomb_potential = false |
Dynamic arrays.
coulomb potential : z/r
| double Pseudopot_upf::dx |
the deltax of the linear mesh The radial grid is: r(i+1) = exp(xmin+i*dx)/zed a.u.
| std::vector<std::string> Pseudopot_upf::els_beta = {} |
els_beta(nwfc):label for the beta
| std::vector<double> Pseudopot_upf::epseu = {} |
epseu(nwfc) pseudo one-particle energy
| int Pseudopot_upf::iTB_d |
TB d orbital index.
| int Pseudopot_upf::iTB_p |
TB p orbital index.
| int Pseudopot_upf::iTB_s |
TB s orbital index.
| std::vector<int> Pseudopot_upf::kbeta = {} |
kbeta(nbeta):number of mesh points for projector i (must be .le. mesh )
| int Pseudopot_upf::lloc |
L of channel used to generate local potential (if < 0 it was generated by smoothing AE potential)
| int Pseudopot_upf::lmax_rho |
maximum angular momentum component in rho (should be 2*lmax)
|
private |
if the mesh is even, it will be changed to odd
| std::vector<int> Pseudopot_upf::nchi = {} |
nchi(nwfc) value of pseudo-n for wavefcts
| int Pseudopot_upf::nd |
nl_5 // Number of nonzero Dij
| int Pseudopot_upf::nqf |
number of Q coefficients
| bool Pseudopot_upf::q_with_l |
if .true. qfunc is pseudized in
| ModuleBase::realArray Pseudopot_upf::qfcoef |
qfcoef(nbeta,nbeta,2*lmax+1,nqf) coefficients for Q for |r|<r_L
| ModuleBase::matrix Pseudopot_upf::qfunc |
qfunc(nbeta*(nbeta+1)/2,mesh) Q_{mu,nu}(|r|) function for |r|> r_L
| std::vector<double> Pseudopot_upf::rcut = {} |
cut-off radius(nbeta)
| std::vector<double> Pseudopot_upf::rcut_chi = {} |
rcut_chi(nwfc) cutoff inner radius
| std::vector<double> Pseudopot_upf::rcutus = {} |
ultrasoft cut-off radius (nbeta)
| std::vector<double> Pseudopot_upf::rcutus_chi = {} |
rcutus_chi(nwfc) ultrasoft outer radius
| std::string Pseudopot_upf::relativistic |
relativistic: no, scalar, full
| std::vector<double> Pseudopot_upf::rinner = {} |
rinner(2*lmax+1) r_L
| double Pseudopot_upf::rmax |
the maximum radius of the mesh
| int Pseudopot_upf::spd_loc |
VWR format.
s,p,d local component
| double Pseudopot_upf::xmin |
the minimum x of the linear mesh
| double Pseudopot_upf::zmesh |
the nuclear charge used for mesh