Previous topic

Concatenations

Next topic

Functions

This Page

Broadcasting Operators

class pybamm.Broadcast(child, broadcast_domain, broadcast_auxiliary_domains=None, broadcast_type='full to nodes', 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.

For an example of broadcasts in action, see this example notebook

Parameters:
  • child (Symbol) – child node
  • broadcast_domain (iterable of str) – Primary domain for broadcast. This will become the domain of the symbol
  • broadcast_auxiliary_domains (dict of str) – Auxiliary domains for broadcast.
  • 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) –
class pybamm.FullBroadcast(child, broadcast_domain, auxiliary_domains, name=None)[source]

A class for full broadcasts

check_and_set_domains(child, broadcast_type, broadcast_domain, broadcast_auxiliary_domains)[source]

See Broadcast.check_and_set_domains()

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 of the symbol in the domain specified by broadcast_domain. This should be used for broadcasting from a “larger” scale to a “smaller” scale, for example broadcasting temperature T(x) from the electrode to the particles, or broadcasting current collector current i(y, z) from the current collector to the electrodes.

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) –
check_and_set_domains(child, broadcast_type, broadcast_domain, broadcast_auxiliary_domains)[source]

See Broadcast.check_and_set_domains()

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

A node in the expression tree representing a primary broadcasting operator. Broadcasts in a secondary dimension only. That is, makes explicit copies of the symbol in the domain specified by broadcast_domain. This should be used for broadcasting from a “smaller” scale to a “larger” scale, for example broadcasting SPM particle concentrations c_s(r) from the particles to the electrodes. Note that this wouldn’t be used to broadcast particle concentrations in the DFN, since these already depend on both x and r.

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) –
check_and_set_domains(child, broadcast_type, broadcast_domain, broadcast_auxiliary_domains)[source]

See Broadcast.check_and_set_domains()

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

A full broadcast onto the edges of a domain (edges of primary dimension, nodes of other dimensions)

evaluates_on_edges(dimension)[source]

See pybamm.Symbol.evaluates_on_edges().

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

A primary broadcast onto the edges of the domain

evaluates_on_edges(dimension)[source]

See pybamm.Symbol.evaluates_on_edges().

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

A secondary broadcast onto the edges of a domain

evaluates_on_edges(dimension)[source]

See pybamm.Symbol.evaluates_on_edges().

pybamm.ones_like(*symbols)[source]

Create a symbol with the same shape as the input symbol and with constant value ‘1’, using FullBroadcast.

Parameters:symbols (Symbol) – Symbols whose shape to copy