pybamm.
UnaryOperator
(name, child, domain=None, auxiliary_domains=None)[source]¶A node in the expression tree representing a unary operator (e.g. ‘-‘, grad, div)
Derived classes will specify the particular operator
Extends: Symbol
Parameters: |
---|
evaluate_for_shape
()[source]¶Default behaviour: unary operator has same shape as child
See pybamm.Symbol.evaluate_for_shape()
pybamm.
Negate
(child)[source]¶A node in the expression tree representing a - negation operator
Extends: UnaryOperator
pybamm.
AbsoluteValue
(child)[source]¶A node in the expression tree representing an abs operator
Extends: UnaryOperator
diff
(variable)[source]¶See pybamm.Symbol.diff()
.
jac
(variable)[source]¶See pybamm.Symbol.jac()
.
pybamm.
Index
(child, index, name=None)[source]¶A node in the expression tree, which stores the index that should be extracted from its child after the child has been evaluated.
Parameters: |
|
---|
evaluate_for_shape
()[source]¶Default behaviour: unary operator has same shape as child
See pybamm.Symbol.evaluate_for_shape()
pybamm.
SpatialOperator
(name, child, domain=None, auxiliary_domains=None)[source]¶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
Parameters: |
---|
diff
(variable)[source]¶See pybamm.Symbol.diff()
.
jac
(variable)[source]¶See pybamm.Symbol.jac()
.
pybamm.
Gradient
(child)[source]¶A node in the expression tree representing a grad operator
Extends: SpatialOperator
pybamm.
Divergence
(child)[source]¶A node in the expression tree representing a div operator
Extends: SpatialOperator
pybamm.
Laplacian
(child)[source]¶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
pybamm.
Gradient_Squared
(child)[source]¶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
pybamm.
Mass
(child)[source]¶Returns the mass matrix for a given symbol, accounting for Dirchlet boundary
conditions where necessary (e.g. in the finite element formualtion)
Extends: SpatialOperator
evaluate_for_shape
()[source]¶Default behaviour: unary operator has same shape as child
See pybamm.Symbol.evaluate_for_shape()
pybamm.
Integral
(child, integration_variable)[source]¶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}\). Can be integration with respect to time or space.
Parameters: |
|
---|
pybamm.
IndefiniteIntegral
(child, integration_variable)[source]¶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.
Parameters: |
|
---|
pybamm.
DefiniteIntegralVector
(child, vector_type='row')[source]¶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.
Parameters: |
|
---|
pybamm.
BoundaryIntegral
(child, region='entire')[source]¶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}\).
Parameters: |
|
---|
pybamm.
DeltaFunction
(child, side, domain)[source]¶Delta function. Currently can only be implemented at the edge of a domain
Parameters: |
|
---|
pybamm.
BoundaryOperator
(name, child, side)[source]¶A node in the expression tree which gets the boundary value of a variable.
Parameters: |
|
---|
pybamm.
BoundaryValue
(child, side)[source]¶A node in the expression tree which gets the boundary value of a variable.
Parameters: |
|
---|
pybamm.
BoundaryGradient
(child, side)[source]¶A node in the expression tree which gets the boundary flux of a variable.
Parameters: |
|
---|
pybamm.
grad
(expression)[source]¶convenience function for creating a Gradient
Parameters: | expression (Symbol ) – the gradient will be performed on this sub-expression |
---|---|
Returns: | the gradient of expression |
Return type: | Gradient |
pybamm.
div
(expression)[source]¶convenience function for creating a Divergence
Parameters: | expression (Symbol ) – the divergence will be performed on this sub-expression |
---|---|
Returns: | the divergence of expression |
Return type: | Divergence |
pybamm.
laplacian
(expression)[source]¶convenience function for creating a Laplacian
Parameters: | expression (Symbol ) – the laplacian will be performed on this sub-expression |
---|---|
Returns: | the laplacian of expression |
Return type: | Laplacian |
pybamm.
grad_squared
(expression)[source]¶convenience function for creating a Gradient_Squared
Parameters: | expression (Symbol ) – the inner product of the gradient with itself will be performed on this
sub-expression |
---|---|
Returns: | inner product of the gradient of expression with itself |
Return type: | Gradient_Squared |
pybamm.
surf
(symbol, set_domain=False)[source]¶convenience function for creating a right BoundaryValue
, usually in the
spherical geometry
Parameters: | symbol (pybamm.Symbol ) – the surface value of this symbol will be returned |
---|---|
Returns: | the surface value of symbol |
Return type: | pybamm.BoundaryValue |
pybamm.
x_average
(symbol)[source]¶convenience function for creating an average in the x-direction
Parameters: | symbol (pybamm.Symbol ) – The function to be averaged |
---|---|
Returns: | the new averaged symbol |
Return type: | Symbol |
pybamm.
boundary_value
(symbol, side)[source]¶convenience function for creating a pybamm.BoundaryValue
Parameters: |
|
---|---|
Returns: | the new integrated expression tree |
Return type: |