ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LCAO_domain::ModuleBase Namespace Reference

Namespaces

namespace  GlobalFunc

Classes

class  Vector3
 3 elements vector More...
class  IntArray
 Integer array. More...
class  matrix
class  Matrix3
 3x3 matrix and related mathamatical operations More...
class  ComplexArray
 A basic type of data for complex array. More...
class  ComplexMatrix
class  realArray
 double float array More...
class  timer
 Tracing computation time. More...
class  Mathzone
 atomic coordinates conversion functions More...
class  Ylm

Functions

void CHECK_NAME (std::ifstream &ifs, const std::string &name_in, bool quit=true)
 Check the next input from ifs is std::string. This is a global function.
void CHECK_INT (std::ifstream &ifs, const int &v, bool quit=true)
 Check the next input from ifs is integer. This is a global function.
void CHECK_DOUBLE (std::ifstream &ifs, const double &v, bool quit=true)
 Check the next input from ifs is double. This is a global function.
void CHECK_STRING (std::ifstream &ifs, const std::string &v, bool quit=true)
 Check the next input from ifs is std::string. This is a global function.
void WARNING (const std::string &file, const std::string &description)
 Print out warning information in warning.log file.
void set_quit_out_dir (const std::string &dir)
 Inject the global output directory used by QUIT/WARNING_QUIT/CHECK_WARNING_QUIT for log path resolution and user-facing messages.
const std::string & get_global_out_dir ()
 Read back the injected global output directory. Returns an empty string if set_quit_out_dir was never called.
void set_quit_calculation (const std::string &calculation)
 Inject the calculation tag used by CHECK_WARNING_QUIT to compose the fallback log filename ("running_<calculation>.log") when ofs_running is not already open.
void QUIT (void)
 Close .log files and exit.
void QUIT (int ret)
 Close .log files and exit.
void WARNING_QUIT (const std::string &file, const std::string &description)
 Combine the functions of WARNING and QUIT.
void WARNING_QUIT (const std::string &file, const std::string &description, int ret)
 Combine the functions of WARNING and QUIT.
void CHECK_WARNING_QUIT (const bool error, const std::string &file, const std::string &description)
 Check, if true, WARNING_QUIT.
void TITLE (const std::string &class_name, const std::string &function_name="", const bool disable=true)
void TITLE (std::ofstream &ofs, const std::string &class_name, const std::string &function_name, const bool disable=true)
template<class T>
Vector3< T > operator+ (const Vector3< T > &u, const Vector3< T > &v)
 Overload "+" for two Vector3.
template<class T>
Vector3< T > operator- (const Vector3< T > &u, const Vector3< T > &v)
 Overload "-" for two Vector3.
template<class T>
T operator* (const Vector3< T > &u, const Vector3< T > &v)
 Overload "*" to calculate the dot product of two Vector3.
template<class T>
Vector3< T > operator* (const T &s, const Vector3< T > &u)
 Overload "*" to calculate (Vector3)*scalar.
template<class T>
Vector3< T > operator* (const Vector3< T > &u, const T &s)
 Overload "*" to calculate scalar*(Vector3).
template<class T>
Vector3< T > operator/ (const Vector3< T > &u, const T &s)
 Overload "/" to calculate Vector3/scalar.
template<class T>
Vector3< T > operator/ (const T &s, const Vector3< T > &u)
 Overload "/" to calculate scalar/Vector3.
template<class T>
T dot (const Vector3< T > &u, const Vector3< T > &v)
 Dot productor of two Vector3.
template<class T>
Vector3< T > operator^ (const Vector3< T > &u, const Vector3< T > &v)
 Overload "^" for cross product of two Vector3.
template<class T>
Vector3< T > cross (const Vector3< T > &u, const Vector3< T > &v)
 Cross product of two Vector3.
template<class T>
bool operator< (const Vector3< T > &u, const Vector3< T > &v)
template<class T>
bool operator!= (const Vector3< T > &u, const Vector3< T > &v)
template<class T>
bool operator== (const Vector3< T > &u, const Vector3< T > &v)
matrix operator- (const matrix &m1)
matrix operator+ (const matrix &m1, const matrix &m2)
matrix operator- (const matrix &m1, const matrix &m2)
matrix operator* (const matrix &m1, const matrix &m2)
matrix operator* (const double &s, const matrix &m)
matrix operator* (const matrix &m, const double &s)
matrix transpose (const matrix &m)
double trace_on (const matrix &A, const matrix &B)
double mdot (const matrix &A, const matrix &B)
Matrix3 operator+ (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "+" for two 3x3 matrices m1 and m2 i.e. m1+m2.
Matrix3 operator- (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "-" for two 3x3 matrices m1 and m2, i.e. m1-m2.
Matrix3 operator/ (const Matrix3 &m, const double &s)
 Overload operator "/" for a (Matrix3)/(scalar) i.e. m/s.
Matrix3 operator* (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "*" for two 3x3 matrices m1 and m2 i.e. m1*m2.
Matrix3 operator* (const Matrix3 &m, const double &s)
 Overload operator "*" for (Matrix3)*(scalar) i.e. m*s.
Matrix3 operator* (const double &s, const Matrix3 &m)
 Overload operator "*" for (scalar)*(Matrix3) i.e. s*m.
template<typename T>
ModuleBase::Vector3< double > operator* (const Matrix3 &m, const ModuleBase::Vector3< T > &u)
 Overload operator "*" for (Matrix3)*(Vector3).
template<typename T>
ModuleBase::Vector3< double > operator* (const ModuleBase::Vector3< T > &u, const Matrix3 &m)
 Overload operator "*" for (Vector3)*(Matrix3).
bool operator== (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "==" to assert the equality between two 3x3 matrices.
bool operator!= (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "!=" to assert the inequality between two 3x3 matrices.
ComplexArray operator* (const double r, const ComplexArray &cd)
 Scale a ComplexArray cd by real r.
ComplexArray operator* (const std::complex< double > c, const ComplexArray &cd)
 Scale a ComplexArray cd by std::complex number c.
double abs2 (const ComplexArray &cd)
 Sum of absolute squares of all elements in cd.
std::complex< double > dot (const ComplexArray &cd1, const ComplexArray &cd2)
 Take "dot-product" of two ComplexArray: sum of cd1(conjugate)[i] * cd2[i].
void scale_accumulate (double r, const ComplexArray &cd1, ComplexArray &cd2)
 Does cd2 += r * cd1.
void scale_accumulate (std::complex< double > c, const ComplexArray &cd1, ComplexArray &cd2)
 Does cd2 += c * cd1.
void scaled_sum (double r1, const ComplexArray &cd1, double r2, const ComplexArray &cd2, ComplexArray &cd3)
 Does cd3 = r1*cd1 + r2*cd2.
void scaled_sum (std::complex< double > c1, const ComplexArray &cd1, std::complex< double > c2, const ComplexArray &cd2, ComplexArray &cd3)
 Does cd3 = c1*cd1 + c2*cd2.
void point_mult (ComplexArray &a1, ComplexArray &in2, ComplexArray &out)
 out[i] = a1[i] * in2[i]
template<class T>
void zeros (std::complex< T > *u, int n)
 set elements of u as zero which u is 1_d std::complex array
ComplexMatrix operator+ (const ComplexMatrix &m1, const ComplexMatrix &m2)
ComplexMatrix operator- (const ComplexMatrix &m1, const ComplexMatrix &m2)
ComplexMatrix operator* (const ComplexMatrix &m1, const ComplexMatrix &m2)
ComplexMatrix operator* (const std::complex< double > &s, const ComplexMatrix &m)
ComplexMatrix operator* (const ComplexMatrix &m, const std::complex< double > &s)
ComplexMatrix operator* (const double &s, const ComplexMatrix &m)
ComplexMatrix operator* (const ComplexMatrix &m, const double &s)
std::complex< double > trace (const ComplexMatrix &m)
double abs2_row (const ComplexMatrix &m, const int ir)
double abs2_column (const ComplexMatrix &m, const int ic)
double abs2 (const ComplexMatrix &m)
double abs2 (const int nmat, ComplexMatrix **m)
ComplexMatrix transpose (const ComplexMatrix &m, const bool &conjugate)
ComplexMatrix conj (const ComplexMatrix &m)
void scale_accumulate (const std::complex< double > &s, const ComplexMatrix &min, ComplexMatrix &mout)
void scale_accumulate (const int &nmat, const std::complex< double > &s, ComplexMatrix **min, ComplexMatrix **mout)
void scaled_sum (const std::complex< double > &s1, const ComplexMatrix &m1, const std::complex< double > &s2, const ComplexMatrix &m2, ComplexMatrix &mout)
void scaled_sum (const int &nmat, const std::complex< double > &s1, ComplexMatrix **m1, const std::complex< double > &s2, ComplexMatrix **m2, ComplexMatrix **mout)
template<class T>
void zeros (T *u, const int n)
Vector3< double > net_force_vector (const int nat, const ModuleBase::matrix &force)
 Sum the per-atom Cartesian forces into the net force vector.
void remove_net_force (const int nat, ModuleBase::matrix &force)
 Remove the uniform net-force component in place (Newton's 3rd law).
const std::complex< double > ZERO (0.0, 0.0)
const std::complex< double > ONE (1.0, 0.0)
const std::complex< double > NEG_ONE (-1.0, 0.0)
const std::complex< double > IMAG_UNIT (0.0, 1.0)
const std::complex< double > NEG_IMAG_UNIT (0.0,-1.0)
void heapsort (int n, double *r, int *ind)
void heapAjust (double r[], int ind[], int s, int m)
void hpsort (int n, double *ra, int *ind)

Variables

constexpr double epsilon = 1e-10
const double PI = 3.14159265358979323846
const double PI_HALF = PI / 2.0
const double TWO_PI = 2 * PI
const double FOUR_PI = 4.0 * 3.14159265358979323846
const double INVERSE_FOUR_PI = 1.0/FOUR_PI
const double SQRT_INVERSE_FOUR_PI = sqrt(INVERSE_FOUR_PI)
const double SQRT2 = 1.41421356237309504880
const double K_BOLTZMAN_SI = 1.3806504e-23
const double K_BOLTZMAN_AU = 3.1667e-6
const double Hartree_to_K = 3.1577464e5
const double BOHR_RADIUS_SI = 0.529177e-10
const double BOHR_TO_A = 0.5291770
const double ELECTRONVOLT_SI = 1.6021892e-19
const double ANGSTROM_AU = 1.8897270
const double AU_to_FS = 2.418884326505e-2
const double e2 = 2.0
const double DEGSPIN = 2.0
const double Hartree_to_eV = 27.211396
const double Ry_to_eV = 13.605698
const double NA = 6.02214129e23
const double EMASS_SI = 9.1093826e-31
const double AU_to_MASS = NA*EMASS_SI*1e3
const double HARTREE_SI = 4.35974394e-18
const double RYDBERG_SI = HARTREE_SI/2.0
const double threshold_wg = 1.0e-10

Function Documentation

◆ abs2() [1/3]

double LCAO_domain::ModuleBase::abs2 ( const ComplexArray & cd)

Sum of absolute squares of all elements in cd.

◆ abs2() [2/3]

double LCAO_domain::ModuleBase::abs2 ( const ComplexMatrix & m)

◆ abs2() [3/3]

double LCAO_domain::ModuleBase::abs2 ( const int nmat,
ComplexMatrix ** m )

◆ abs2_column()

double LCAO_domain::ModuleBase::abs2_column ( const ComplexMatrix & m,
const int ic )

◆ abs2_row()

double LCAO_domain::ModuleBase::abs2_row ( const ComplexMatrix & m,
const int ir )

◆ CHECK_DOUBLE()

void LCAO_domain::ModuleBase::CHECK_DOUBLE ( std::ifstream & ifs,
const double & v,
bool quit = true )

Check the next input from ifs is double. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe double variable for checking
[in]quitWhether call WARNING_QUIT to quit or not

◆ CHECK_INT()

void LCAO_domain::ModuleBase::CHECK_INT ( std::ifstream & ifs,
const int & v,
bool quit = true )

Check the next input from ifs is integer. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe int variable for checking
[in]quitWhether call WARNING_QUIT to quit or not

◆ CHECK_NAME()

void LCAO_domain::ModuleBase::CHECK_NAME ( std::ifstream & ifs,
const std::string & name_in,
bool quit = true )

Check the next input from ifs is std::string. This is a global function.

Parameters
[in]ifsThe input file stream
[in]name_inThe name for checking
[in]quitWhether call WARNING_QUIT to quit or not

◆ CHECK_STRING()

void LCAO_domain::ModuleBase::CHECK_STRING ( std::ifstream & ifs,
const std::string & v,
bool quit = true )

Check the next input from ifs is std::string. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe std::string variable for checking
[in]quitWhether call WARNING_QUIT to quit or not

◆ CHECK_WARNING_QUIT()

void LCAO_domain::ModuleBase::CHECK_WARNING_QUIT ( const bool error,
const std::string & file,
const std::string & description )

Check, if true, WARNING_QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information

◆ conj()

ComplexMatrix LCAO_domain::ModuleBase::conj ( const ComplexMatrix & m)

◆ cross()

template<class T>
Vector3< T > LCAO_domain::ModuleBase::cross ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Cross product of two Vector3.

Parameters
u
v
Returns
template <class T>
Note
| i j k | | ux uy uz | | vx vy vz | u.v=(uy*vz-uz*vy)i+(-ux*vz+uz*vx)j+(ux*vy-uy*vx)k

◆ dot() [1/2]

std::complex< double > LCAO_domain::ModuleBase::dot ( const ComplexArray & cd1,
const ComplexArray & cd2 )

Take "dot-product" of two ComplexArray: sum of cd1(conjugate)[i] * cd2[i].

◆ dot() [2/2]

template<class T>
T LCAO_domain::ModuleBase::dot ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Dot productor of two Vector3.

Parameters
u
v
Returns
T
Note
u.v=(ux*vx)+(uy*vy)+(uz*vz)

◆ get_global_out_dir()

const std::string & LCAO_domain::ModuleBase::get_global_out_dir ( )

Read back the injected global output directory. Returns an empty string if set_quit_out_dir was never called.

◆ heapAjust()

void LCAO_domain::ModuleBase::heapAjust ( double r[],
int ind[],
int s,
int m )

◆ heapsort()

void LCAO_domain::ModuleBase::heapsort ( int n,
double * r,
int * ind )

◆ hpsort()

void LCAO_domain::ModuleBase::hpsort ( int n,
double * ra,
int * ind )

◆ IMAG_UNIT()

const std::complex< double > LCAO_domain::ModuleBase::IMAG_UNIT ( 0. 0,
1. 0 )

◆ mdot()

double LCAO_domain::ModuleBase::mdot ( const matrix & A,
const matrix & B )

◆ NEG_IMAG_UNIT()

const std::complex< double > LCAO_domain::ModuleBase::NEG_IMAG_UNIT ( 0. 0,
-1. 0 )

◆ NEG_ONE()

const std::complex< double > LCAO_domain::ModuleBase::NEG_ONE ( -1. 0,
0. 0 )

◆ net_force_vector()

Vector3< double > LCAO_domain::ModuleBase::net_force_vector ( const int nat,
const ModuleBase::matrix & force )
inline

Sum the per-atom Cartesian forces into the net force vector.

This is a pure matrix operation, independent of symmetry and of any external-field terms already contained in the input. Its norm is the quantity reported as the force drift.

Parameters
[in]natnumber of atoms
[in]forceper-atom Cartesian forces, nat x 3
Returns
net force vector, in the same unit as the input
Here is the caller graph for this function:

◆ ONE()

const std::complex< double > LCAO_domain::ModuleBase::ONE ( 1. 0,
0. 0 )

◆ operator!=() [1/2]

bool LCAO_domain::ModuleBase::operator!= ( const Matrix3 & m1,
const Matrix3 & m2 )

Overload operator "!=" to assert the inequality between two 3x3 matrices.

Parameters
m1
m2
Returns
true: if two matrices are inequal
false: if they equal

◆ operator!=() [2/2]

template<class T>
bool LCAO_domain::ModuleBase::operator!= ( const Vector3< T > & u,
const Vector3< T > & v )
inline

◆ operator*() [1/18]

ComplexMatrix LCAO_domain::ModuleBase::operator* ( const ComplexMatrix & m,
const double & s )

◆ operator*() [2/18]

ComplexMatrix LCAO_domain::ModuleBase::operator* ( const ComplexMatrix & m,
const std::complex< double > & s )

◆ operator*() [3/18]

ComplexMatrix LCAO_domain::ModuleBase::operator* ( const ComplexMatrix & m1,
const ComplexMatrix & m2 )

◆ operator*() [4/18]

ComplexMatrix LCAO_domain::ModuleBase::operator* ( const double & s,
const ComplexMatrix & m )

◆ operator*() [5/18]

matrix LCAO_domain::ModuleBase::operator* ( const double & s,
const matrix & m )

◆ operator*() [6/18]

Matrix3 LCAO_domain::ModuleBase::operator* ( const double & s,
const Matrix3 & m )

Overload operator "*" for (scalar)*(Matrix3) i.e. s*m.

Parameters
sThe scalar
mThe 3x3 matrix
Returns
Matrix3

◆ operator*() [7/18]

ComplexArray LCAO_domain::ModuleBase::operator* ( const double r,
const ComplexArray & cd )

Scale a ComplexArray cd by real r.

◆ operator*() [8/18]

matrix LCAO_domain::ModuleBase::operator* ( const matrix & m,
const double & s )

◆ operator*() [9/18]

matrix LCAO_domain::ModuleBase::operator* ( const matrix & m1,
const matrix & m2 )

◆ operator*() [10/18]

Matrix3 LCAO_domain::ModuleBase::operator* ( const Matrix3 & m,
const double & s )

Overload operator "*" for (Matrix3)*(scalar) i.e. m*s.

Parameters
mThe 3x3 matrix
sThe scalar
Returns
Matrix3

◆ operator*() [11/18]

template<typename T>
ModuleBase::Vector3< double > LCAO_domain::ModuleBase::operator* ( const Matrix3 & m,
const ModuleBase::Vector3< T > & u )

Overload operator "*" for (Matrix3)*(Vector3).

Template Parameters
T
Parameters
mThe 3x3 matrix
uThe vector with 3 elements
Returns
ModuleBase::Vector3<double>
Author
Peize Lin

◆ operator*() [12/18]

Matrix3 LCAO_domain::ModuleBase::operator* ( const Matrix3 & m1,
const Matrix3 & m2 )

Overload operator "*" for two 3x3 matrices m1 and m2 i.e. m1*m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator*() [13/18]

template<typename T>
ModuleBase::Vector3< double > LCAO_domain::ModuleBase::operator* ( const ModuleBase::Vector3< T > & u,
const Matrix3 & m )

Overload operator "*" for (Vector3)*(Matrix3).

Template Parameters
T
Parameters
uThe vector with 3 elements
mThe 3x3 matrix
Returns
ModuleBase::Vector3<double>

◆ operator*() [14/18]

ComplexMatrix LCAO_domain::ModuleBase::operator* ( const std::complex< double > & s,
const ComplexMatrix & m )

◆ operator*() [15/18]

ComplexArray LCAO_domain::ModuleBase::operator* ( const std::complex< double > c,
const ComplexArray & cd )

Scale a ComplexArray cd by std::complex number c.

◆ operator*() [16/18]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator* ( const T & s,
const Vector3< T > & u )
inline

Overload "*" to calculate (Vector3)*scalar.

Parameters
[in]s
[in]u
Returns
Vector3<T>

◆ operator*() [17/18]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator* ( const Vector3< T > & u,
const T & s )
inline

Overload "*" to calculate scalar*(Vector3).

Parameters
u
s
Returns
Vector3<T>

◆ operator*() [18/18]

template<class T>
T LCAO_domain::ModuleBase::operator* ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Overload "*" to calculate the dot product of two Vector3.

Parameters
u
v
Returns
template <class T>

◆ operator+() [1/4]

ComplexMatrix LCAO_domain::ModuleBase::operator+ ( const ComplexMatrix & m1,
const ComplexMatrix & m2 )

◆ operator+() [2/4]

matrix LCAO_domain::ModuleBase::operator+ ( const matrix & m1,
const matrix & m2 )

◆ operator+() [3/4]

Matrix3 LCAO_domain::ModuleBase::operator+ ( const Matrix3 & m1,
const Matrix3 & m2 )

Overload operator "+" for two 3x3 matrices m1 and m2 i.e. m1+m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator+() [4/4]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator+ ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Overload "+" for two Vector3.

Parameters
[in]u
[in]v
Returns
Vector3<T>

◆ operator-() [1/5]

ComplexMatrix LCAO_domain::ModuleBase::operator- ( const ComplexMatrix & m1,
const ComplexMatrix & m2 )

◆ operator-() [2/5]

matrix LCAO_domain::ModuleBase::operator- ( const matrix & m1)

◆ operator-() [3/5]

matrix LCAO_domain::ModuleBase::operator- ( const matrix & m1,
const matrix & m2 )

◆ operator-() [4/5]

Matrix3 LCAO_domain::ModuleBase::operator- ( const Matrix3 & m1,
const Matrix3 & m2 )

Overload operator "-" for two 3x3 matrices m1 and m2, i.e. m1-m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator-() [5/5]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator- ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Overload "-" for two Vector3.

Parameters
[in]u
[in]v
Returns
Vector3<T>

◆ operator/() [1/3]

Matrix3 LCAO_domain::ModuleBase::operator/ ( const Matrix3 & m,
const double & s )

Overload operator "/" for a (Matrix3)/(scalar) i.e. m/s.

Parameters
mThe 3x3 matrix
sThe scalar
Returns
Matrix3

◆ operator/() [2/3]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator/ ( const T & s,
const Vector3< T > & u )
inline

Overload "/" to calculate scalar/Vector3.

Template Parameters
T
Parameters
s
u
Returns
Vector3<T>

◆ operator/() [3/3]

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator/ ( const Vector3< T > & u,
const T & s )
inline

Overload "/" to calculate Vector3/scalar.

Template Parameters
T
Parameters
u
s
Returns
Vector3<T>

◆ operator<()

template<class T>
bool LCAO_domain::ModuleBase::operator< ( const Vector3< T > & u,
const Vector3< T > & v )

◆ operator==() [1/2]

bool LCAO_domain::ModuleBase::operator== ( const Matrix3 & m1,
const Matrix3 & m2 )

Overload operator "==" to assert the equality between two 3x3 matrices.

Parameters
m1
m2
Returns
true: if two matrices equal each other
false: if they do not equal

◆ operator==() [2/2]

template<class T>
bool LCAO_domain::ModuleBase::operator== ( const Vector3< T > & u,
const Vector3< T > & v )
inline

◆ operator^()

template<class T>
Vector3< T > LCAO_domain::ModuleBase::operator^ ( const Vector3< T > & u,
const Vector3< T > & v )
inline

Overload "^" for cross product of two Vector3.

Parameters
u
v
Returns
template <class T>
Note
| i j k | | ux uy uz | | vx vy vz | u.v=(uy*vz-uz*vy)i+(-ux*vz+uz*vx)j+(ux*vy-uy*vx)k

◆ point_mult()

void LCAO_domain::ModuleBase::point_mult ( ComplexArray & a1,
ComplexArray & in2,
ComplexArray & out )

out[i] = a1[i] * in2[i]

◆ QUIT() [1/2]

void LCAO_domain::ModuleBase::QUIT ( int ret)

Close .log files and exit.

◆ QUIT() [2/2]

void LCAO_domain::ModuleBase::QUIT ( void )

Close .log files and exit.

◆ remove_net_force()

void LCAO_domain::ModuleBase::remove_net_force ( const int nat,
ModuleBase::matrix & force )
inline

Remove the uniform net-force component in place (Newton's 3rd law).

Subtract the per-component mean force so the total force sums to zero. This is a pure matrix operation, independent of symmetry. Shared by the PW and LCAO force paths. Not applied when an external field (gate/efield) is present.

Parameters
[in]natnumber of atoms
[in,out]forceper-atom Cartesian forces, nat x 3, modified in place
Here is the caller graph for this function:

◆ scale_accumulate() [1/4]

void LCAO_domain::ModuleBase::scale_accumulate ( const int & nmat,
const std::complex< double > & s,
ComplexMatrix ** min,
ComplexMatrix ** mout )

◆ scale_accumulate() [2/4]

void LCAO_domain::ModuleBase::scale_accumulate ( const std::complex< double > & s,
const ComplexMatrix & min,
ComplexMatrix & mout )

◆ scale_accumulate() [3/4]

void LCAO_domain::ModuleBase::scale_accumulate ( double r,
const ComplexArray & cd1,
ComplexArray & cd2 )

Does cd2 += r * cd1.

◆ scale_accumulate() [4/4]

void LCAO_domain::ModuleBase::scale_accumulate ( std::complex< double > c,
const ComplexArray & cd1,
ComplexArray & cd2 )

Does cd2 += c * cd1.

◆ scaled_sum() [1/4]

void LCAO_domain::ModuleBase::scaled_sum ( const int & nmat,
const std::complex< double > & s1,
ComplexMatrix ** m1,
const std::complex< double > & s2,
ComplexMatrix ** m2,
ComplexMatrix ** mout )

◆ scaled_sum() [2/4]

void LCAO_domain::ModuleBase::scaled_sum ( const std::complex< double > & s1,
const ComplexMatrix & m1,
const std::complex< double > & s2,
const ComplexMatrix & m2,
ComplexMatrix & mout )

◆ scaled_sum() [3/4]

void LCAO_domain::ModuleBase::scaled_sum ( double r1,
const ComplexArray & cd1,
double r2,
const ComplexArray & cd2,
ComplexArray & cd3 )

Does cd3 = r1*cd1 + r2*cd2.

◆ scaled_sum() [4/4]

void LCAO_domain::ModuleBase::scaled_sum ( std::complex< double > c1,
const ComplexArray & cd1,
std::complex< double > c2,
const ComplexArray & cd2,
ComplexArray & cd3 )

Does cd3 = c1*cd1 + c2*cd2.

◆ set_quit_calculation()

void LCAO_domain::ModuleBase::set_quit_calculation ( const std::string & calculation)

Inject the calculation tag used by CHECK_WARNING_QUIT to compose the fallback log filename ("running_<calculation>.log") when ofs_running is not already open.

Caller-injected (typically once after input parameters are read). If never set, the fallback filename uses an empty tag.

◆ set_quit_out_dir()

void LCAO_domain::ModuleBase::set_quit_out_dir ( const std::string & dir)

Inject the global output directory used by QUIT/WARNING_QUIT/CHECK_WARNING_QUIT for log path resolution and user-facing messages.

Caller-injected (typically once after input parameters are read). If never set, paths fall back to CWD.

◆ TITLE() [1/2]

void LCAO_domain::ModuleBase::TITLE ( const std::string & class_name,
const std::string & function_name = "",
const bool disable = true )
Here is the caller graph for this function:

◆ TITLE() [2/2]

void LCAO_domain::ModuleBase::TITLE ( std::ofstream & ofs,
const std::string & class_name,
const std::string & function_name,
const bool disable = true )

◆ trace()

std::complex< double > LCAO_domain::ModuleBase::trace ( const ComplexMatrix & m)

◆ trace_on()

double LCAO_domain::ModuleBase::trace_on ( const matrix & A,
const matrix & B )

◆ transpose() [1/2]

ComplexMatrix LCAO_domain::ModuleBase::transpose ( const ComplexMatrix & m,
const bool & conjugate )

◆ transpose() [2/2]

matrix LCAO_domain::ModuleBase::transpose ( const matrix & m)

◆ WARNING()

void LCAO_domain::ModuleBase::WARNING ( const std::string & file,
const std::string & description )

Print out warning information in warning.log file.

Parameters
fileThe file where warning happens
descriptionThe warning information
Here is the caller graph for this function:

◆ WARNING_QUIT() [1/2]

void LCAO_domain::ModuleBase::WARNING_QUIT ( const std::string & file,
const std::string & description )

Combine the functions of WARNING and QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information
Here is the caller graph for this function:

◆ WARNING_QUIT() [2/2]

void LCAO_domain::ModuleBase::WARNING_QUIT ( const std::string & file,
const std::string & description,
int ret )

Combine the functions of WARNING and QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information

◆ ZERO()

const std::complex< double > LCAO_domain::ModuleBase::ZERO ( 0. 0,
0. 0 )
Here is the caller graph for this function:

◆ zeros() [1/2]

template<class T>
void LCAO_domain::ModuleBase::zeros ( std::complex< T > * u,
int n )

set elements of u as zero which u is 1_d std::complex array

◆ zeros() [2/2]

template<class T>
void LCAO_domain::ModuleBase::zeros ( T * u,
const int n )

Variable Documentation

◆ ANGSTROM_AU

const double LCAO_domain::ModuleBase::ANGSTROM_AU = 1.8897270

◆ AU_to_FS

const double LCAO_domain::ModuleBase::AU_to_FS = 2.418884326505e-2

◆ AU_to_MASS

const double LCAO_domain::ModuleBase::AU_to_MASS = NA*EMASS_SI*1e3

◆ BOHR_RADIUS_SI

const double LCAO_domain::ModuleBase::BOHR_RADIUS_SI = 0.529177e-10

◆ BOHR_TO_A

const double LCAO_domain::ModuleBase::BOHR_TO_A = 0.5291770

◆ DEGSPIN

const double LCAO_domain::ModuleBase::DEGSPIN = 2.0

◆ e2

const double LCAO_domain::ModuleBase::e2 = 2.0

◆ ELECTRONVOLT_SI

const double LCAO_domain::ModuleBase::ELECTRONVOLT_SI = 1.6021892e-19

◆ EMASS_SI

const double LCAO_domain::ModuleBase::EMASS_SI = 9.1093826e-31

◆ epsilon

double LCAO_domain::ModuleBase::epsilon = 1e-10
constexpr

◆ FOUR_PI

const double LCAO_domain::ModuleBase::FOUR_PI = 4.0 * 3.14159265358979323846

◆ HARTREE_SI

const double LCAO_domain::ModuleBase::HARTREE_SI = 4.35974394e-18

◆ Hartree_to_eV

const double LCAO_domain::ModuleBase::Hartree_to_eV = 27.211396

◆ Hartree_to_K

const double LCAO_domain::ModuleBase::Hartree_to_K = 3.1577464e5

◆ INVERSE_FOUR_PI

const double LCAO_domain::ModuleBase::INVERSE_FOUR_PI = 1.0/FOUR_PI

◆ K_BOLTZMAN_AU

const double LCAO_domain::ModuleBase::K_BOLTZMAN_AU = 3.1667e-6

◆ K_BOLTZMAN_SI

const double LCAO_domain::ModuleBase::K_BOLTZMAN_SI = 1.3806504e-23

◆ NA

const double LCAO_domain::ModuleBase::NA = 6.02214129e23

◆ PI

const double LCAO_domain::ModuleBase::PI = 3.14159265358979323846

◆ PI_HALF

const double LCAO_domain::ModuleBase::PI_HALF = PI / 2.0

◆ Ry_to_eV

const double LCAO_domain::ModuleBase::Ry_to_eV = 13.605698

◆ RYDBERG_SI

const double LCAO_domain::ModuleBase::RYDBERG_SI = HARTREE_SI/2.0

◆ SQRT2

const double LCAO_domain::ModuleBase::SQRT2 = 1.41421356237309504880

◆ SQRT_INVERSE_FOUR_PI

const double LCAO_domain::ModuleBase::SQRT_INVERSE_FOUR_PI = sqrt(INVERSE_FOUR_PI)

◆ threshold_wg

const double LCAO_domain::ModuleBase::threshold_wg = 1.0e-10

◆ TWO_PI

const double LCAO_domain::ModuleBase::TWO_PI = 2 * PI