csdms

basic_modeling_interface.grid_rectilinear module

Interface that describes rectilinear grids.

class basic_modeling_interface.grid_rectilinear.BmiGridRectilinear[source]

Bases: basic_modeling_interface.grid.BmiGrid

Methods that describe a rectilinear grid.

In a 2D rectilinear grid, every grid cell (or element) is a rectangle but different cells can have different dimensions. All cells in the same row have the same grid spacing in the y direction and all cells in the same column have the same grid spacing in the x direction. Grid spacings can be computed as the difference of successive x or y values.

An example of a rectilinear grid

Methods

get_grid_rank(grid_id) Get number of dimensions of the computational grid.
get_grid_shape(grid_id) Get dimensions of the computational grid.
get_grid_size(grid_id) Get the total number of elements in the computational grid.
get_grid_type(grid_id) Get the grid type as a string.
get_grid_x(grid_id) Get coordinates of grid nodes in the streamwise direction.
get_grid_y(grid_id) Get coordinates of grid nodes in the transverse direction.
get_grid_z(grid_id) Get coordinates of grid nodes in the normal direction.
get_grid_shape(grid_id)[source]

Get dimensions of the computational grid.

Parameters:

grid_id : int

A grid identifier.

Returns:

tuple of int

The dimensions of the grid.

See also

bmi.vars.BmiVars.get_var_grid
Obtain a grid_id.

Notes

/* C */
int get_grid_shape(void * self, const char * var_name,
                   int * shape);
get_grid_x(grid_id)[source]

Get coordinates of grid nodes in the streamwise direction.

Parameters:

grid_id : int

A grid identifier.

Returns:

array_like of float

The positions of the grid nodes.

See also

bmi.vars.BmiVars.get_var_grid
Obtain a grid_id.

Notes

/* C */
int get_grid_x(void * self, const char * var_name, double * x);
get_grid_y(grid_id)[source]

Get coordinates of grid nodes in the transverse direction.

Parameters:

grid_id : int

A grid identifier.

Returns:

array_like of float

The positions of the grid nodes.

See also

bmi.vars.BmiVars.get_var_grid
Obtain a grid_id.

Notes

/* C */
int get_grid_y(void * self, const char * var_name, double * y);
get_grid_z(grid_id)[source]

Get coordinates of grid nodes in the normal direction.

Parameters:

grid_id : int

A grid identifier.

Returns:

array_like of float

The positions of the grid nodes.

See also

bmi.vars.BmiVars.get_var_grid
Obtain a grid_id.

Notes

/* C */
int get_grid_z(void * self, const char * var_name, double * z);