example_pkg.grid
A uniform 1D grid.
Classes
| Name | Description |
|---|---|
Grid | A uniform grid of cells on [start, stop]. |
Functions
| Name | Description |
|---|---|
linspace_midpoints | The midpoints of cells uniform cells on [start, stop]. |
Gridclassdataclass#
class Grid(start: float, stop: float, cells: int)A uniform grid of cells on [start, stop].
Attributes
cellsattributeinstance attribute#
cells: intstartattributeinstance attribute#
start: floatstopattributeinstance attribute#
stop: floatnodesmethod#
def nodes() -> np.ndarrayThe cells + 1 cell boundaries.
Returns
np.ndarray- The node coordinates.
linspace_midpointsfunction#
def linspace_midpoints(start: float, stop: float, cells: int) -> np.ndarrayThe midpoints of cells uniform cells on [start, stop].
Parameters
Returns
np.ndarray- An array of length
cells.