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
SphbesRadials Class Reference

Numerical radials from spherical Bessel coefficients. More...

#include <sphbes_radials.h>

Inheritance diagram for SphbesRadials:
Collaboration diagram for SphbesRadials:

Public Member Functions

 SphbesRadials ()
 
 SphbesRadials (const SphbesRadials &other)
 
SphbesRadialsoperator= (const SphbesRadials &rhs)
 
SphbesRadialsclone () const
 for polymorphic copy
 
 ~SphbesRadials ()
 
void build (const std::string &file, const double dr=0.01, const int itype=0, std::ofstream *ptr_log=nullptr, const int rank=0)
 Builds the class from a spherical Bessel coefficient file.
 
void build (const int lmax, const int nbes, const double rcut, const double sigma, const double dr=0.01, const int itype=0, std::ofstream *ptr_log=nullptr, const int rank=0)
 Builds the class with truncated spherical Bessel functions.
 
Getters
double sigma () const
 
double dr () const
 
std::vector< double > const & coeff (const int l, const int izeta) const
 
- Public Member Functions inherited from RadialSet
 RadialSet ()=default
 
 RadialSet (const RadialSet &)
 deep copy
 
RadialSetoperator= (const RadialSet &)
 deep copy
 
virtual ~RadialSet ()
 
virtual void to_numerical_orbital (Numerical_Orbital &, const int nk_legacy=4005, const double lcao_dk=0.01) const
 Overwrites the content of a Numerical_Orbital object with the current object.
 
virtual void build (const std::string &, const int=0, std::ofstream *const =nullptr, const int=0)
 Builds the object from a file.
 
virtual void build (const Numerical_Nonlocal &, const int=0, std::ofstream *const =nullptr)
 Builds from a Numerical_Nonlocal object.
 
virtual void build (const int=0, const double=1.0, const bool=false, const int=0, const double=10.0, const double=0.01, const double=1e-6, const int=0, const std::string="", const std::string="minimal-valence", std::ofstream *const =nullptr)
 Builds from hydrogen-like radial functions.
 
virtual void build (const std::string &, const int, const double, const double, std::ofstream *const =nullptr, const int=0)
 Builds from pseudopotential file.
 
void write_abacus_orb (const std::string &, const int=0) const
 write any RadialSet object to a file in ABACUS numerical atomic orbital format.
 
const std::string & symbol () const
 
int itype () const
 
int lmax () const
 
double rcut_max () const
 
int nzeta (const int l) const
 
int nzeta_max () const
 
int nchi () const
 
const NumericalRadialchi (const int l, const int izeta)
 
const NumericalRadialcbegin () const
 
const NumericalRadialcend () const
 
void set_transformer (ModuleBase::SphericalBesselTransformer sbt, const int update=0)
 
void set_grid (const bool for_r_space, const int ngrid, const double *grid, const char mode='i')
 Sets a common grid for all NumericalRadial objects.
 
void set_uniform_grid (const bool for_r_space, const int ngrid, const double cutoff, const char mode='i', const bool enable_fft=false)
 Sets a common uniform grid for all NumericalRadial objects.
 

Private Member Functions

void read_coeff (std::ifstream &ifs, std::ofstream *ptr_log=nullptr, const int rank=0)
 Reads spherical Bessel coefficients, cutoff radius & smoothing parameter from a file stream.
 
void build_radset (const bool normalize=true)
 
std::string extract (std::string const &str, std::string const &keyword)
 Extracts a substring (VALUE) from a string of the form KEYWORD=" VALUE ".
 
std::vector< std::string > split (std::string const &str, const char *delim=" \n\t")
 Splits a string into a vector of substrings with given delimiters.
 
std::vector< double > sphbes_comb (const int l, std::vector< double > const &coeff_q, double rcut, double dr, std::vector< double > const &q)
 Computes the combination of spherical Bessel functions on a uniform grid.
 
double smooth (double r, double rcut, double sigma)
 Smoothing function.
 

Private Attributes

double sigma_ = 0.0
 Smoothing parameter.
 
double dr_ = 0.01
 Radial grid spacing.
 
std::map< std::pair< int, int >, std::vector< double > > coeff_
 Spherical Bessel coefficients coeff_[{l,zeta}][q].
 

Additional Inherited Members

- Protected Member Functions inherited from RadialSet
void cleanup ()
 Deallocates memory and reset all class members to default values.
 
int index (const int l, const int izeta) const
 Gets the index in chi_ array from (l,izeta).
 
void indexing ()
 Builds index_map_ from nzeta_, nzeta_max_ and lmax_.
 
void set_rcut_max ()
 Sets rcut_max_ to be the maximum rcut of all NumericalRadial objects.
 
- Protected Attributes inherited from RadialSet
std::string symbol_ = ""
 usually the chemical symbol
 
int itype_ = 0
 usually the index for element in calculation
 
int lmax_ = -1
 maximum angular momentum among all NumericalRadial objects
 
double rcut_max_ = 0.0
 maximum rcut (NOT rmax!) among all NumericalRadial objects
 
int * nzeta_ = nullptr
 number of NumericalRadial objects for each angular momentum
 
int nzeta_max_ = 0
 maximum number of NumericalRadial objects among each angular momentum
 
int nchi_ = 0
 total number of NumericalRadial objects
 
NumericalRadialchi_ = nullptr
 array of NumericalRadial objects
 
int * index_map_ = nullptr
 A map from (l,izeta) to an index in chi_ array.
 

Detailed Description

Numerical radials from spherical Bessel coefficients.

Constructor & Destructor Documentation

◆ SphbesRadials() [1/2]

SphbesRadials::SphbesRadials ( )
inline
Here is the caller graph for this function:

◆ SphbesRadials() [2/2]

SphbesRadials::SphbesRadials ( const SphbesRadials other)
inline

◆ ~SphbesRadials()

SphbesRadials::~SphbesRadials ( )
inline

Member Function Documentation

◆ build() [1/2]

void SphbesRadials::build ( const int  lmax,
const int  nbes,
const double  rcut,
const double  sigma,
const double  dr = 0.01,
const int  itype = 0,
std::ofstream *  ptr_log = nullptr,
const int  rank = 0 
)
virtual

Builds the class with truncated spherical Bessel functions.

Instead of reading spherical Bessel coefficients from a file, an alternative way to build the class is to have each truncated spherical Bessel function as a NumericalRadial object.

Parameters
[in]lmaxmaximum angular momentum
[in]nbesnumber of truncated spherical Bessel functions
[in]itypeelement index in calculation
[in]drradial grid spacing
[in]ptr_logoutput file stream for logging
[in]rankMPI rank

Reimplemented from RadialSet.

Here is the call graph for this function:

◆ build() [2/2]

void SphbesRadials::build ( const std::string &  file,
const double  dr = 0.01,
const int  itype = 0,
std::ofstream *  ptr_log = nullptr,
const int  rank = 0 
)

Builds the class from a spherical Bessel coefficient file.

Parameters
[in]fileorbital file name
[in]itypeelement index in calculation
[in]drradial grid spacing
[in]ptr_logoutput file stream for logging
[in]rankMPI rank
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_radset()

void SphbesRadials::build_radset ( const bool  normalize = true)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone()

SphbesRadials * SphbesRadials::clone ( ) const
inlinevirtual

for polymorphic copy

Implements RadialSet.

Here is the call graph for this function:

◆ coeff()

std::vector< double > const & SphbesRadials::coeff ( const int  l,
const int  izeta 
) const
inline

◆ dr()

double SphbesRadials::dr ( ) const
inline
Here is the caller graph for this function:

◆ extract()

std::string SphbesRadials::extract ( std::string const &  str,
std::string const &  keyword 
)
private

Extracts a substring (VALUE) from a string of the form KEYWORD=" VALUE ".

Here is the caller graph for this function:

◆ operator=()

SphbesRadials & SphbesRadials::operator= ( const SphbesRadials rhs)
Here is the call graph for this function:

◆ read_coeff()

void SphbesRadials::read_coeff ( std::ifstream &  ifs,
std::ofstream *  ptr_log = nullptr,
const int  rank = 0 
)
private

Reads spherical Bessel coefficients, cutoff radius & smoothing parameter from a file stream.

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

◆ sigma()

double SphbesRadials::sigma ( ) const
inline
Here is the caller graph for this function:

◆ smooth()

double SphbesRadials::smooth ( double  r,
double  rcut,
double  sigma 
)
private

Smoothing function.

Here is the call graph for this function:

◆ sphbes_comb()

std::vector< double > SphbesRadials::sphbes_comb ( const int  l,
std::vector< double > const &  coeff_q,
double  rcut,
double  dr,
std::vector< double > const &  q 
)
private

Computes the combination of spherical Bessel functions on a uniform grid.

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

◆ split()

std::vector< std::string > SphbesRadials::split ( std::string const &  str,
const char *  delim = " \n\t" 
)
private

Splits a string into a vector of substrings with given delimiters.

Here is the caller graph for this function:

Member Data Documentation

◆ coeff_

std::map<std::pair<int,int>, std::vector<double> > SphbesRadials::coeff_
private

Spherical Bessel coefficients coeff_[{l,zeta}][q].

◆ dr_

double SphbesRadials::dr_ = 0.01
private

Radial grid spacing.

◆ sigma_

double SphbesRadials::sigma_ = 0.0
private

Smoothing parameter.


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