Previous topic

Concatenations

Next topic

Simplify

This Page

Broadcasting Operators

class pybamm.Broadcast(child, broadcast_domain, auxiliary_domains=None, broadcast_type='full', name=None)[source]

A node in the expression tree representing a broadcasting operator. Broadcasts a child to a specified domain. After discretisation, this will evaluate to an array of the right shape for the specified domain.

Parameters:
  • child (Symbol) – child node
  • broadcast_domain (iterable of str) – Primary domain for broadcast. This will become the domain of the symbol
  • auxiliary_domain (iterable of str) – Secondary domain for broadcast. Currently, this is only used for testing that symbols have the right shape.
  • broadcast_type (str, optional) – Whether to broadcast to the full domain (primary and secondary) or only in the primary direction. Default is “full”.
  • name (str) – name of the node
  • **Extends (** SpatialOperator) –
check_and_set_domain_and_broadcast_type(child, broadcast_domain, broadcast_type)[source]

Set broadcast domain and broadcast type, performing basic checks to make sure it is compatible with the child

evaluate_for_shape()[source]

Returns a vector of NaNs to represent the shape of a Broadcast. See pybamm.Symbol.evaluate_for_shape_using_domain()

class pybamm.FullBroadcast(child, broadcast_domain, auxiliary_domains, name=None)[source]

A class for full broadcasts

evaluate_for_shape()[source]

Returns a vector of NaNs to represent the shape of a Broadcast. See pybamm.Symbol.evaluate_for_shape_using_domain()

class pybamm.PrimaryBroadcast(child, broadcast_domain, name=None)[source]

A node in the expression tree representing a primary broadcasting operator. Broadcasts in a primary dimension only. That is, makes explicit copies

Parameters:
  • child (Symbol) – child node
  • broadcast_domain (iterable of str) – Primary domain for broadcast. This will become the domain of the symbol
  • name (str) – name of the node
  • **Extends (** SpatialOperator) –
evaluate_for_shape()[source]

Returns a vector of NaNs to represent the shape of a Broadcast. See pybamm.Symbol.evaluate_for_shape_using_domain()