Perform integral over atomic grid. More...
#include <casida_grid.h>
Public Member Functions | |
CasidaShell (bool lobatto=false) | |
Constructor. Need to set tolerance as well before using constructor! | |
~CasidaShell () | |
Destructor. | |
void | compute_orbs (const std::vector< arma::mat > &C) |
Evaluate values of orbitals at grid points. | |
void | eval_fxc (int x_func, int c_func) |
Evaluate fx and fc. | |
void | Kxc (const std::vector< std::vector< states_pair_t > > &pairs, arma::mat &K) const |
Evaluate Kxc. | |
void | free () |
![]() | |
AngularGrid (bool lobatto=false) | |
~AngularGrid () | |
Destructor. | |
void | set_basis (const BasisSet &basis) |
Set basis set. | |
void | set_grid (const angshell_t &shell) |
Set radial shell. | |
std::vector< gridpoint_t > | get_grid () const |
Get the quadrature grid. | |
void | check_grad_lapl (int x_func, int c_func) |
Check necessity of computing gradient and laplacians, necessary for compute_bf! | |
void | get_grad_lapl (bool &grad, bool &lapl) const |
Get necessity of computing gradient and laplacians. | |
void | set_grad_lapl (bool grad, bool lapl) |
Set necessity of computing gradient and laplacians, necessary for compute_bf! | |
void | set_hess_lgrad (bool hess, bool lgrad) |
Set necessity of computing Hessian and gradient of Laplacian. | |
angshell_t | construct () |
Construct a fixed size grid. | |
angshell_t | construct (const arma::mat &P, double ftol, int x_func, int c_func) |
Construct adaptively a grid centered on the cenind:th center, restricted calculation. | |
angshell_t | construct (const arma::mat &Pa, const arma::mat &Pb, double ftol, int x_func, int c_func) |
Construct adaptively a grid centered on the cenind:th center, unrestricted calculation. | |
angshell_t | construct (const arma::cx_vec &C, double ftol, int x_func, int c_func) |
Construct adaptively a grid centered on the cenind:th center, SIC calculation. | |
angshell_t | construct_becke (double otol) |
Construct a dummy grid that is only meant for the overlap matrix (Becke charges) | |
angshell_t | construct_hirshfeld (const Hirshfeld &Hirsh, double otol) |
Construct a dummy grid that is only meant for the overlap matrix (Hirshfeld charges) | |
void | form_grid () |
Form radial shell and compute basis functions. | |
void | form_hirshfeld_grid (const Hirshfeld &hirsh) |
Form radial shell using Hirshfeld weights and compute basis functions. | |
void | becke_weights (double a=0.7) |
void | hirshfeld_weights (const Hirshfeld &hirsh) |
Compute Hirshfeld weight for grid points. | |
void | prune_points () |
Prune points with small weight. | |
void | compute_bf () |
Compute basis functions on grid points. | |
void | free () |
Free memory. | |
arma::uvec | screen_density (double thr=1e-10) const |
Screen wrt small density, returns list of points with nonnegligible values. | |
void | update_density (const arma::mat &P) |
Update values of density, restricted calculation. | |
void | update_density (const arma::mat &Pa, const arma::mat &Pb) |
Update values of density, unrestricted calculation. | |
void | update_density (const arma::cx_vec &C) |
Update values of density, self-interaction correction. | |
void | get_density (std::vector< dens_list_t > &list) const |
Get density list; used to determine isosurface values for orbital plots. | |
double | compute_Nel () const |
Compute number of electrons. | |
void | print_grid () const |
Print out grid information. | |
void | print_density (FILE *f) const |
Print density information. | |
void | print_potential (int func_id, FILE *f) const |
Print potential information. | |
void | init_xc () |
Initialize XC arrays. | |
void | compute_xc (int func_id, bool pot) |
double | eval_Exc () const |
Evaluate exchange/correlation energy. | |
void | init_VV10 (double b, double C, bool pot) |
Initialize VV10 calculation. | |
void | collect_VV10 (arma::mat &data, std::vector< size_t > &idx, double b, double C, bool nl) const |
Collect VV10 data. | |
void | compute_VV10 (const std::vector< arma::mat > &nldata, double b, double C) |
arma::vec | compute_VV10_F (const std::vector< arma::mat > &nldata, const std::vector< angshell_t > &nlgrids, double b, double C) |
Same thing, but also evaluate the grid contribution to the force. | |
void | eval_overlap (arma::mat &S) const |
Evaluate atomic contribution to overlap matrix. | |
void | eval_diag_overlap (arma::vec &S) const |
Evaluate diagonal elements of overlap matrix. | |
void | eval_overlap (const arma::cx_mat &Cocc, size_t io, double k, arma::mat &S, double thr) const |
void | eval_overlap (const arma::cx_mat &Cocc, const arma::vec &Esi, double k, arma::mat &S, double thr) const |
Same thing, but do contraction over SI energies for derivatives. | |
void | eval_tau_overlap (const arma::cx_mat &Cocc, double k, arma::mat &S, double thr) const |
void | eval_tau_overlap_deriv (const arma::cx_mat &Cocc, const arma::vec &Esi, double k, arma::mat &S, double thr) const |
Calculate the GGA and meta-GGA type terms for the derivative. | |
void | eval_Fxc (arma::mat &H) const |
Evaluate Fock matrix, restricted calculation. | |
void | eval_Fxc (arma::mat &Ha, arma::mat &Hb, bool beta=true) const |
Evaluate Fock matrix, unrestricted calculation. | |
void | eval_diag_Fxc (arma::vec &H) const |
Evaluate diagonal elements of Fock matrix (for adaptive grid formation), restricted calculation. | |
void | eval_diag_Fxc (arma::vec &Ha, arma::vec &Hb) const |
Evaluate diagonal elements of Fock matrix (for adaptive grid formation), unrestricted calculation. | |
void | eval_diag_Fxc_SIC (arma::vec &H) const |
Evaluate diagonal elements of Fock matrix (for adaptive grid formation), unrestricted calculation. | |
arma::vec | eval_force_r () const |
Evaluate force, restricted. | |
arma::vec | eval_force_u () const |
Evaluate force, unrestricted. | |
Private Attributes | |
std::vector< std::vector < std::vector< double > > > | orbs |
Stack of values of orbitals at grid points: orbs[nspin][ngrid][norb]. | |
std::vector< double > | fx |
Values of the exchange part of ![]() | |
std::vector< double > | fc |
Values of the correlation part. | |
Additional Inherited Members | |
![]() | |
libxc_dens_t | get_dens (size_t idx) const |
Get density data for wanted point. | |
libxc_pot_t | get_pot (size_t idx) const |
Get potential data for wanted point. | |
libxc_debug_t | get_data (size_t idx) const |
Get density and potential data for wanted point. | |
void | lobatto_shell () |
Add radial shell in Lobatto angular scheme, w/o Becke partitioning or pruning. | |
void | lebedev_shell () |
Add radial shell in Lebedev scheme, w/o Becke partitioning or pruning. | |
void | update_shell_list () |
Update list of important basis functions. | |
void | get_weights () |
Collect weights from grid into w array. | |
![]() | |
angshell_t | info |
Shell info. | |
const BasisSet * | basp |
Basis set pointer. | |
bool | use_lobatto |
Use Lobatto quadrature? (Default is Lebedev) | |
std::vector< gridpoint_t > | grid |
Integration points. | |
std::vector< size_t > | pot_shells |
List of potentially important shells. | |
arma::uvec | pot_bf_ind |
List of potentially important functions. | |
std::vector< size_t > | shells |
List of important shells. | |
arma::uvec | bf_i0 |
Indices of first functions on shell. | |
arma::uvec | bf_N |
Amount of functions on shell. | |
arma::uvec | bf_ind |
List of important functions. | |
arma::uvec | bf_potind |
List of important functions in potentials' list. | |
arma::rowvec | w |
Duplicate values of weights here. | |
arma::mat | bf |
Values of important functions in grid points, Nbf * Ngrid. | |
arma::mat | bf_x |
x gradient | |
arma::mat | bf_y |
y gradient | |
arma::mat | bf_z |
z gradient | |
arma::mat | bf_lapl |
Values of laplacians in grid points, (3*Nbf) * Ngrid. | |
arma::mat | bf_hess |
Values of Hessians in grid points, (9*Nbf) * Ngrid; used for GGA force. | |
arma::mat | bf_lx |
Values of x gradient of laplacian; used for MGGA force. | |
arma::mat | bf_ly |
Values of y gradient of laplacian; used for MGGA force. | |
arma::mat | bf_lz |
Values of z gradient of laplacian; used for MGGA force. | |
arma::mat | Pv |
Density helper matrices: P_{uv} chi_v, and P_{uv} nabla(chi_v) | |
arma::mat | Pv_x |
arma::mat | Pv_y |
arma::mat | Pv_z |
arma::mat | Pav |
Same for spin-polarized. | |
arma::mat | Pav_x |
arma::mat | Pav_y |
arma::mat | Pav_z |
arma::mat | Pbv |
arma::mat | Pbv_x |
arma::mat | Pbv_y |
arma::mat | Pbv_z |
bool | do_grad |
Is gradient needed? | |
bool | do_lapl |
Is laplacian needed? | |
bool | do_hess |
Is Hessian needed? (For GGA force) | |
bool | do_lgrad |
Is gradient of laplacian needed? (For MGGA force) | |
bool | polarized |
Spin-polarized calculation? | |
bool | do_gga |
GGA functional used? (Set in compute_xc, only affects eval_Fxc) | |
bool | do_mgga |
Meta-GGA used? (Set in compute_xc, only affects eval_Fxc) | |
arma::mat | rho |
Density, Nrho x Npts. | |
arma::vec | exc |
Energy density, Npts. | |
arma::mat | vxc |
Functional derivative of energy wrt electron density, Nrho x Npts. | |
arma::mat | grho |
Gradient of electron density, (3 x Nrho) x Npts. | |
arma::mat | sigma |
Dot products of gradient of electron density, N x Npts; N=1 for closed-shell and 3 for open-shell. | |
arma::mat | vsigma |
Functional derivative of energy wrt gradient of electron density. | |
arma::mat | lapl |
Laplacian of electron density. | |
arma::mat | tau |
Kinetic energy density. | |
arma::mat | vlapl |
Functional derivative of energy wrt laplacian of electron density. | |
arma::mat | vtau |
Functional derivative of energy wrt kinetic energy density. | |
double | VV10_thr |
Density threshold. | |
arma::mat | VV10_arr |
Helper array used in kernel computation to avoid memory thrashing. | |
Perform integral over atomic grid.
This file contains the necessary stuff needed to evaluate the TDLDA integrals in Casida formalism.