Skip to content

Commit

Permalink
#646 merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Feb 10, 2020
2 parents e3d2171 + ffd0d37 commit 45adb23
Show file tree
Hide file tree
Showing 286 changed files with 11,832 additions and 9,161 deletions.
7 changes: 7 additions & 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 Expand Up @@ -69,6 +70,12 @@ pyvenv.cfg
# sundials
sundials
sundials4
sundials-*
SuiteSparse-*
build_sundials

# downloads
*.gz

# third party
third-party
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
23 changes: 20 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ matrix:
- PYBAMM_UNIT=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
# Unit testing on Python3.7 on Ubuntu without scikit odes
# Unit and example testing on Python3.7 on Ubuntu without optional dependencies
- python: "3.7"
addons:
apt:
Expand All @@ -98,6 +98,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 Expand Up @@ -203,12 +204,28 @@ before_install: |
# without the packages from -dev and -doc!
install:
- pip install --upgrade pip
# In order to download SUNDIALS and SuiteSparse
- pip install wget
- pip install .
- if [[ $PYBAMM_DOCS == true ]]; then pip install -e .[docs]; fi;
- if [[ $PYBAMM_STYLE == true || $PYBAMM_EXAMPLES ]]; then pip install -e .[dev]; fi;
- if [[ $PYBAMM_COVER == true ]]; then pip install coverage codecov; fi;
- if [[ $PYBAMM_SCIKITS_ODES == true ]]; then source scripts/install_scikits_odes.sh; fi;
- if [[ $PYBAMM_KLU == true ]]; then source scripts/install_sundials_4.1.0.sh; fi;
- |
if [[ $PYBAMM_SCIKITS_ODES == true ]]; then
python setup.py install_odes -f;
export LD_LIBRARY_PATH=sundials/lib:$LD_LIBRARY_PATH
fi;
- |
if [[ $PYBAMM_KLU == true ]]; then
mkdir -p third-party;
cd third-party;
rm -rf pybind11;
git clone https://github.com/pybind/pybind11.git;
cd ../;
python setup.py install_klu -f;
export LD_LIBRARY_PATH=sundials/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=SuiteSparse-5.6.0/lib:$LD_LIBRARY_PATH
fi;
before_script:
- python --version
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,18 @@

## Features

- 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 +36,21 @@

## Optimizations

- Now simplifying objects that are constant as soon as they are created ([#801](https://github.com/pybamm-team/PyBaMM/pull/801))
- 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 @@ -44,9 +64,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
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ add_subdirectory(third-party/pybind11)
pybind11_add_module(idaklu pybamm/solvers/c_solvers/idaklu.cpp)

# Sundials
set(SUNDIALS_INCLUDE "sundials4/include")
set(SUNDIALS_INCLUDE "sundials/include")
TARGET_INCLUDE_DIRECTORIES(idaklu PRIVATE ${SUNDIALS_INCLUDE})

find_library(SUNMATSPARSE sundials_sunmatrixsparse PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(IDA sundials_ida PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(NVECTOR sundials_nvecserial PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(SUNKLU sundials_sunlinsolklu PATHS "sundials4/lib" NO_DEFAULT_PATH)
find_library(SUNMATSPARSE sundials_sunmatrixsparse PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(IDA sundials_ida PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(NVECTOR sundials_nvecserial PATHS "sundials/lib" NO_DEFAULT_PATH)
find_library(SUNKLU sundials_sunlinsolklu PATHS "sundials/lib" NO_DEFAULT_PATH)
TARGET_LINK_LIBRARIES(idaklu PRIVATE ${SUNMATSPARSE} ${IDA} ${NVECTOR} ${SUNKLU})

# link suitesparse
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
set(SuiteSparse_ROOT SuiteSparse-5.6.0)
find_package(SuiteSparse OPTIONAL_COMPONENTS KLU AMD COLAMD BTF)
include_directories(${SuiteSparse_INCLUDE_DIRS})
target_link_libraries(idaklu PRIVATE ${SuiteSparse_LIBRARIES})
161 changes: 0 additions & 161 deletions INSTALL-KLU.md

This file was deleted.

Loading

0 comments on commit 45adb23

Please sign in to comment.