Non-uniform radial grid with Jacobian, suitable for atomic structure calculations.
Defines a mapping from a uniform grid u = {0, du, 2du, ...} to a non-uniform grid r(u), along with the Jacobian dr/du and the convenience quantity (1/r)(dr/du).
Three grid types are supported (see GridType):
- loglinear (default): logarithmic at small r, linear at large r; controlled by the turning point
b.
- logarithmic: r = r0 * exp(u); good for tightly bound states.
- linear: uniform spacing in r.
Grid points and Jacobians are stored as std::vector<double> and can be iterated over directly (const iterators only).
|
| | Grid (double in_r0, double in_rmax, std::size_t in_num_points, GridType in_gridtype, double in_b=0) |
| | Construct grid directly from parameters.
|
| |
| | Grid (const GridParameters &in) |
| | Construct grid from a GridParameters struct.
|
| |
| auto | r0 () const |
| | Minimum (first) grid point r[0].
|
| |
| auto | front () const |
| | Minimum (first) grid point r[0]; alias for r0()
|
| |
| auto | rmax () const |
| | Maximum (last) grid point r[N-1].
|
| |
| auto | back () const |
| | Maximum (last) grid point r[N-1]; alias for rmax()
|
| |
| auto | num_points () const |
| | Number of grid points.
|
| |
| auto | size () const |
| | Number of grid points; alias for num_points()
|
| |
| auto | du () const |
| | Uniform step size du.
|
| |
| auto | type () const |
| | Grid type (loglinear, logarithmic, or linear)
|
| |
| auto | loglin_b () const |
| | Log-linear turning point b: roughly logarithmic for r<b, linear for r>b.
|
| |
| const std::vector< double > & | r () const |
| | Full grid vector r.
|
| |
| auto | r (std::size_t i) const |
| | Grid point r[i], with range checking.
|
| |
| auto | at (std::size_t i) const |
| | Grid point r[i], with range checking; alias for r(i)
|
| |
| auto | operator() (std::size_t i) const |
| | Grid point r[i], with range checking; alias for r(i)
|
| |
| const std::vector< double > & | drdu () const |
| | Full Jacobian vector dr/du.
|
| |
| auto | drdu (std::size_t i) const |
| | Jacobian (dr/du)[i], with range checking.
|
| |
| const std::vector< double > & | drduor () const |
| | Full vector of (1/r)(dr/du)
|
| |
| auto | drduor (std::size_t i) const |
| | (1/r)(dr/du)[i], with range checking
|
| |
| std::size_t | getIndex (double x, bool require_nearest=false) const |
| | Returns the grid index closest to x. If require_nearest is false, returns the index of the largest grid point x.
|
| |
| std::string | gridParameters () const |
| | Returns a human-readable string of grid parameters.
|
| |
| std::vector< double > | rpow (double k) const |
| | Returns a vector of r^k for each grid point.
|
| |
| auto | begin () const |
| | Const iterator to first grid point.
|
| |
| auto | end () const |
| | Const iterator past last grid point.
|
| |
| auto | cbegin () const |
| | Const iterator to first grid point.
|
| |
| auto | cend () const |
| | Const iterator past last grid point.
|
| |
| auto | rbegin () const |
| | Const reverse iterator to last grid point.
|
| |
| auto | rend () const |
| | Const reverse iterator before first grid point.
|
| |
| auto | crbegin () const |
| | Const reverse iterator to last grid point.
|
| |
| auto | crend () const |
| | Const reverse iterator before first grid point.
|
| |
| void | extend_to (double new_rmax) |
| | Extends the grid to at least new_rmax.
|
| |
| GridParameters | params () const |
| | Returns a GridParameters struct that can be used to reconstruct this grid.
|
| |
|
| static double | calc_du_from_num_points (double in_r0, double in_rmax, std::size_t in_num_points, GridType in_gridtype, double in_b=0) |
| | Given r0, rmax, and num_points, calculates the uniform step size du.
|
| |
| static std::size_t | calc_num_points_from_du (double in_r0, double in_rmax, double in_du, GridType in_gridtype, double in_b=0) |
| | Given r0, rmax, and du, calculates the number of grid points.
|
| |