Holds grid, including type + Jacobian (dr/du)
More...
#include <Grid.hpp>
|
| | 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.
|
| |
| GridParameters | params () const |
| | Returns set of paramets; may be used to construct 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 + 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.
|
| |
Holds grid, including type + Jacobian (dr/du)
◆ Grid() [1/2]
| Grid::Grid |
( |
double |
in_r0, |
|
|
double |
in_rmax, |
|
|
std::size_t |
in_num_points, |
|
|
GridType |
in_gridtype, |
|
|
double |
in_b = 0 |
|
) |
| |
◆ Grid() [2/2]
Constructor using GridParameters class.
◆ r0()
Minium (first) grid point.
◆ rmax()
| auto Grid::rmax |
( |
| ) |
const |
|
inline |
Maximum (final) grid point.
◆ num_points()
| auto Grid::num_points |
( |
| ) |
const |
|
inline |
◆ size()
| auto Grid::size |
( |
| ) |
const |
|
inline |
◆ du()
Linear step size dr = (dr/dr)*du.
◆ type()
| auto Grid::type |
( |
| ) |
const |
|
inline |
Grid-type (linear, logarithmic, loglinear)
◆ loglin_b()
| auto Grid::loglin_b |
( |
| ) |
const |
|
inline |
log-linear grid 'turning point' (~ roughly log for r<b, lin for r>b)
◆ r()
| const std::vector< double > & Grid::r |
( |
| ) |
const |
|
inline |
◆ drdu()
| const std::vector< double > & Grid::drdu |
( |
| ) |
const |
|
inline |
◆ drduor()
| const std::vector< double > & Grid::drduor |
( |
| ) |
const |
|
inline |
Convinient: (1/r)*(dr/du)
◆ getIndex()
| std::size_t Grid::getIndex |
( |
double |
x, |
|
|
bool |
require_nearest = false |
|
) |
| const |
Given value, returns grid index. if not require_nearest, returns lower.
◆ gridParameters()
| std::string Grid::gridParameters |
( |
| ) |
const |
String human-readable grid parameters.
◆ rpow()
| std::vector< double > Grid::rpow |
( |
double |
k | ) |
const |
Calculates+returns vector of 1/r.
◆ begin()
| auto Grid::begin |
( |
| ) |
const |
|
inline |
Provide iterators, but only onst ones.
◆ 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)
◆ params()
Returns set of paramets; may be used to construct grid.
◆ calc_du_from_num_points()
| double Grid::calc_du_from_num_points |
( |
double |
in_r0, |
|
|
double |
in_rmax, |
|
|
std::size_t |
in_num_points, |
|
|
GridType |
in_gridtype, |
|
|
double |
in_b = 0 |
|
) |
| |
|
static |
Given r0/rmax + num_points, calculates du.
◆ calc_num_points_from_du()
| std::size_t Grid::calc_num_points_from_du |
( |
double |
in_r0, |
|
|
double |
in_rmax, |
|
|
double |
in_du, |
|
|
GridType |
in_gridtype, |
|
|
double |
in_b = 0 |
|
) |
| |
|
static |
Given r0/rmax + du, calculates num_points.
The documentation for this class was generated from the following files: