Trait rustencils::grid::GridSpec[][src]

pub trait GridSpec {
    fn get_coords(&self) -> &Vec<Vec<f64>>;
fn get_ndim(&self) -> usize;
fn get_gridshape(&self) -> &Vec<usize>;
fn get_spacing(&self) -> &Vec<f64>;
fn get_grid(&self) -> &Grid;
fn get_bound_idxs(&self, dimension: usize, side: BoundarySide) -> Vec<usize>;
fn get_bound_pts(&self, dimesnion: usize, side: BoundarySide) -> Vec<Point>; }

Since the physical space of the PDE can be defined in multiple coordinate systems, the GridSpec trait is used to identify those structs that can be used for this purpose. The trait defines the necessary methods for a struct that specifies a certain type of grid. For example, this trait is implemented by the CartesianGridSpec type. It would also need to be implemented for a SphericalGridSpec or PolarGridSpec.

Required methods

fn get_coords(&self) -> &Vec<Vec<f64>>[src]

Returns a shared reference to the vector containing the sets of points along the coordinate axes that make up the grid (e.g., [[x0,x1,x2,…,xm],[y0,y1,y2,…,yn]]).

fn get_ndim(&self) -> usize[src]

Returns a usize that represents the dimensionality of the grid.

fn get_gridshape(&self) -> &Vec<usize>[src]

Returns a shared reference to a vector that contains the number of points along each axis (e.g., [m,n]).

fn get_spacing(&self) -> &Vec<f64>[src]

Returns a shared reference to a vector that contains the spacing between the points on the coordinate axes (e.g., [(x1-x0),(y1-y0)]).

fn get_grid(&self) -> &Grid[src]

Returns a shared reference to the Grid instance.

fn get_bound_idxs(&self, dimension: usize, side: BoundarySide) -> Vec<usize>[src]

Returns an owned vector of usizes that represent the index values of the boundary points along the specified axis. Here, the boundary points refer to the outermost set of points along the edge of the grid.

fn get_bound_pts(&self, dimesnion: usize, side: BoundarySide) -> Vec<Point>[src]

Returns an owned vector of Point structs that represent the boundary points along the specified axis. Here, the boundary points refer to the outermost set of points along the edge of the grid.

Loading content...

Implementors

impl GridSpec for CartesianGridSpec[src]

Loading content...