ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
test_radial.cpp File Reference
#include "source_base/module_grid/radial.h"
#include "gtest/gtest.h"
#include <cmath>
#include <functional>
#include <mpi.h>
Include dependency graph for test_radial.cpp:

Typedefs

using Func_t = std::function< double(double)>
 

Functions

double quadrature (const Func_t &f, int n, double *r, double *w)
 
 TEST (RadialTest, Baker)
 
 TEST (RadialTest, Murray)
 
 TEST (RadialTest, Treutler)
 
 TEST (RadialTest, Mura)
 
int main (int argc, char **argv)
 

Variables

const double pi = std::acos(-1.0)
 
std::vector< std::pair< Func_t, double > > test_func_ref
 

Typedef Documentation

◆ Func_t

using Func_t = std::function<double(double)>

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

◆ quadrature()

double quadrature ( const Func_t f,
int  n,
double *  r,
double *  w 
)
Here is the caller graph for this function:

◆ TEST() [1/4]

TEST ( RadialTest  ,
Baker   
)
Here is the call graph for this function:

◆ TEST() [2/4]

TEST ( RadialTest  ,
Mura   
)
Here is the call graph for this function:

◆ TEST() [3/4]

TEST ( RadialTest  ,
Murray   
)
Here is the call graph for this function:

◆ TEST() [4/4]

TEST ( RadialTest  ,
Treutler   
)
Here is the call graph for this function:

Variable Documentation

◆ pi

const double pi = std::acos(-1.0)

This test briefly checks various radial quadrature schemes by comparing their numerical results with analytical values on a few simple functions.

The number of grid points and scaling factor are not carefully selected and the test is not exhaustive. It is just a sanity check.

◆ test_func_ref

std::vector<std::pair<Func_t, double> > test_func_ref
Initial value:
= {
{
[](double r) {
return std::exp(-0.3 * r * r) + std::exp(-3.0 * r * r);
},
0.25 * std::sqrt(pi) * (std::pow(0.3, -1.5) + std::pow(3.0, -1.5))
},
{
[](double r) {
return r * (std::exp(-0.3 * r * r) + std::exp(-3.0 * r * r));
},
0.5 / (0.3 * 0.3) + 0.5 / (3.0 * 3.0)
},
{
[](double r) {
return r * r * (std::exp(-0.3 * r * r) + std::exp(-3.0 * r * r));
},
0.375 * std::sqrt(pi) * (std::pow(0.3, -2.5) + std::pow(3.0, -2.5))
},
}
const double pi
Definition test_radial.cpp:22