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: |
---|
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()
.
pybamm.
Sign
(child)[source]¶A node in the expression tree representing a sign operator.
Extends: UnaryOperator
diff
(variable)[source]¶See pybamm.Symbol.diff()
.
pybamm.
Index
(child, index, name=None, check_size=True)[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: |
|
---|
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()
.
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.
GradientSquared
(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
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}\).
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.
UpwindDownwind
(name, child)[source]¶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
pybamm.
Upwind
(child)[source]¶Upwinding operator. To be used if flow velocity is positive (left to right).
Extends: UpwindDownwind
pybamm.
Downwind
(child)[source]¶Downwinding operator. To be used if flow velocity is negative (right to left).
Extends: UpwindDownwind
pybamm.
grad
(symbol)[source]¶convenience function for creating a Gradient
Parameters: | symbol (Symbol ) – the gradient will be performed on this sub-symbol |
---|---|
Returns: | the gradient of symbol |
Return type: | Gradient |
pybamm.
div
(symbol)[source]¶convenience function for creating a Divergence
Parameters: | symbol (Symbol ) – the divergence will be performed on this sub-symbol |
---|---|
Returns: | the divergence of symbol |
Return type: | Divergence |
pybamm.
laplacian
(symbol)[source]¶convenience function for creating a Laplacian
Parameters: | symbol (Symbol ) – the laplacian will be performed on this sub-symbol |
---|---|
Returns: | the laplacian of symbol |
Return type: | Laplacian |
pybamm.
grad_squared
(symbol)[source]¶convenience function for creating a GradientSquared
Parameters: | symbol (Symbol ) – the inner product of the gradient with itself will be performed on this
sub-symbol |
---|---|
Returns: | inner product of the gradient of symbol with itself |
Return type: | GradientSquared |
pybamm.
surf
(symbol)[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.
r_average
(symbol)[source]¶convenience function for creating an average in the r-direction.
Parameters: | symbol (pybamm.Symbol ) – The function to be averaged |
---|---|
Returns: | the new averaged symbol |
Return type: | Symbol |
pybamm.
size_average
(symbol)[source]¶convenience function for averaging over particle size R using the area-weighted particle-size distribution.
Parameters: | symbol (pybamm.Symbol ) – The function to be averaged |
---|---|
Returns: | the new averaged symbol |
Return type: | Symbol |
pybamm.
z_average
(symbol)[source]¶convenience function for creating an average in the z-direction.
Parameters: | symbol (pybamm.Symbol ) – The function to be averaged |
---|---|
Returns: | the new averaged symbol |
Return type: | Symbol |
pybamm.
yz_average
(symbol)[source]¶convenience function for creating an average in the y-z-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: |