3D Sub Meshes#

class pybamm.ScikitFemSubMesh3D(skfem_mesh, nodes, elements, coord_sys, tabs=None)[source]#

A 3D submesh class for unstructured tetrahedral meshes generated by scikit-fem.

Parameters:
  • skfem_mesh (skfem.MeshTet) – The scikit-fem mesh object

  • nodes (array_like) – Array of node coordinates (npts, 3)

  • elements (array_like) – Array of element connectivity (nelements, 4)

  • coord_sys (str) – The coordinate system of the submesh

  • tabs (dict, optional) – Information about tabs (unused in 3D)

Extends: pybamm.meshes.meshes.SubMesh

to_json()[source]#

Convert mesh to JSON format.

class pybamm.ScikitFemGenerator3D(geom_type, **gen_params)[source]#

A mesh generator that creates 3D tetrahedral meshes using scikit-fem.

Parameters:
  • geom_type (str) – The type of geometry to generate. Must be one of “pouch” for a rectangular prism, or “cylinder” for a cylindrical annulus.

  • gen_params (dict) –

    A dictionary of geometry-specific parameters. for eg:

    • ”h”float, optional

      The target characteristic length of the mesh elements. A smaller ‘h’ results in a finer mesh and a more accurate solution, but increases computation time. Default is 0.3.

Extends: pybamm.meshes.meshes.MeshGenerator