ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
Public Member Functions | Static Public Member Functions | List of all members
Grid

Holds grid, including type + Jacobian (dr/du) More...

#include <Grid.hpp>

Public Member Functions

 Grid (double in_r0, double in_rmax, std::size_t in_num_points, GridType in_gridtype, double in_b=0)
 Manual constructor.
 
 Grid (const GridParameters &in)
 Constructor using GridParameters class.
 
auto r0 () const
 Minium (first) grid point.
 
auto front () const
 
auto rmax () const
 Maximum (final) grid point.
 
auto back () const
 
auto num_points () const
 Number of grid points.
 
auto size () const
 Number of grid points.
 
auto du () const
 Linear step size dr = (dr/dr)*du.
 
auto type () const
 Grid-type (linear, logarithmic, loglinear)
 
auto loglin_b () const
 log-linear grid 'turning point' (~ roughly log for r<b, lin for r>b)
 
const std::vector< double > & r () const
 Grid points, r.
 
auto r (std::size_t i) const
 
auto at (std::size_t i) const
 
auto operator() (std::size_t i) const
 
const std::vector< double > & drdu () const
 Jacobian (dr/du)[i].
 
auto drdu (std::size_t i) const
 
const std::vector< double > & drduor () const
 Convinient: (1/r)*(dr/du)
 
auto drduor (std::size_t i) const
 
std::size_t getIndex (double x, bool require_nearest=false) const
 Given value, returns grid index. if not require_nearest, returns lower.
 
std::string gridParameters () const
 String human-readable grid parameters.
 
std::vector< double > rpow (double k) const
 Calculates+returns vector of 1/r.
 
auto begin () const
 Provide iterators, but only onst ones.
 
auto end () const
 
auto cbegin () const
 
auto cend () const
 
auto rbegin () const
 
auto rend () const
 
auto crbegin () const
 
auto crend () const
 
void extend_to (double new_rmax)
 Extends grid to new_r_max. Note: This is the only non-const function; use with caution. More...
 
GridParameters params () const
 Returns set of paramets; may be used to construct grid.
 

Static Public Member Functions

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 + num_points, calculates 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 + du, calculates num_points.
 

Detailed Description

Holds grid, including type + Jacobian (dr/du)

Member Function Documentation

◆ extend_to()

void Grid::extend_to ( double  new_rmax)

Extends grid to new_r_max. Note: This is the only non-const function; use with caution.

Note: New grid not guarenteed to end exactly at new_rmax; usually will go a bit further (might not line up exactly on existing grid)


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