A node in the expression tree representing a unary operator (e.g. ‘-’, grad, div)
Derived classes will specify the particular operator
Extends: Symbol
A node in the expression tree representing a - negation operator.
Extends: UnaryOperator
A node in the expression tree representing an abs operator.
Extends: UnaryOperator
See pybamm.Symbol.diff()
.
A node in the expression tree representing a sign operator.
Extends: UnaryOperator
See pybamm.Symbol.diff()
.
A node in the expression tree, which stores the index that should be extracted from its child after the child has been evaluated.
child (pybamm.Symbol
) – The symbol of which to take the index
index (int or slice) – The index (if int) or indices (if slice) to extract from the symbol
name (str, optional) – The name of the symbol
check_size (bool, optional) – Whether to check if the slice size exceeds the child size. Default is True. This should always be True when creating a new symbol so that the appropriate check is performed, but should be False for creating a new copy to avoid unnecessarily repeating the check.
A node in the expression tree representing a unary spatial operator (e.g. grad, div)
Derived classes will specify the particular operator
This type of node will be replaced by the Discretisation
class with a Matrix
Extends: UnaryOperator
See pybamm.Symbol.diff()
.
A node in the expression tree representing a grad operator.
Extends: SpatialOperator
A node in the expression tree representing a div operator.
Extends: SpatialOperator
A node in the expression tree representing a laplacian operator. This is currently only implemeted in the weak form for finite element formulations.
Extends: SpatialOperator
A node in the expression tree representing a the inner product of the grad
operator with itself. In particular, this is useful in the finite element
formualtion where we only require the (sclar valued) square of the gradient,
and not the gradient itself.
Extends: SpatialOperator
Returns the mass matrix for a given symbol, accounting for Dirchlet boundary
conditions where necessary (e.g. in the finite element formualtion)
Extends: SpatialOperator
A node in the expression tree representing an integral operator.
where \(a\) and \(b\) are the left-hand and right-hand boundaries of the domain respectively, and \(u\in\text{domain}\).
function (pybamm.Symbol
) – The function to be integrated (will become self.children[0])
integration_variable (pybamm.IndependentVariable
) – The variable over which to integrate
**Extends (** SpatialOperator
) –
A node in the expression tree representing an indefinite integral operator.
where \(u\in\text{domain}\) which can represent either a spatial or temporal variable.
function (pybamm.Symbol
) – The function to be integrated (will become self.children[0])
integration_variable (pybamm.IndependentVariable
) – The variable over which to integrate
**Extends (** BaseIndefiniteIntegral
) –
A node in the expression tree representing an integral of the basis used for discretisation
where \(a\) and \(b\) are the left-hand and right-hand boundaries of the domain respectively and \(\psi\) is the basis function.
variable (pybamm.Symbol
) – The variable whose basis will be integrated over the entire domain
vector_type (str, optional) – Whether to return a row or column vector (default is row)
**Extends (** SpatialOperator
) –
A node in the expression tree representing an integral operator over the boundary of a domain
where \(\partial a\) is the boundary of the domain, and \(u\in\text{domain boundary}\).
function (pybamm.Symbol
) – The function to be integrated (will become self.children[0])
region (str, optional) – The region of the boundary over which to integrate. If region is entire (default) the integration is carried out over the entire boundary. If region is negative tab or positive tab then the integration is only carried out over the appropriate part of the boundary corresponding to the tab.
**Extends (** SpatialOperator
) –
Delta function. Currently can only be implemented at the edge of a domain.
child (pybamm.Symbol
) – The variable that sets the strength of the delta function
side (str) – Which side of the domain to implement the delta function on
**Extends (** SpatialOperator
) –
A node in the expression tree which gets the boundary value of a variable.
name (str) – The name of the symbol
child (pybamm.Symbol
) – The variable whose boundary value to take
side (str) – Which side to take the boundary value on (“left” or “right”)
**Extends (** SpatialOperator
) –
A node in the expression tree which gets the boundary value of a variable.
child (pybamm.Symbol
) – The variable whose boundary value to take
side (str) – Which side to take the boundary value on (“left” or “right”)
**Extends (** BoundaryOperator
) –
A node in the expression tree which gets the boundary flux of a variable.
child (pybamm.Symbol
) – The variable whose boundary flux to take
side (str) – Which side to take the boundary flux on (“left” or “right”)
**Extends (** BoundaryOperator
) –
A node in the expression tree representing an upwinding or downwinding operator. Usually to be used for better stability in convection-dominated equations.
Extends: SpatialOperator
Upwinding operator. To be used if flow velocity is positive (left to right).
Extends: UpwindDownwind
Downwinding operator. To be used if flow velocity is negative (right to left).
Extends: UpwindDownwind
convenience function for creating a Divergence
symbol (Symbol
) – the divergence will be performed on this sub-symbol
the divergence of symbol
convenience function for creating a GradientSquared
symbol (Symbol
) – the inner product of the gradient with itself will be performed on this
sub-symbol
inner product of the gradient of symbol
with itself
convenience function for creating a right BoundaryValue
, usually in the
spherical geometry.
symbol (pybamm.Symbol
) – the surface value of this symbol will be returned
the surface value of symbol
convenience function for creating an average in the x-direction.
symbol (pybamm.Symbol
) – The function to be averaged
the new averaged symbol
convenience function for creating an average in the r-direction.
symbol (pybamm.Symbol
) – The function to be averaged
the new averaged symbol
convenience function for averaging over particle size R using the area-weighted particle-size distribution.
symbol (pybamm.Symbol
) – The function to be averaged
the new averaged symbol
convenience function for creating an average in the z-direction.
symbol (pybamm.Symbol
) – The function to be averaged
the new averaged symbol
convenience function for creating an average in the y-z-direction.
symbol (pybamm.Symbol
) – The function to be averaged
the new averaged symbol
convenience function for creating a pybamm.BoundaryValue
symbol (pybamm.Symbol) – The symbol whose boundary value to take
side (str) – Which side to take the boundary value on (“left” or “right”)
the new integrated expression tree