pybamm.Mesh
dict
required
Geometry dictionary produced by e.g.
pybamm.battery_geometry() after calling param.process_geometry(geometry).dict
required
Maps domain name → submesh class or
MeshGenerator instance. Example:dict
required
Maps spatial variable → number of cell-centre nodes. Can use variable objects or name strings as keys:
pybamm.MeshGenerator
A thin wrapper that pairs a submesh class with any extra keyword arguments needed at construction time.
Submesh Types
Uniform1DSubMesh
Uniformly spaced nodes across the domain.
Exponential1DSubMesh
Exponentially stretched nodes — concentrated near one or both boundaries.
str
default:"\"symmetric\""
Which boundary to cluster near:
"left", "right", or "symmetric".float
default:"1.15 (symmetric) / 2.3 (left or right)"
Stretching factor α. As node count → ∞, the ratio of largest to smallest cell → exp(α).
Chebyshev1DSubMesh
Nodes placed at Chebyshev collocation points on (a, b), clustered near both boundaries.
UserSupplied1DSubMesh
Use your own array of edge locations.
Uniform2DSubMesh
Uniform 2D mesh for current-collector domains. Requires ScikitFiniteElement as the corresponding spatial method.
Controlling Resolution with var_pts
The var_pts dictionary is the primary knob for trading accuracy against speed: