4.2.1.3 pde.grids.boundaries.axes module

This module handles the boundaries of all axes of a grid. It only defines Boundaries, which acts as a list of BoundaryAxisBase.

class Boundaries(boundaries)[source]

Bases: list

class that bundles all boundary conditions for all axes

initialize with a list of boundaries

property boundaries: Iterator[BCBase]

iterator over all non-periodic boundaries

check_value_rank(rank)[source]

check whether the values at the boundaries have the correct rank

Parameters:

rank (int) – The tensorial rank of the field for this boundary condition

Return type:

None

Throws:

RuntimeError: if any value does not have rank rank

copy()[source]

create a copy of the current boundaries

Return type:

Boundaries

classmethod from_data(grid, boundaries, rank=0)[source]

Creates all boundaries from given data

Parameters:
  • grid (GridBase) – The grid with which the boundary condition is associated

  • boundaries (str or list or tuple or dict) –

    Data that describes the boundaries. This can either be a list of specifications for each dimension or a single one, which is then applied to all dimensions. The boundary for a dimensions can be specified by one of the following formats:

    • string specifying a single type for all boundaries

    • dictionary specifying the type and values for all boundaries

    • tuple pair specifying the low and high boundary individually

  • rank (int) – The tensorial rank of the field for this boundary condition

Return type:

Boundaries

classmethod get_help()[source]

Return information on how boundary conditions can be set

Return type:

str

get_mathematical_representation(field_name='C')[source]

return mathematical representation of the boundary condition

Parameters:

field_name (str) –

Return type:

str

grid: GridBase

grid for which boundaries are defined

Type:

GridBase

make_ghost_cell_setter()[source]

return function that sets the ghost cells on a full array

Return type:

GhostCellSetter

property periodic: list[bool]

a boolean array indicating which dimensions are periodic according to the boundary conditions

Type:

ndarray

set_ghost_cells(data_full, *, args=None)[source]

set the ghost cells for all boundaries

Parameters:
  • data_full (ndarray) – The full field data including ghost points

  • args – Additional arguments that might be supported by special boundary conditions.

Return type:

None