Skip to content

Commit

Permalink
#664 merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Oct 25, 2019
2 parents 8c12675 + 2af6103 commit f816cde
Show file tree
Hide file tree
Showing 37 changed files with 2,609 additions and 50 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Visual Studio format
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ pyvenv.cfg
# sundials
sundials
sundials4
SuiteSparse
SuiteSparse/.gitignore

# third party
third-party

# cmakefiles
CMakeFiles
Makefile
*.cmake
cmake_install.cmake
*.so
*.json


third-party/pybind11
Empty file added .gitmodules
Empty file.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ addons:
- libopenblas-dev
- liblapack-dev
- graphviz
- libsuitesparse-dev

matrix:
include:
Expand All @@ -30,10 +31,12 @@ matrix:
- liblapack-dev
- graphviz
- python3.6-dev
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
- python: "3.7"
addons:
apt:
Expand All @@ -46,10 +49,12 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type != cron
# Unit testing on Python3.7 on OS/X and Ubuntu
- os: osx
Expand All @@ -70,6 +75,7 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_SCIKITS_ODES=true
Expand All @@ -86,6 +92,7 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
if: type != cron
Expand All @@ -102,9 +109,11 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_COVER=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type != cron
- python: "3.7"
addons:
Expand All @@ -118,6 +127,7 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_DOCS=true
if: type != cron
Expand All @@ -133,6 +143,7 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_STYLE=true
if: type != cron
Expand All @@ -149,10 +160,12 @@ matrix:
- liblapack-dev
- graphviz
- python3.7-dev
- libsuitesparse-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type == cron

# Install graphviz for macs
Expand Down Expand Up @@ -190,6 +203,7 @@ install:
- 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;

before_script:
- python --version
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add method to evaluate parameters more easily ([#669](https://github.com/pybamm-team/PyBaMM/pull/669))
- Add `Jacobian` class to reuse known Jacobians of expressions ([#665](https://github.com/pybamm-team/PyBaMM/pull/670))
- Add `Interpolant` class to interpolate experimental data (e.g. OCP curves) ([#661](https://github.com/pybamm-team/PyBaMM/pull/661))
- Added interface (via pybind11) to sundials with the IDA KLU sparse linear solver ([#657](https://github.com/pybamm-team/PyBaMM/pull/657))
- Allow parameters to be set by material or by specifying a particular paper ([#647](https://github.com/pybamm-team/PyBaMM/pull/647))
- Set relative and absolute tolerances independently in solvers ([#645](https://github.com/pybamm-team/PyBaMM/pull/645))
- Add some non-uniform meshes in 1D and 2D ([#617](https://github.com/pybamm-team/PyBaMM/pull/617))
Expand All @@ -19,6 +20,7 @@
## Bug fixes

- Fix differentiation of functions that have more than one argument
- Add warning if `ProcessedVariable` is called outisde its interpolation range ([#681](https://github.com/pybamm-team/PyBaMM/pull/681))
- Improve the way `ProcessedVariable` objects are created in higher dimensions ([#581](https://github.com/pybamm-team/PyBaMM/pull/581))

# [v0.1.0](https://github.com/pybamm-team/PyBaMM/tree/v0.1.0) - 2019-10-08
Expand Down Expand Up @@ -66,4 +68,5 @@ with the following optional physics:
- Scipy
- Scikits ODE
- Scikits DAE
- IDA KLU sparse linear solver (Sundials)
- Algebraic (root-finding)
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.10)
project(idaklu)

set (CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_subdirectory(third-party/pybind11)
pybind11_add_module(idaklu pybamm/solvers/c_solvers/idaklu.cpp)

# Sundials
set(SUNDIALS_INCLUDE "sundials4/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)
TARGET_LINK_LIBRARIES(idaklu PRIVATE ${SUNMATSPARSE} ${IDA} ${NVECTOR} ${SUNKLU})

# link suitesparse
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
find_package(SuiteSparse OPTIONAL_COMPONENTS KLU AMD COLAMD BTF)
include_directories(${SuiteSparse_INCLUDE_DIRS})
target_link_libraries(idaklu PRIVATE ${SuiteSparse_LIBRARIES})
Loading

0 comments on commit f816cde

Please sign in to comment.