Skip to content

PyBaMM 26.8.0.0

Latest

Choose a tag to compare

@BradyPlanden BradyPlanden released this 18 Aug 09:25
79fb27f

Features

  • Added unstructured mesh support (UnstructuredSubMesh, generators, and interface coupling) for arbitrary 2D/3D domains. Hexahedra must have planar faces (warped hexes raise a GeometryError), and UserSuppliedUnstructuredMesh accepts tetrahedral, triangular, and quadrilateral cells only. (#5687)
  • Generalised VectorField to N components and added Component/Norm operators for multi-dimensional vector fields. (#5686)
  • Removed the left sidebar from the documentation home page for a cleaner landing experience. (#5699)

Bug fixes

  • IDAKLU debug logging and print_stats output are now buffered and emitted once the OpenMP region is over, instead of calling into Python from worker threads that do not hold the GIL. Solving with several input sets again produces one trace and one statistics block per input set. (#5717)
  • Buffered IDAKLU diagnostics are also flushed when a solve raises, so a failed solve still emits the trace leading up to the failure. (#5717)
  • IDAKLU diagnostics are emitted as the solve progresses whenever it runs on the calling thread, which is the one holding the GIL, so a long solve reports progress instead of going quiet until it returns. Only the solves handed to OpenMP worker threads are held back, and they are flushed at the end of the parallel region. (#5717)
  • ParameterValues.create_from_bpx no longer writes None into the parameter set for thermal material properties (density and specific heat capacity) that a BPX file omits. Absent optional BPX fields are now dropped entirely, so building an isothermal model from a thermal-less BPX still works, and building a thermal model raises PyBaMM's usual named "parameter not found" error instead of a cryptic type error deep in the expression tree. (#5708)
  • VectorField._from_json now rebuilds all N components instead of only the first two, so a field with three or more components survives serialisation instead of silently losing its extra components (which later triggered an IndexError on Component). (#5703)
  • ElectrodeSOHSolver now passes model options through, so hysteresis OCP branches are used. (#5701)
  • Fixed a memory leak in ElectrodeSOHSolver.theoretical_energy_integral, which cached a new expression tree per call. (#5695)
  • BatchStudy.solve no longer ignores its solver argument: previously the loop over study inputs shadowed it, so a caller-supplied solver was silently dropped. A solver from BatchStudy(solvers=...) still takes precedence. (#5677)
  • pybamm.citations.register now names the citation the caller passed in when a BibTeX string fails to parse, instead of whichever entry the parser had reached. (#5677)
  • Deserialising a parameter set whose interpolant specification is invalid now logs a warning naming the offending parameter, instead of printing the bare exception to stdout with no indication of which parameter fell back to zero. (#5679)
  • A user-specified boundary tag that is absent from a mesh file now raises GeometryError instead of degrading to a warning and a mesh with no boundary groups. (#5679)
  • Fixed the pybammsolvers CMake build under conda (CONDA_BUILD=1), where SUNDIALS, SuiteSparse, and CasADi are host dependencies rather than vendored: the .idaklu root defaults and the from-source bootstrap are skipped, the system CasADi is used instead of a pip one, and the libstdc++ ABI probe (which has no wheel to inspect and would wrongly force the legacy ABI) is now limited to the PyPI-CasADi path. Released as pybammsolvers v0.9.1. (#5668)

Optimizations

  • IDAKLU with output_variables now writes sensitivities straight into their final NumPy layout, removing the post-solve transpose pass and the second full-size sensitivity buffer it required. (#5717)
  • The dense scratch vector used to scatter sparse output sensitivities is now a reused member buffer instead of being allocated per output row on every step. (#5717)