Skip to content

Commit

Permalink
#247 merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Feb 5, 2020
2 parents 50980b5 + 93b3b25 commit 5d5db8f
Show file tree
Hide file tree
Showing 270 changed files with 7,625 additions and 8,214 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.png
/local/
*.DS_Store
*.mat

# don't ignore important .txt files
!requirements*
Expand Down
1 change: 1 addition & 0 deletions .requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ scikit-fem>=0.2.0
casadi>=3.5.0
guzzle-sphinx-theme
sphinx>=1.5
python-Levenshtein>=0.12.0
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ matrix:
env:
- PYBAMM_UNIT=true
- PYBAMM_SCIKITS_ODES=true
# Unit testing on Python3.7 on Ubuntu without scikit odes
- PYBAMM_KLU=true
# Unit and example testing on Python3.7 on Ubuntu without optional dependencies
- python: "3.7"
addons:
apt:
Expand All @@ -95,6 +96,7 @@ matrix:
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
if: type != cron
# Cover, docs and style checking, latest Python version only
- python: "3.7"
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## Features

- Added capacitance effects to lithium-ion models ()
- Added fuzzy string matching for parameters and variables ([#796](https://github.com/pybamm-team/PyBaMM/pull/796))
- Changed ParameterValues to raise an error when a parameter that wasn't previously defined is updated ([#796](https://github.com/pybamm-team/PyBaMM/pull/796))
- Added some basic models (BasicSPM and BasicDFN) in order to clearly demonstrate the PyBaMM model structure for battery models ([#795](https://github.com/pybamm-team/PyBaMM/pull/795))
- Added the harmonic mean to the Finite Volume method, which is now used when computing fluxes ([#783](https://github.com/pybamm-team/PyBaMM/pull/783))
- Refactored `Solution` to make it a dictionary that contains all of the solution variables. This automatically creates `ProcessedVariable` objects when required, so that the solution can be obtained much more easily. ([#781](https://github.com/pybamm-team/PyBaMM/pull/781))
- Added notebook to explain broadcasts ([#776](https://github.com/pybamm-team/PyBaMM/pull/776))
- Added a step to discretisation that automatically compute the inverse of the mass matrix of the differential part of the problem so that the underlying DAEs can be provided in semi-explicit form, as required by the CasADi solver ([#769](https://github.com/pybamm-team/PyBaMM/pull/769))
- Added the gradient operation for the Finite Element Method ([#767](https://github.com/pybamm-team/PyBaMM/pull/767))
- Added `InputParameter` node for quickly changing parameter values ([#752](https://github.com/pybamm-team/PyBaMM/pull/752))
- Added submodels for operating modes other than current-controlled ([#751](https://github.com/pybamm-team/PyBaMM/pull/751))
- Changed finite volume discretisation to use exact values provided by Neumann boundary conditions when computing the gradient instead of adding ghost nodes([#748](https://github.com/pybamm-team/PyBaMM/pull/748))
- Added optional R(x) distribution in particle models ([#745](https://github.com/pybamm-team/PyBaMM/pull/745))
- Generalized importing of external variables ([#728](https://github.com/pybamm-team/PyBaMM/pull/728))
- Separated active and inactive material volume fractions ([#726](https://github.com/pybamm-team/PyBaMM/pull/726))
- Added submodels for tortuosity ([#726](https://github.com/pybamm-team/PyBaMM/pull/726))
Expand All @@ -24,13 +37,20 @@

## Optimizations

- Simplified solver interface ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Added caching for shape evaluation, used during discretisation ([#780](https://github.com/pybamm-team/PyBaMM/pull/780))
- Added an option to skip model checks during discretisation, which could be slow for large models ([#739](https://github.com/pybamm-team/PyBaMM/pull/739))
- Use CasADi's automatic differentation algorithms by default when solving a model ([#714](https://github.com/pybamm-team/PyBaMM/pull/714))
- Avoid re-checking size when making a copy of an `Index` object ([#656](https://github.com/pybamm-team/PyBaMM/pull/656))
- Avoid recalculating `_evaluation_array` when making a copy of a `StateVector` object ([#653](https://github.com/pybamm-team/PyBaMM/pull/653))

## Bug fixes

- Fixed examples to run with basic pip installation ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Added events for CasADi solver when stepping ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Improved implementation of broadcasts ([#776](https://github.com/pybamm-team/PyBaMM/pull/776))
- Fixed a bug which meant that the Ohmic heating in the current collectors was incorrect if using the Finite Element Method ([#767](https://github.com/pybamm-team/PyBaMM/pull/767))
- Improved automatic broadcasting ([#747](https://github.com/pybamm-team/PyBaMM/pull/747))
- Fixed bug with wrong temperature in initial conditions ([#737](https://github.com/pybamm-team/PyBaMM/pull/737))
- Improved flexibility of parameter values so that parameters (such as diffusivity or current) can be set as functions or scalars ([#723](https://github.com/pybamm-team/PyBaMM/pull/723))
- Fixed a bug where boundary conditions were sometimes handled incorrectly in 1+1D models ([#713](https://github.com/pybamm-team/PyBaMM/pull/713))
Expand All @@ -43,9 +63,12 @@

## Breaking changes

- Removed `Outer` and `Kron` nodes as no longer used ([#777](https://github.com/pybamm-team/PyBaMM/pull/777))
- Moved `results` to separate repositories ([#761](https://github.com/pybamm-team/PyBaMM/pull/761))
- The parameters "Bruggeman coefficient" must now be specified separately as "Bruggeman coefficient (electrolyte)" and "Bruggeman coefficient (electrode)"
- The current classes (`GetConstantCurrent`, `GetUserCurrent` and `GetUserData`) have now been removed. Please refer to the [`change-input-current` notebook](https://github.com/pybamm-team/PyBaMM/blob/master/examples/notebooks/change-input-current.ipynb) for information on how to specify an input current
- Parameter functions must now use pybamm functions instead of numpy functions (e.g. `pybamm.exp` instead of `numpy.exp`), as these are then used to construct the expression tree directly. Generally, pybamm syntax follows numpy syntax; please get in touch if a function you need is missing.
- The current must now be updated by changing "Current function [A]" or "C-rate" instead of "Typical current [A]"


# [v0.1.0](https://github.com/pybamm-team/PyBaMM/tree/v0.1.0) - 2019-10-08
Expand Down
16 changes: 8 additions & 8 deletions INSTALL-LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,25 @@ Before installing scikits.odes, you need to have installed:
- Fortran compiler (e.g. gfortran)
- BLAS/LAPACK install (OpenBLAS is recommended by the scikits.odes developers)
- CMake (for building Sundials)
- Sundials 4.1.0
- Sundials 5.0.0

You can install these on Ubuntu or Debian using apt-get:

```bash
sudo apt-get install python3-dev gfortran gcc cmake libopenblas-dev
```

To install Sundials 4.1.0, on the command-line type:
To install Sundials 5.0.0, on the command-line type:

```bash
INSTALL_DIR=`pwd`/sundials
wget https://computation.llnl.gov/projects/sundials/download/sundials-4.1.0.tar.gz
tar -xvf sundials-4.1.0.tar.gz
mkdir build-sundials-4.1.0
cd build-sundials-4.1.0/
cmake -DLAPACK_ENABLE=ON -DSUNDIALS_INDEX_TYPE=int32_t -DBUILD_ARKODE:BOOL=OFF -DEXAMPLES_ENABLE:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ../sundials-4.1.0/
wget https://computation.llnl.gov/projects/sundials/download/sundials-5.0.0.tar.gz
tar -xvf sundials-5.0.0.tar.gz
mkdir build-sundials-5.0.0
cd build-sundials-5.0.0/
cmake -DLAPACK_ENABLE=ON -DSUNDIALS_INDEX_TYPE=int32_t -DBUILD_ARKODE:BOOL=OFF -DEXAMPLES_ENABLE:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ../sundials-5.0.0/
make install
rm -r ../sundials-4.1.0
rm -r ../sundials-5.0.0
```

Then install [scikits.odes](https://github.com/bmcage/odes), letting it know the sundials install location:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-2019, University of Oxford (University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK).
Copyright (c) 2018-2020, University of Oxford (University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK).
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ hosted on [Read The Docs](readthedocs.io). A set of slides giving an overview of
can be found
[here](https://github.com/pybamm-team/pybamm_summary_slides/blob/master/pybamm.pdf).

For further examples, see the list of repositories that use PyBaMM [here](https://github.com/pybamm-team/pybamm-example-results)

## How can I obtain & install PyBaMM?

### Linux
Expand Down
8 changes: 0 additions & 8 deletions docs/source/expression_tree/binary_operator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ Binary Operators
.. autoclass:: pybamm.Inner
:members:

.. autoclass:: pybamm.Outer
:members:

.. autoclass:: pybamm.Kron
:members:

.. autoclass:: pybamm.Heaviside
:members:

.. autofunction:: pybamm.outer

.. autofunction:: pybamm.source
3 changes: 3 additions & 0 deletions docs/source/expression_tree/broadcasts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Broadcasting Operators

.. autoclass:: pybamm.PrimaryBroadcast
:members:

.. autoclass:: pybamm.SecondaryBroadcast
:members:
1 change: 1 addition & 0 deletions docs/source/expression_tree/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ Expression Tree
concatenations
broadcasts
functions
input_parameter
interpolant
operations/index
5 changes: 5 additions & 0 deletions docs/source/expression_tree/input_parameter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Input Parameter
===============

.. autoclass:: pybamm.InputParameter
:members:
3 changes: 3 additions & 0 deletions docs/source/expression_tree/variable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Variable

.. autoclass:: pybamm.Variable
:members:

.. autoclass:: pybamm.ExternalVariable
:members:
3 changes: 3 additions & 0 deletions docs/source/models/lithium_ion/dfn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Doyle-Fuller-Newman (DFN)

.. autoclass:: pybamm.lithium_ion.DFN
:members:

.. autoclass:: pybamm.lithium_ion.BasicDFN
:members:
3 changes: 3 additions & 0 deletions docs/source/models/lithium_ion/spm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Single Particle Model (SPM)

.. autoclass:: pybamm.lithium_ion.SPM
:members:

.. autoclass:: pybamm.lithium_ion.BasicSPM
:members:
1 change: 0 additions & 1 deletion docs/source/models/submodels/current_collector/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ Current Collector
homogeneous_current_collector
potential_pair
quite_conductive_potential_pair
single_particle_potential_pair
set_potential_single_particle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Current control external circuit
================================

.. autoclass:: pybamm.external_circuit.CurrentControl
:members:

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Function control external circuit
=================================

.. autoclass:: pybamm.external_circuit.FunctionControl
:members:

.. autoclass:: pybamm.external_circuit.VoltageFunctionControl
:members:

.. autoclass:: pybamm.external_circuit.PowerFunctionControl
:members:
15 changes: 15 additions & 0 deletions docs/source/models/submodels/external_circuit/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
External circuit
================

Models to enforce different boundary conditions (as imposed by an imaginary external
circuit) such as constant current, constant voltage, constant power, or any other
relationship between the current and voltage. "Current control" enforces these directly
through boundary conditions, while "Function control"
submodels add an algebraic equation (for the current) and hence can be used to set any
variable to be constant.

.. toctree::
:maxdepth: 1

current_control_external_circuit
function_control_external_circuit
1 change: 1 addition & 0 deletions docs/source/models/submodels/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Submodels
convection/index
electrode/index
electrolyte/index
external_circuit/index
interface/index
oxygen_diffusion/index
particle/index
Expand Down
2 changes: 0 additions & 2 deletions docs/source/processed_variable.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Post-Process Variables
======================

.. autofunction:: pybamm.post_process_variables

.. autoclass:: pybamm.ProcessedVariable
:members:
6 changes: 0 additions & 6 deletions docs/source/solvers/base_solvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ Base Solvers

.. autoclass:: pybamm.BaseSolver
:members:

.. autoclass:: pybamm.OdeSolver
:members:

.. autoclass:: pybamm.DaeSolver
:members:
Loading

0 comments on commit 5d5db8f

Please sign in to comment.