|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Namespaces | |
| namespace | Element_Basis_Index |
| namespace | GlobalFunc |
| namespace | Global_File |
| namespace | libm |
| namespace | cuda_compat |
Classes | |
| class | Clebsch_Gordan |
| class | ComplexArray |
| A basic type of data for complex array. More... | |
| class | ComplexMatrix |
| class | CubicSpline |
| Cubic spline interplation. More... | |
| class | Gram_Schmidt_Orth |
| class | IntArray |
| Integer array. More... | |
| class | Inverse_Matrix_Complex |
| struct | gemv_op< T, base_device::DEVICE_CPU > |
| struct | gemm_op< T, base_device::DEVICE_CPU > |
| struct | matrixTranspose_op< T, base_device::DEVICE_CPU > |
| struct | matrixCopy< T, base_device::DEVICE_CPU > |
| struct | matrix_mul_vector_op< T, base_device::DEVICE_CPU > |
| struct | scal_op |
| struct | vector_mul_real_op |
| struct | vector_mul_vector_op |
| struct | vector_mul_vector_op< T, base_device::DEVICE_CPU, Operand > |
| struct | vector_div_constant_op |
| struct | vector_div_vector_op |
| struct | vector_div_vector_op< T, base_device::DEVICE_CPU, Operand > |
| struct | axpy_op |
| struct | vector_add_vector_op |
| struct | vector_add_vector_op< T, base_device::DEVICE_CPU, Scalar > |
| struct | dot_real_op |
| struct | gemv_op |
| struct | trmm_op |
| struct | gemm_op |
| struct | matrixTranspose_op |
| struct | matrixCopy |
| struct | matrix_mul_vector_op |
| struct | apply_eigenvalues_op |
| struct | precondition_op |
| struct | normalize_op |
| struct | normalize_op< T, base_device::DEVICE_GPU > |
| struct | scal_op< FPTYPE, base_device::DEVICE_CPU > |
| struct | vector_mul_real_op< T, base_device::DEVICE_CPU > |
| struct | vector_div_constant_op< T, base_device::DEVICE_CPU > |
| struct | axpy_op< T, base_device::DEVICE_CPU > |
| struct | dot_real_op< FPTYPE, base_device::DEVICE_CPU > |
| struct | dot_real_op< std::complex< FPTYPE >, base_device::DEVICE_CPU > |
| struct | cal_ylm_real_op< FPTYPE, base_device::DEVICE_CPU > |
| struct | cal_ylm_real_op |
| class | Bspline |
| A class to treat Cardinal B-spline interpolation. More... | |
| class | FFTW |
| class | Chebyshev |
| A class to treat the Chebyshev expansion. More... | |
| class | FFTW< double > |
| class | ErrorFunc |
| class | Integral |
| class | Lebedev_laikov_grid |
| class | PolyInt |
| class | Sphbes |
| class | YlmReal |
| class | Mathzone |
| atomic coordinates conversion functions More... | |
| class | Mathzone_Add1 |
| class | matrix |
| class | Matrix3 |
| 3x3 matrix and related mathamatical operations More... | |
| struct | MatrixBlock |
| A non-owning description of a matrix stored in memory. More... | |
| class | Matrix_Wrapper |
| class | Memory |
| Record memory consumption during computation. More... | |
| class | FFT_BASE |
| class | FFT_Bundle |
| struct | FFT_Guard |
| class | FFT_CPU |
| class | FFT_CUDA |
| class | FFT_DSP |
| class | FFT_ROCM |
| class | Opt_CG |
| A class designed to deal with optimization problems with CG method. Three forms of CG methods have been implemented, including standard flow to solve the linear equation Ax = b, Polak-Ribire (PR) form and Hager-Zhang (HZ) form to solve general optimization problems min{f(x)}. We adopt following abbreviation x -> solution d -> direction g -> gradient. More... | |
| class | Opt_DCsrch |
| A interface to line search. More... | |
| class | Opt_TN |
| A class designed to deal with optimization problems with Truncated-Newton (TN) method. At each step, the optimization direction d is determined by roughly solving linear equation Hd=-g, where H is Hessian matrix of f(x), and g is the gradient df(x)/dx. In this section, we get Hd by interpolation, and solve Hd=-g with CG method. We set three truncated conditions: 1) the residual of CG method has decreased more than 90%; 2) the number of CG iteration is more than 50; 3) the residual of CG method doesn't decrease and the CG iteration is larger than 9. More... | |
| class | PGemmCN |
| this class is used to perform parallel matrix multiplication C = alpha * A^H * B + beta * C Here, A and B are local matrices in each proc, C can be C_local or C_global, depending on the value of gatherC C_local is a local matrix in each proc C_global is a global matrix gathered from all procs and all procs have their own C_global matrix with the same C_global and C_local have the same LDC, but different column numbers values. More... | |
| class | CommunicationDomain |
| class | Random |
| class | realArray |
| double float array More... | |
| class | Sph_Bessel_Recursive |
| class | Sph_Bessel_Recursive_Pool |
| class | SphericalBesselTransformer |
| A class that provides spherical Bessel transforms. More... | |
| class | timer |
| Tracing computation time. More... | |
| class | Vector3 |
| 3 elements vector More... | |
| class | Ylm |
Typedefs | |
| typedef double | TimePoint |
| Time point type that works in both MPI and non-MPI environments. | |
Functions | |
| void | complexArrayxAlloc () |
| 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 > &c, const ComplexMatrix &m) |
| ComplexMatrix | operator* (const ComplexMatrix &m, const std::complex< double > &c) |
| ComplexMatrix | operator* (const double &r, const ComplexMatrix &m) |
| ComplexMatrix | operator* (const ComplexMatrix &m, const double &r) |
| std::complex< double > | trace (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) |
| 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) |
| 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) |
| std::string | absolute_path_for_log (const std::string &path) |
| Return an absolute path for logging, or the original path if getcwd fails. | |
| int | make_directory (const std::string &path) |
| Create a single directory, portably. | |
| bool | ensure_directory (const std::string &path) |
| Ensure a directory exists, creating it lazily if needed. | |
| void | IntArrayAlloc () |
| void | Inverse_Matrix_Real (const int dim, const double *in, double *out) |
| computes the inverse of a dim*dim real matrix "in" using LAPACK routines "out" contains the inverse on output; "in" is unchanged | |
| void | gram_herk_cpu (int ld, int dim, int bands, const std::complex< double > *x, std::complex< double > *output) |
| std::complex< double > | set_real_tocomplex (const std::complex< double > &x) |
| std::complex< float > | set_real_tocomplex (const std::complex< float > &x) |
| double | set_real_tocomplex (const double &x) |
| float | set_real_tocomplex (const float &x) |
| std::complex< double > | get_conj (const std::complex< double > &x) |
| std::complex< float > | get_conj (const std::complex< float > &x) |
| double | get_conj (const double &x) |
| float | get_conj (const float &x) |
| template<typename FPTYPE> | |
| __inline__ FPTYPE | __fact (const int n) |
| __inline__ int | __semi_fact (const int n) |
| template void | YlmReal::Ylm_Real< float, base_device::DEVICE_CPU > (base_device::DEVICE_CPU *, int, int, const float *, float *) |
| template void | YlmReal::Ylm_Real< double, base_device::DEVICE_CPU > (base_device::DEVICE_CPU *, int, int, const double *, double *) |
| 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). | |
| void | matrixAlloc () |
| 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. | |
| 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. | |
| 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). | |
| void | WARNING_QUIT (const std::string &file, const std::string &description) |
| Combine the functions of WARNING and QUIT. | |
| void | heapAjust (double *r, int *ind, int s, int m) |
| void | heapsort (const int n, double *r, int *ind) |
| void | hpsort (int n, double *ra, int *ind) |
| void | heapAjust (double r[], int ind[], int s, int m) |
| int | dcsrch (double &stp, double &f, double &g, double &ftol, double >ol, double &xtol, std::string &task, double &stpmin, double &stpmax, int *isave, double *dsave) |
| void | dcstep (double &stx, double &fx, double &dx, double &sty, double &fy, double &dy, double &stp, double &fp, double &dp, bool &brackt, double &stpmin, double &stpmax) |
| CommunicationDomain | world_comm_domain () |
| void | realArrayAlloc () |
| template<class T> | |
| void | zeros (T *u, const int n) |
| void | WARNING (const std::string &file, const std::string &description) |
| Print out warning information in warning.log file. | |
| void | WARNING_QUIT (const std::string &file, const std::string &description, int ret) |
| Combine the functions of WARNING and QUIT. | |
| TimePoint | get_time () |
| Get current time as a TimePoint. | |
| double | get_duration (const TimePoint &start, const TimePoint &end) |
| Calculate duration between two TimePoints in seconds. | |
| 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 | 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 | CHECK_WARNING_QUIT (const bool error, const std::string &file, const std::string &description) |
| Check, if true, WARNING_QUIT. | |
| template<typename T_task, typename T_out> | |
| void | TASK_DIST_1D (int nworker, int iworker, T_task ntask, T_out &start, T_out &len) |
| template<typename T_task, typename T_out> | |
| void | BLOCK_TASK_DIST_1D (int nworker, int iworker, T_task ntask, T_task block_size, T_out &start, T_out &len) |
| void | OMP_PARALLEL (const std::function< void(int, int)> &f) |
| void | TRY_OMP_PARALLEL (const std::function< void(int, int)> &f) |
| void | TITLE (const std::string &class_name, const std::string &function_name, const bool disable) |
| void | TITLE (std::ofstream &ofs, const std::string &class_name, const std::string &function_name, const bool disable) |
| template<typename FPTYPE> | |
| FPTYPE | truncated_exp (FPTYPE x) |
| Truncated exponential function to avoid underflow. | |
| template<typename FPTYPE> | |
| FPTYPE | truncated_erfc (FPTYPE x) |
| Truncated complementary error function to avoid underflow for large arguments. | |
| template<typename FPTYPE> | |
| void | truncated_underflow (FPTYPE &x) |
| Truncated value function to avoid underflow. | |
| template<> | |
| void | truncated_underflow (double &x) |
| template<> | |
| void | truncated_underflow (float &x) |
| template<typename T> | |
| void | truncated_underflow (std::complex< T > &x) |
| 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) |
| void | TITLE (const std::string &class_function_name, bool disable) |
| template<class Archive, typename T> | |
| void | serialize (Archive &ar, Vector3< T > &v) |
| template<class Archive> | |
| void | save (Archive &ar, const matrix &m) |
| template<class Archive> | |
| void | load (Archive &ar, matrix &m) |
| template<typename T> | |
| void | bcast_data_cereal (T &data, const MPI_Comm &mpi_comm, const int &rank_bcast) |
Variables | |
| 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 |
| const std::map< std::string, double > | CovalentRadius |
| const std::map< std::string, std::string > | EleConfig |
| const std::map< std::string, int > | MinZval |
| const std::map< std::string, int > | IsTransMetal |
| const double | memory_warning_threshold_mb = 20.0 |
| const std::string | Name_Angular [5][11] |
| constexpr double | epsilon = 1e-10 |
| constexpr int | YLMCOEF_SIZE = 36 |
| ylmcoef coefficient count (supports up to L=5) | |
Tested functions of class matrix:
Tested functions related to class matrix
| typedef double ModuleBase::TimePoint |
Time point type that works in both MPI and non-MPI environments.
| __inline__ FPTYPE ModuleBase::__fact | ( | const int | n | ) |
| __inline__ int ModuleBase::__semi_fact | ( | const int | n | ) |
| double ModuleBase::abs2 | ( | const ComplexArray & | cd | ) |
Sum of absolute squares of all elements in cd.
| double ModuleBase::abs2 | ( | const ComplexMatrix & | m | ) |
| double ModuleBase::abs2 | ( | const int | nmat, |
| ComplexMatrix ** | m ) |
| double ModuleBase::abs2_column | ( | const ComplexMatrix & | m, |
| const int | ic ) |
| double ModuleBase::abs2_row | ( | const ComplexMatrix & | m, |
| const int | ir ) |
|
inline |
Return an absolute path for logging, or the original path if getcwd fails.
| void ModuleBase::bcast_data_cereal | ( | T & | data, |
| const MPI_Comm & | mpi_comm, | ||
| const int & | rank_bcast ) |
|
inline |
| void 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.
| [in] | ifs | The input file stream |
| [in] | v | The double variable for checking |
| [in] | quit | Whether call WARNING_QUIT to quit or not |
| void 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.
| [in] | ifs | The input file stream |
| [in] | v | The int variable for checking |
| [in] | quit | Whether call WARNING_QUIT to quit or not |
| void 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.
| [in] | ifs | The input file stream |
| [in] | name_in | The name for checking |
| [in] | quit | Whether call WARNING_QUIT to quit or not |
| void 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.
| [in] | ifs | The input file stream |
| [in] | v | The std::string variable for checking |
| [in] | quit | Whether call WARNING_QUIT to quit or not |
| void ModuleBase::CHECK_WARNING_QUIT | ( | const bool | error, |
| const std::string & | file, | ||
| const std::string & | description ) |
Check, if true, WARNING_QUIT.
| file | The file where warning happens |
| description | The warning information |
| void ModuleBase::complexArrayxAlloc | ( | ) |
| ComplexMatrix ModuleBase::conj | ( | const ComplexMatrix & | m | ) |
|
inline |
Cross product of two Vector3.
| u | |
| v |
| int ModuleBase::dcsrch | ( | double & | stp, |
| double & | f, | ||
| double & | g, | ||
| double & | ftol, | ||
| double & | gtol, | ||
| double & | xtol, | ||
| std::string & | task, | ||
| double & | stpmin, | ||
| double & | stpmax, | ||
| int * | isave, | ||
| double * | dsave ) |
| void ModuleBase::dcstep | ( | double & | stx, |
| double & | fx, | ||
| double & | dx, | ||
| double & | sty, | ||
| double & | fy, | ||
| double & | dy, | ||
| double & | stp, | ||
| double & | fp, | ||
| double & | dp, | ||
| bool & | brackt, | ||
| double & | stpmin, | ||
| double & | stpmax ) |
| std::complex< double > ModuleBase::dot | ( | const ComplexArray & | cd1, |
| const ComplexArray & | cd2 ) |
Take "dot-product" of two ComplexArray: sum of cd1(conjugate)[i] * cd2[i].
|
inline |
Ensure a directory exists, creating it lazily if needed.
Intended for write-time directory creation: output writers call this just before writing a file into a directory that may not exist yet, instead of relying on a central startup routine to predict which directories will be needed. An already-existing directory (EEXIST) is not an error, so callers on different MPI ranks may invoke it concurrently for the same path. The parent directory must already exist (only one level is created).
| path | directory path to ensure; an empty path is accepted as a no-op |
|
inline |
|
inline |
|
inline |
|
inline |
Calculate duration between two TimePoints in seconds.
| start | Start time point |
| end | End time point |
| const std::string & ModuleBase::get_global_out_dir | ( | ) |
Read back the injected global output directory. Returns an empty string if set_quit_out_dir was never called.
|
inline |
| void ModuleBase::gram_herk_cpu | ( | int | ld, |
| int | dim, | ||
| int | bands, | ||
| const std::complex< double > * | x, | ||
| std::complex< double > * | output ) |
Compute the upper triangle of column-major X^H X in double precision. X has dim valid rows, bands columns and leading dimension ld. Output has leading dimension bands; its lower triangle is not read or written. Pointers belong to CPU. The caller completes the Hermitian matrix.
| void ModuleBase::heapAjust | ( | double * | r, |
| int * | ind, | ||
| int | s, | ||
| int | m ) |
| void ModuleBase::heapAjust | ( | double | r[], |
| int | ind[], | ||
| int | s, | ||
| int | m ) |
| void ModuleBase::heapsort | ( | const int | n, |
| double * | r, | ||
| int * | ind ) |
| void ModuleBase::hpsort | ( | int | n, |
| double * | ra, | ||
| int * | ind ) |
| const std::complex< double > ModuleBase::IMAG_UNIT | ( | 0. | 0, |
| 1. | 0 ) |
| void ModuleBase::IntArrayAlloc | ( | ) |
| void ModuleBase::Inverse_Matrix_Real | ( | const int | dim, |
| const double * | in, | ||
| double * | out ) |
computes the inverse of a dim*dim real matrix "in" using LAPACK routines "out" contains the inverse on output; "in" is unchanged
| dim | [in] dimension of the matrix |
| in | [in] input matrix |
| out | [out] output matrix |
| void ModuleBase::load | ( | Archive & | ar, |
| matrix & | m ) |
|
inline |
Create a single directory, portably.
| path | directory path to create |
On Windows the permission mode is not applicable and is ignored; on POSIX systems the directory is created with mode 0755 (subject to umask), preserving the previous behaviour of the call sites.
| void ModuleBase::matrixAlloc | ( | ) |
| const std::complex< double > ModuleBase::NEG_IMAG_UNIT | ( | 0. | 0, |
| -1. | 0 ) |
| const std::complex< double > ModuleBase::NEG_ONE | ( | -1. | 0, |
| 0. | 0 ) |
|
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.
| [in] | nat | number of atoms |
| [in] | force | per-atom Cartesian forces, nat x 3 |
|
inline |
| const std::complex< double > ModuleBase::ONE | ( | 1. | 0, |
| 0. | 0 ) |
Overload operator "!=" to assert the inequality between two 3x3 matrices.
| m1 | |
| m2 |
= defined in terms of operator ==
|
inline |
| ComplexMatrix ModuleBase::operator* | ( | const ComplexMatrix & | m, |
| const double & | r ) |
| ComplexMatrix ModuleBase::operator* | ( | const ComplexMatrix & | m, |
| const std::complex< double > & | c ) |
| ComplexMatrix ModuleBase::operator* | ( | const ComplexMatrix & | m1, |
| const ComplexMatrix & | m2 ) |
| ComplexMatrix ModuleBase::operator* | ( | const double & | r, |
| const ComplexMatrix & | m ) |
| ComplexArray ModuleBase::operator* | ( | const double | r, |
| const ComplexArray & | cd ) |
Scale a ComplexArray cd by real r.
| ModuleBase::Vector3< double > ModuleBase::operator* | ( | const Matrix3 & | m, |
| const ModuleBase::Vector3< T > & | u ) |
Overload operator "*" for (Matrix3)*(Vector3).
| T |
| m | The 3x3 matrix |
| u | The vector with 3 elements |
| ModuleBase::Vector3< double > ModuleBase::operator* | ( | const ModuleBase::Vector3< T > & | u, |
| const Matrix3 & | m ) |
Overload operator "*" for (Vector3)*(Matrix3).
| T |
| u | The vector with 3 elements |
| m | The 3x3 matrix |
| ComplexMatrix ModuleBase::operator* | ( | const std::complex< double > & | c, |
| const ComplexMatrix & | m ) |
| ComplexArray ModuleBase::operator* | ( | const std::complex< double > | c, |
| const ComplexArray & | cd ) |
Scale a ComplexArray cd by std::complex number c.
| ComplexMatrix ModuleBase::operator+ | ( | const ComplexMatrix & | m1, |
| const ComplexMatrix & | m2 ) |
| ComplexMatrix ModuleBase::operator- | ( | const ComplexMatrix & | m1, |
| const ComplexMatrix & | m2 ) |
Overload operator "==" to assert the equality between two 3x3 matrices.
| m1 | |
| m2 |
|
inline |
|
inline |
Overload "^" for cross product of two Vector3.
| u | |
| v |
| void ModuleBase::point_mult | ( | ComplexArray & | in1, |
| ComplexArray & | in2, | ||
| ComplexArray & | out ) |
out[i] = a1[i] * in2[i]
| void ModuleBase::QUIT | ( | int | ret | ) |
Close .log files and exit.
| void ModuleBase::QUIT | ( | ) |
Close .log files and exit.
| void ModuleBase::realArrayAlloc | ( | ) |
|
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.
| [in] | nat | number of atoms |
| [in,out] | force | per-atom Cartesian forces, nat x 3, modified in place |
| void ModuleBase::save | ( | Archive & | ar, |
| const matrix & | m ) |
| void ModuleBase::scale_accumulate | ( | const int & | nmat, |
| const std::complex< double > & | s, | ||
| ComplexMatrix ** | min, | ||
| ComplexMatrix ** | mout ) |
| void ModuleBase::scale_accumulate | ( | const std::complex< double > & | s, |
| const ComplexMatrix & | min, | ||
| ComplexMatrix & | mout ) |
| void ModuleBase::scale_accumulate | ( | double | r, |
| const ComplexArray & | cd1, | ||
| ComplexArray & | cd2 ) |
Does cd2 += r * cd1.
| void ModuleBase::scale_accumulate | ( | const std::complex< double > | c, |
| const ComplexArray & | cd1, | ||
| ComplexArray & | cd2 ) |
Does cd2 += c * cd1.
| void ModuleBase::scaled_sum | ( | const int & | nmat, |
| const std::complex< double > & | s1, | ||
| ComplexMatrix ** | m1, | ||
| const std::complex< double > & | s2, | ||
| ComplexMatrix ** | m2, | ||
| ComplexMatrix ** | mout ) |
| void ModuleBase::scaled_sum | ( | const std::complex< double > & | s1, |
| const ComplexMatrix & | m1, | ||
| const std::complex< double > & | s2, | ||
| const ComplexMatrix & | m2, | ||
| ComplexMatrix & | mout ) |
| void ModuleBase::scaled_sum | ( | double | r1, |
| const ComplexArray & | cd1, | ||
| double | r2, | ||
| const ComplexArray & | cd2, | ||
| ComplexArray & | cd3 ) |
Does cd3 = r1*cd1 + r2*cd2.
| void 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.
| void 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.
| void 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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void ModuleBase::TITLE | ( | const std::string & | class_function_name, |
| bool | disable ) |
| void ModuleBase::TITLE | ( | const std::string & | class_name, |
| const std::string & | function_name = "", | ||
| const bool | disable = true ) |
| void ModuleBase::TITLE | ( | std::ofstream & | ofs, |
| const std::string & | class_name, | ||
| const std::string & | function_name, | ||
| const bool | disable ) |
| std::complex< double > ModuleBase::trace | ( | const ComplexMatrix & | m | ) |
| ComplexMatrix ModuleBase::transpose | ( | const ComplexMatrix & | m, |
| const bool & | conjugate ) |
|
inline |
Truncated complementary error function to avoid underflow for large arguments.
This function returns 0 if the real part of the input is greater than 20.0, otherwise it calls std::erfc(x).
| FPTYPE | The floating point type (float, double, or complex). |
| x | The input value. |
|
inline |
Truncated exponential function to avoid underflow.
This function returns 0 if the real part of the input is less than -230.0, otherwise it calls ModuleBase::libm::exp(x).
| FPTYPE | The floating point type (float, double, or complex). |
| x | The input value. |
|
inline |
|
inline |
|
inline |
Truncated value function to avoid underflow.
This function returns 0 if the absolute value of the input is less than 1.0e-30, otherwise it returns the input x.
| FPTYPE | The floating point type (float, double, or complex). |
| x | The input value. |
Truncated value function to avoid underflow.
This function modifies the input to 0 if its absolute value is less than 1.0e-30.
| FPTYPE | The floating point type (float, double, or complex). |
| x | The input value to be checked and possibly truncated. |
|
inline |
| void ModuleBase::WARNING | ( | const std::string & | file, |
| const std::string & | description ) |
Print out warning information in warning.log file.
| file | The file where warning happens |
| description | The warning information |
| void ModuleBase::WARNING_QUIT | ( | const std::string & | file, |
| const std::string & | description ) |
Combine the functions of WARNING and QUIT.
| file | The file where warning happens |
| description | The warning information |
| void ModuleBase::WARNING_QUIT | ( | const std::string & | file, |
| const std::string & | description, | ||
| int | ret ) |
Combine the functions of WARNING and QUIT.
| file | The file where warning happens |
| description | The warning information |
| CommunicationDomain ModuleBase::world_comm_domain | ( | ) |
| template void ModuleBase::YlmReal::Ylm_Real< double, base_device::DEVICE_CPU > | ( | base_device::DEVICE_CPU * | , |
| int | , | ||
| int | , | ||
| const double * | , | ||
| double * | ) |
| template void ModuleBase::YlmReal::Ylm_Real< float, base_device::DEVICE_CPU > | ( | base_device::DEVICE_CPU * | , |
| int | , | ||
| int | , | ||
| const float * | , | ||
| float * | ) |
| const std::complex< double > ModuleBase::ZERO | ( | 0. | 0, |
| 0. | 0 ) |
set elements of u as zero which u is 1_d std::complex array
| const double ModuleBase::ANGSTROM_AU = 1.8897270 |
| const double ModuleBase::AU_to_FS = 2.418884326505e-2 |
| const double ModuleBase::BOHR_RADIUS_SI = 0.529177e-10 |
| const double ModuleBase::BOHR_TO_A = 0.5291770 |
| const std::map<std::string, double> ModuleBase::CovalentRadius |
| const double ModuleBase::DEGSPIN = 2.0 |
| const double ModuleBase::e2 = 2.0 |
| const std::map<std::string, std::string> ModuleBase::EleConfig |
| const double ModuleBase::ELECTRONVOLT_SI = 1.6021892e-19 |
| const double ModuleBase::EMASS_SI = 9.1093826e-31 |
|
constexpr |
| const double ModuleBase::FOUR_PI = 4.0 * 3.14159265358979323846 |
| const double ModuleBase::HARTREE_SI = 4.35974394e-18 |
| const double ModuleBase::Hartree_to_eV = 27.211396 |
| const double ModuleBase::Hartree_to_K = 3.1577464e5 |
| const double ModuleBase::INVERSE_FOUR_PI = 1.0/FOUR_PI |
| const std::map<std::string, int> ModuleBase::IsTransMetal |
| const double ModuleBase::K_BOLTZMAN_AU = 3.1667e-6 |
| const double ModuleBase::K_BOLTZMAN_SI = 1.3806504e-23 |
| const double ModuleBase::memory_warning_threshold_mb = 20.0 |
| const std::map<std::string, int> ModuleBase::MinZval |
| const double ModuleBase::NA = 6.02214129e23 |
| const std::string ModuleBase::Name_Angular[5][11] |
| const double ModuleBase::PI = 3.14159265358979323846 |
| const double ModuleBase::PI_HALF = PI / 2.0 |
| const double ModuleBase::Ry_to_eV = 13.605698 |
| const double ModuleBase::RYDBERG_SI = HARTREE_SI/2.0 |
| const double ModuleBase::SQRT2 = 1.41421356237309504880 |
| const double ModuleBase::SQRT_INVERSE_FOUR_PI = sqrt(INVERSE_FOUR_PI) |
| const double ModuleBase::threshold_wg = 1.0e-10 |
| const double ModuleBase::TWO_PI = 2 * PI |
|
constexpr |
ylmcoef coefficient count (supports up to L=5)