ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Variables
gen_ref Namespace Reference

Classes

class  Case
 

Variables

list cases
 
int n_interp = 37
 
 cubspl = CubicSpline(case.x, case.y, bc_type=case.bc)
 
 x_interp = np.linspace(case.x[0], case.x[-1], n_interp)
 
 y_interp = cubspl(x_interp)
 
 dy_interp = cubspl(x_interp, 1)
 
 d2y_interp = cubspl(x_interp, 2)
 
str tag = 1 else 'second_deriv'
 

Detailed Description

This script generates reference data for the cross-check in cubic_spline_test.cpp.
To add more tests, append a new Case object to the cases list.

Variable Documentation

◆ cases

list gen_ref.cases
Initial value:
1= [
2 Case(np.sin, np.logspace(-1, 0, 10), 'not-a-knot',
3 'sin_not_a_knot.dat'),
4 Case(np.cos, [0, 0.1, 1, 1.5, 3, 2*np.pi], 'periodic',
5 'cos_periodic.dat'),
6 Case(np.exp, np.logspace(-1, 0, 10), ((1, np.exp(0.1)), (1, np.exp(1))),
7 'exp_first_deriv.dat'),
8 Case(np.log, np.logspace(0, 1, 10), ((2, -1), (2, -0.01)),
9 'log_second_deriv.dat'),
10 Case(np.sqrt, np.logspace(0, 1, 10), ((1, 0.5), 'not-a-knot'),
11 'sqrt_mix_bc.dat'),
12 Case(lambda x: np.ones_like(x), [0, 1], 'periodic',
13 'two_points_periodic.dat'),
14 Case(np.arccos, [0, 0.5], ((1, -1), (1, -2/np.sqrt(3))),
15 'two_points_first_deriv.dat'),
16 Case(np.sqrt, [1, 4], ((2, 0.5), (2, 0.25)),
17 'two_points_second_deriv.dat'),
18 Case(np.sin, [0, 0.3, 1], 'not-a-knot',
19 'three_points_not_a_knot.dat'),
20]

◆ cubspl

gen_ref.cubspl = CubicSpline(case.x, case.y, bc_type=case.bc)

◆ d2y_interp

gen_ref.d2y_interp = cubspl(x_interp, 2)

◆ dy_interp

gen_ref.dy_interp = cubspl(x_interp, 1)

◆ n_interp

int gen_ref.n_interp = 37

◆ tag

str gen_ref.tag = 1 else 'second_deriv'

◆ x_interp

gen_ref.x_interp = np.linspace(case.x[0], case.x[-1], n_interp)

◆ y_interp

gen_ref.y_interp = cubspl(x_interp)