Skip to content

Grid

Grid

Bases: stride.Grid

Grid class for neurotechdevkit. It is a subclass of stride.Grid.

The grid is a container for the spatial and temporal grids. It is used to define the simulation domain and the grid spacing.

make_grid(extent, speed_water, center_frequency, ppw, extra=50, absorbing=40) staticmethod

Create an NDK Grid.

Note that the time component of the grid is not defined here. That is created at simulation time because it depends on simulation parameters.

Parameters:

Name Type Description Default
extent Union[Tuple[float, float], Tuple[float, float, float]]

a tuple of two or three floats representing the dimensions (in meters) of the simulation.

required
speed_water float

a float representing the speed of sound in water (in m/s).

required
center_frequency float

a float representing the center frequency of the source (in Hz).

required
ppw int

an integer representing the number of points per wavelength.

required
extra Union[int, Iterable[int]]

an integer or an iterable of integers representing the number of gridpoints to add as boundary layers on each side of the grid. Extras are added both before and after the grid on each axis. Default is 50.

50
absorbing Union[int, Iterable[int]]

an integer or an iterable of integers representing the number of gridpoints within the boundary layers that are absorbing. Default is 40.

40

Returns:

Name Type Description
Grid Grid

the Grid object.

make_shaped_grid(shape, spacing) staticmethod

Create an NDK Grid with the given shape.

Parameters:

Name Type Description Default
shape Tuple[int, int]

a tuple of two integers representing the shape of the grid.

required
spacing float

a float representing the axis-wise spacing of the grid, in meters.

required

Returns:

Name Type Description
Grid Grid

the Grid object.