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

This class is used to get the information of the atoms and orbitals indices in the unit cell. More...

#include <cell_index.h>

Collaboration diagram for CellIndex:

Public Member Functions

 CellIndex ()=default
 
 CellIndex (const std::vector< std::string > &atomLabels_in, const std::vector< int > &atomCounts_in, const std::vector< std::vector< int > > &lnchiCounts_in, const int &nspin)
 
int get_nat ()
 the total number of atoms
 
int get_nat (int it)
 the total number of atoms of a given type
 
int get_ntype ()
 get ntype
 
int get_nw ()
 get nw
 
int get_nw (int iat)
 get nw of a given type
 
int get_iwt (int iat, int orbital_index)
 get iwt
 
int get_maxL (int iat)
 get maximum L of a given atom
 
int get_nchi (int iat, int L)
 get nchi of a given atom and a give L
 
std::string get_atom_label (int iat, bool order=false)
 get atom label of a given atom
 
void write_orb_info (std::string out_dir)
 write orbital info into file
 

Private Member Functions

void cal_orbitalCounts ()
 calculate orbitalCounts from lnchiCounts
 
bool check_nspin (int nspin)
 check nspin
 
void check_atomCounts ()
 check if atomCounts is set ok
 
int iat2it (int iat)
 get type of atom from total order
 
int iat2ia (int iat)
 get index of atom in the same type
 
int iw2l (int iat, int iw)
 get L from iw
 
int iw2z (int iat, int iw)
 get Z from iw
 
int iw2m (int iat, int iw)
 get m from iw
 

Private Attributes

std::vector< int > atomCounts = {}
 atomCounts is a vector used to store the number of atoms for each type
 
std::vector< int > orbitalCounts = {}
 orbitalCounts is a vector used to store the number of orbitals for each type
 
std::vector< std::vector< int > > lnchiCounts = {}
 lnchiCounts is a vector used to store the number of chi for each L
 
std::vector< std::string > atomLabels = {}
 atomLabels is a vector used to store the atom labels
 
int npol_ = 1
 npol is determined by nspin and used in get_iwt and get_nw
 

Detailed Description

This class is used to get the information of the atoms and orbitals indices in the unit cell.

The information includes the number of atoms, the number of orbitals, the number of chi, the atom labels, the maximum L of a given atom, the number of chi of a given atom and a given L, the atom label of a given atom, etc. The class provides the interface to get the information of the atoms and orbitals indices in the unit cell. It also provides the interface to write the orbital information into a file. It is now used only in the Output_Mulliken class. However, it is supposed to be able to replace ucell in LCAO codes where only cell indices are needed. Take care that the three key vectors atomCounts, lnchiCounts, and atomLabels should be set from the UnitCell class. It depends on nspin because the functions get_nw() and get_iwt() are related to nspin, and can be used in the LCAO Hamiltonian construction.

Constructor & Destructor Documentation

◆ CellIndex() [1/2]

CellIndex::CellIndex ( )
default

◆ CellIndex() [2/2]

CellIndex::CellIndex ( const std::vector< std::string > &  atomLabels_in,
const std::vector< int > &  atomCounts_in,
const std::vector< std::vector< int > > &  lnchiCounts_in,
const int &  nspin 
)
Here is the call graph for this function:

Member Function Documentation

◆ cal_orbitalCounts()

void CellIndex::cal_orbitalCounts ( )
private

calculate orbitalCounts from lnchiCounts

Here is the caller graph for this function:

◆ check_atomCounts()

void CellIndex::check_atomCounts ( )
private

check if atomCounts is set ok

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

◆ check_nspin()

bool CellIndex::check_nspin ( int  nspin)
private

check nspin

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

◆ get_atom_label()

std::string CellIndex::get_atom_label ( int  iat,
bool  order = false 
)

get atom label of a given atom

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

◆ get_iwt()

int CellIndex::get_iwt ( int  iat,
int  orbital_index 
)

get iwt

Here is the call graph for this function:

◆ get_maxL()

int CellIndex::get_maxL ( int  iat)

get maximum L of a given atom

Here is the call graph for this function:

◆ get_nat() [1/2]

int CellIndex::get_nat ( )

the total number of atoms

Here is the caller graph for this function:

◆ get_nat() [2/2]

int CellIndex::get_nat ( int  it)

the total number of atoms of a given type

◆ get_nchi()

int CellIndex::get_nchi ( int  iat,
int  L 
)

get nchi of a given atom and a give L

get nchi

Here is the call graph for this function:

◆ get_ntype()

int CellIndex::get_ntype ( )

get ntype

Here is the caller graph for this function:

◆ get_nw() [1/2]

int CellIndex::get_nw ( )

get nw

Here is the caller graph for this function:

◆ get_nw() [2/2]

int CellIndex::get_nw ( int  iat)

get nw of a given type

Here is the call graph for this function:

◆ iat2ia()

int CellIndex::iat2ia ( int  iat)
private

get index of atom in the same type

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

◆ iat2it()

int CellIndex::iat2it ( int  iat)
private

get type of atom from total order

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

◆ iw2l()

int CellIndex::iw2l ( int  iat,
int  iw 
)
private

get L from iw

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

◆ iw2m()

int CellIndex::iw2m ( int  iat,
int  iw 
)
private

get m from iw

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

◆ iw2z()

int CellIndex::iw2z ( int  iat,
int  iw 
)
private

get Z from iw

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

◆ write_orb_info()

void CellIndex::write_orb_info ( std::string  out_dir)

write orbital info into file

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

Member Data Documentation

◆ atomCounts

std::vector<int> CellIndex::atomCounts = {}
private

atomCounts is a vector used to store the number of atoms for each type

◆ atomLabels

std::vector<std::string> CellIndex::atomLabels = {}
private

atomLabels is a vector used to store the atom labels

◆ lnchiCounts

std::vector<std::vector<int> > CellIndex::lnchiCounts = {}
private

lnchiCounts is a vector used to store the number of chi for each L

◆ npol_

int CellIndex::npol_ = 1
private

npol is determined by nspin and used in get_iwt and get_nw

◆ orbitalCounts

std::vector<int> CellIndex::orbitalCounts = {}
private

orbitalCounts is a vector used to store the number of orbitals for each type


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