5#ifndef CAL_ATOMS_INFO_H
6#define CAL_ATOMS_INFO_H
65 const int nspin,
const bool two_fermi,
66 const double nelec_delta,
67 const std::string& esolver_type,
69 const std::string& basis_type,
70 const std::string& smearing_method,
71 const std::string& ks_solver,
80 if (nspin == 2 && !two_fermi)
82 for (
int it = 0; it < ntype; ++it)
84 for (
int ia = 0; ia < atoms[it].
na; ++ia)
92 else if (nspin == 2 && two_fermi)
99 for (
int it = 0; it < ntype; ++it)
101 if (atoms[it].ncpp.tvanp)
109 for (
int it = 0; it < ntype; ++it)
119 result.
nelec = nelec;
123 std::vector<double> nelec_spin(2, 0.0);
131 esolver_type, lspinorb, nspin, basis_type, smearing_method);
133 if (ks_solver ==
"bpcg" && result.
nbands > 0 && bndpar > result.
nbands)
140 if (ks_solver ==
"bpcg")
Atom class for storing atom information.
Definition atom_spec.h:14
int na
Number of atoms in this type.
Definition atom_spec.h:44
std::vector< double > mag
magnetic moment
Definition atom_spec.h:62
void set_index()
Set index arrays.
Definition atom_spec.cpp:17
CalAtomsInfo()
Default constructor.
Definition cal_atoms_info.h:33
AtomsInfoResult cal_atoms_info(Atom *atoms, const int &ntype, const int nspin, const bool two_fermi, const double nelec_delta, const std::string &esolver_type, const bool lspinorb, const std::string &basis_type, const std::string &smearing_method, const std::string &ks_solver, const int bndpar, const int nbands, const double nelec, const double nupdown)
Calculate the atom information from pseudopotential.
Definition cal_atoms_info.h:64
~CalAtomsInfo()
Destructor.
Definition cal_atoms_info.h:38
std::ofstream ofs_running
Definition global_variable.cpp:38
int MY_BNDGROUP
Definition global_variable.cpp:23
void OUT(std::ofstream &ofs, const std::string &name)
Definition global_function.cpp:54
void WARNING_QUIT(const std::string &, const std::string &)
Combine the functions of WARNING and QUIT.
Definition test_delley.cpp:15
void cal_nelec(const Atom *atoms, const int &ntype, double &nelec, const double nelec_delta)
calculate the total number of electrons in system
Definition cal_nelec_nband.cpp:29
void cal_nbands(const int &nelec, const int &nlocal, const std::vector< double > &nelec_spin, int &nbands, const std::string &esolver_type, const bool lspinorb, const int nspin, const std::string &basis_type, const std::string &smearing_method)
Calculate the number of bands.
Definition cal_nelec_nband.cpp:61
int cal_nlocal(const Atom *atoms, const int ntype, const int nspin)
Calculate the total number of local numerical atomic orbitals.
Definition cal_nelec_nband.cpp:11
Result struct for atom information calculation.
Definition cal_atoms_info.h:14
double nupdown
spin polarization
Definition cal_atoms_info.h:18
bool ks_run
whether to run KS solver
Definition cal_atoms_info.h:21
int nbands_l
number of local bands
Definition cal_atoms_info.h:20
double nelec
total number of electrons
Definition cal_atoms_info.h:16
int nbands
number of bands
Definition cal_atoms_info.h:17
int nlocal
total number of local basis
Definition cal_atoms_info.h:15
bool use_uspp
whether to use USPP
Definition cal_atoms_info.h:19