ampsci
High-precision calculations for one- and two-valence atomic systems
SphericalBessel::JL_table

ok

Lookup table of spherical Bessel functions: j_L(q*r) = J[L][q][r].

Pre-computes and stores j_L(q*r) for a grid of q and r values. Provides first-match, nearest, and linear-interpolation lookup. All lookups are only accurate if the q grid is dense enough. Ideally, use the same r grid to extract values as was used to fill the table.

#include <SphericalBessel.hpp>

Public Member Functions

 JL_table ()
 Default construct empty table; must call fill() before use.
 
 JL_table (int max_L, const std::vector< double > &q, const std::vector< double > &r, bool cell_average=true)
 Construct and fill the table; equivalent to default-construct + fill()
 
void fill (int max_L, const std::vector< double > &q, const std::vector< double > &r, bool cell_average=true)
 If derivatives required for degree L, max_L = L+1. cell_average is forwarded to fillBesselVec_kr (see its docs); default true.
 
const std::vector< double > & at (std::size_t L, std::size_t iq) const
 Direct access to jL(q*r) for specific q grid index.
 
const std::vector< double > & jL (int L, double q) const
 Returns jL(q_i*r) for the first grid point q_i such that q_i >= q.
 
const std::vector< double > & jL_nearest (int L, double q) const
 Returns jL(q_i*r) for the grid point q_i nearest to the requested q.
 
const std::vector< double > & jL_on_qr_nearest (int L, double q) const
 Returns jL(q_i*r)/(q_i*r) for the grid point q_i nearest to the requested q.
 
std::vector< double > jL_interp (int L, double q) const
 Returns jL(q*r) interpolated linearly between grid points. nb: assumes q grid dense enough that linear interp is reasonable!
 

Constructor & Destructor Documentation

◆ JL_table() [1/2]

SphericalBessel::JL_table::JL_table ( )
inline

Default construct empty table; must call fill() before use.

◆ JL_table() [2/2]

SphericalBessel::JL_table::JL_table ( int  max_L,
const std::vector< double > &  q,
const std::vector< double > &  r,
bool  cell_average = true 
)
inline

Construct and fill the table; equivalent to default-construct + fill()

Member Function Documentation

◆ fill()

void SphericalBessel::JL_table::fill ( int  max_L,
const std::vector< double > &  q,
const std::vector< double > &  r,
bool  cell_average = true 
)
inline

If derivatives required for degree L, max_L = L+1. cell_average is forwarded to fillBesselVec_kr (see its docs); default true.

◆ at()

const std::vector< double > & SphericalBessel::JL_table::at ( std::size_t  L,
std::size_t  iq 
) const
inline

Direct access to jL(q*r) for specific q grid index.

◆ jL()

const std::vector< double > & SphericalBessel::JL_table::jL ( int  L,
double  q 
) const
inline

Returns jL(q_i*r) for the first grid point q_i such that q_i >= q.

◆ jL_nearest()

const std::vector< double > & SphericalBessel::JL_table::jL_nearest ( int  L,
double  q 
) const
inline

Returns jL(q_i*r) for the grid point q_i nearest to the requested q.

◆ jL_on_qr_nearest()

const std::vector< double > & SphericalBessel::JL_table::jL_on_qr_nearest ( int  L,
double  q 
) const
inline

Returns jL(q_i*r)/(q_i*r) for the grid point q_i nearest to the requested q.

◆ jL_interp()

std::vector< double > SphericalBessel::JL_table::jL_interp ( int  L,
double  q 
) const
inline

Returns jL(q*r) interpolated linearly between grid points. nb: assumes q grid dense enough that linear interp is reasonable!


The documentation for this class was generated from the following file: