Skip to content
Snippets Groups Projects
Commit dd2fb694 authored by Elias Barbers's avatar Elias Barbers
Browse files

version 2.25.0

parent 5c131b9f
No related branches found
No related tags found
No related merge requests found
Showing
with 587 additions and 110 deletions
......@@ -5,6 +5,7 @@ build*/
*.swp
*.gch
*.csv
!/scenariotest/simulink_test/*.csv
*.diff
*.mat
!/src/unittests/container/*.mat
......@@ -40,3 +41,5 @@ __pycache__/
!/scenariotest/standalone_test/*.csv
!/scenariotest/simulink_test/reference/*/*.mat
!/scenarios/*/*.csv
secrets/
testing/*
# define stages
stages:
- build_framework
- build
- test
- docs
- pages
- build-docker
- build-framework
- build
- test
- docs
- deploy-docs
- build-interactive-docker
# configure workflow
workflow:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "web"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
# set defaults
default:
tags: [ 'docker' ]
# set varialbes
variables:
DOCKER_BUILDKIT: 1
DOCKER_DRIVER: overlay2
IMAGE_TAG_LINUX_COMPILE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}_linux_compile"
IMAGE_TAG_LINUX_TEST: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}_linux_test"
IMAGE_TAG_LINUX_INTERACTIVE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}_linux_interactive"
IMAGE_TAG_LINUX_INTERACTIVE_MATLAB: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}_linux_interactive_matlab"
IMAGE_TAG_WINDOWSCC_COMPILE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}_windowscc_compile"
.ccache_init: &ccache_init
before_script:
- export PATH=/usr/lib/ccache:$PATH
- export CCACHE_BASEDIR="${CI_PROJECT_DIR}"
- export CCACHE_DIR="${CI_PROJECT_DIR}/ccache"
- mkdir -p ${CI_PROJECT_DIR}/ccache
cache:
key: "$TARGET_OS"
paths:
- ccache/
docker-retag-images:
image: docker:20.10
stage: build-docker
rules:
- changes:
- docker/*
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- export CI_MERGE_REQUEST_TARGET_BRANCH_SLUG=$(echo -n ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} | tr [:upper:] [:lower:] | tr -c [:alnum:] '-')
- 'docker tag "${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_TARGET_BRANCH_SLUG}_linux_compile" $IMAGE_TAG_LINUX_COMPILE || :'
- 'docker tag "${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_TARGET_BRANCH_SLUG}_linux_test" $IMAGE_TAG_LINUX_TEST || :'
- 'docker tag "${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_TARGET_BRANCH_SLUG}_windowscc_compile" $IMAGE_TAG_WINDOWSCC_COMPILE || :'
- 'docker push $IMAGE_TAG_LINUX_COMPILE || :'
- 'docker push $IMAGE_TAG_LINUX_TEST || :'
- 'docker push $IMAGE_TAG_WINDOWSCC_COMPILE || :'
# build docker image and push it into GitLab container registry
docker-build-linux-compile:
# Use the official docker image.
image: docker:20.10
stage: build-docker
rules:
- changes:
- docker/*
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker build docker --target iseaframelinux --cache-from $IMAGE_TAG_LINUX_COMPILE --tag $IMAGE_TAG_LINUX_COMPILE --build-arg BASE_IMAGE="base"
- docker push $IMAGE_TAG_LINUX_COMPILE
# build docker image and push it into GitLab container registry
docker-build-linux-test:
# Use the official docker image.
image: docker:20.10
stage: build-docker
rules:
- changes:
- docker/*
needs: [ "docker-build-linux-compile" ]
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker tag $IMAGE_TAG_LINUX_COMPILE $IMAGE_TAG_LINUX_TEST
- docker push $IMAGE_TAG_LINUX_TEST
docker-build-windowscc-compile:
# Use the official docker image.
image: docker:20.10
stage: build-docker
rules:
- changes:
- docker/*
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker build docker --target iseaframecc --cache-from $IMAGE_TAG_WINDOWSCC_COMPILE --tag $IMAGE_TAG_WINDOWSCC_COMPILE --build-arg BASE_IMAGE="base"
- docker push $IMAGE_TAG_WINDOWSCC_COMPILE
linux_compile:
stage: build_framework
stage: build-framework
image: $IMAGE_TAG_LINUX_COMPILE
variables:
TARGET_OS: "linux"
needs:
- job: docker-build-linux-compile
optional: true
- job: docker-retag-images
optional: true
artifacts:
paths:
- buildReleaseLinux
- src/exceptions/xmlData.cpp
- src/version/version.cpp
- src/version/version.h
- buildReleaseLinux
- src/exceptions/xmlData.cpp
- src/version/version.cpp
- src/version/version.h
expire_in: 1 week
<<: *ccache_init
script:
- ./buildtools/make_release.sh -c -b buildReleaseLinux ./ ; cd buildReleaseLinux ; make -j32 framework unittests
only:
- master
- web
tags:
- linux
- ./buildtools/make_release.sh -m -c -b buildReleaseLinux ./ ; cd buildReleaseLinux ; make -j32 framework unittests
windows_compile:
stage: build_framework
stage: build-framework
image: $IMAGE_TAG_WINDOWSCC_COMPILE
variables:
TARGET_OS: "windows"
needs:
- job: docker-build-windowscc-compile
optional: true
- job: docker-retag-images
optional: true
artifacts:
paths:
- buildReleaseWindows
- buildReleaseWindows
- src/exceptions/xmlData.cpp
- src/version/version.cpp
- src/version/version.h
expire_in: 1 week
<<: *ccache_init
script:
- ./buildtools/make_release.sh -w -c -b buildReleaseWindows ./ ; cd buildReleaseWindows ; make -j32 framework unittests
only:
- master
- web
tags:
- linux
- ./buildtools/make_release.sh -m -w -c -b buildReleaseWindows ./ ; cd buildReleaseWindows ; make -j32 ISEAFrameNumeric
linux_standalones:
stage: build
image: $IMAGE_TAG_LINUX_COMPILE
variables:
TARGET_OS: "linux"
needs: [ "linux_compile" ]
artifacts:
paths:
- buildReleaseLinux/standalones
- buildReleaseLinux/standalones
<<: *ccache_init
script:
- cd buildReleaseLinux ; make -j32 standalones
only:
- master
- web
tags:
- linux
windows_standalones:
stage: build
image: $IMAGE_TAG_WINDOWSCC_COMPILE
variables:
TARGET_OS: "windows"
needs: [ "windows_compile" ]
artifacts:
paths:
- buildReleaseWindows/standalones
- buildReleaseWindows/standalones
<<: *ccache_init
script:
- cd buildReleaseWindows ; make -j32 standalones
only:
- master
- web
tags:
- linux
windows_simulink_converter:
stage: build
artifacts:
paths:
- buildReleaseWindows/simulinkConverter
script:
- cd buildReleaseWindows ; make -j32 simulinkConverter
only:
- master
- web
tags:
- linux
unittest_numeric:
stage: test
image: $IMAGE_TAG_LINUX_TEST
needs:
- linux_compile
- job: docker-build-linux-test
optional: True
- job: docker-retag-images
optional: true
script:
- cd buildReleaseLinux/unittest; ./unittestNumeric
only:
- master
- web
tags:
- linux
unittest_symbolic:
stage: test
image: $IMAGE_TAG_LINUX_TEST
needs:
- linux_compile
- job: docker-build-linux-test
optional: True
- job: docker-retag-images
optional: true
script:
- cd buildReleaseLinux/unittest; ./unittestSymbolic
only:
- master
- web
tags:
- linux
unittest_valgrind:
stage: test
image: $IMAGE_TAG_LINUX_TEST
needs:
- linux_compile
- job: docker-build-linux-test
optional: True
- job: docker-retag-images
optional: true
script:
- cd buildReleaseLinux/unittest/; ../../buildtools/valgrind.sh
only:
- master
- web
tags:
- linux
standalone_test:
stage: test
image: $IMAGE_TAG_LINUX_TEST
needs:
- linux_standalones
- job: docker-build-linux-test
optional: True
- job: docker-retag-images
optional: true
artifacts:
paths:
- scenariotest/standalone_test/output.txt
- scenariotest/standalone_test/output.txt
expire_in: 1 week
script:
- cd scenariotest/standalone_test/; ./runTests.sh ../../buildReleaseLinux/standalones | tee output.txt
only:
- master
- web
tags:
- linux
- set -o pipefail ; cd scenariotest/standalone_test/; ./runTests.sh ../../buildReleaseLinux/standalones | tee output.txt
documentation:
stage: docs
image: $IMAGE_TAG_LINUX_COMPILE
needs: [ "linux_compile" ]
artifacts:
paths:
- buildReleaseLinux/docRelease/html
- buildReleaseLinux/docRelease/html
script:
- cd buildReleaseLinux ; make -j32 docRelease
only:
- master
- web
tags:
- linux
- cd buildReleaseLinux
- set -o pipefail ; make -j32 docRelease | tee output.txt
- (! grep "^error:" output.txt)
development_documentation:
stage: docs
image: $IMAGE_TAG_LINUX_COMPILE
needs: [ "linux_compile" ]
artifacts:
paths:
- buildReleaseLinux/doc/html
- buildReleaseLinux/doc/html
script:
- cd buildReleaseLinux ; make -j32 doc
only:
- master
- web
tags:
- linux
- cd buildReleaseLinux
- set -o pipefail ; make -j32 doc | tee output.txt
- (! grep "^error:" output.txt)
pages:
stage: pages
stage: deploy-docs
image: alpine:latest
needs: [ "development_documentation" ]
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
artifacts:
paths:
- public
script:
- cp -r buildReleaseLinux/docRelease/html public
only:
- master
tags:
- linux
- cp -r buildReleaseLinux/doc/html public
# build docker image and push it into GitLab container registry
docker-build-linux-interactive:
# Use the official docker image.
image: docker:20.10
stage: build-interactive-docker
needs: [ "linux_standalones" ]
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- mkdir -p docker/executables
- cp -r buildReleaseLinux/standalones/* docker/executables
- mkdir -p docker/sFunctions
- docker build docker --target iseaframeinteractive --cache-from $IMAGE_TAG_LINUX_INTERACTIVE --tag $IMAGE_TAG_LINUX_INTERACTIVE --build-arg BASE_IMAGE="base"
- docker push $IMAGE_TAG_LINUX_INTERACTIVE
Version 2.25.0
===========
- Add MaxAlphaCapacity, MaxAlphaResistance, MaxBetaCapacity, and MaxBetaResistance XML parameters to specify maximum aging coefficients
- Add XML options MaximalOperationalCellVoltageV and MinimalOperationalCellVoltageV to skip parts of the current profile that would over- or undercharge a cell
Version 2.24.1
===========
- Fix S-functions build for windows
......
......@@ -5,9 +5,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
cmake_policy(SET CMP0009 NEW)
set(ISEAFrameVERSION_MAJOR 2)
set(ISEAFrameVERSION_MINOR 24)
set(ISEAFramePATCH_LEVEL 1)
set(ISEAFrameNAME "misc")
set(ISEAFrameVERSION_MINOR 25)
set(ISEAFramePATCH_LEVEL 0)
set(ISEAFrameNAME "max_aging")
set(ISEAFrameVERSION
"${ISEAFrameVERSION_MAJOR}.${ISEAFrameVERSION_MINOR}.${ISEAFramePATCH_LEVEL}"
)
......
......@@ -26,6 +26,9 @@ function PrintHelp
PrintMessage "-b <builddir>\t\tSpecify the build dir. Default is \"build\""
PrintMessage "-c\t\tOnly configure, do not start the build process."
PrintMessage "-j <n>\t\tUse n threads for building. Default is 20."
PrintMessage "-m\t\tDo not include Matlab-dependent builds"
PrintMessage "-s\t\tDo not include s-functions"
PrintMessage "-e <e>\t\tAppend e to cmake command line options. Default is ''."
}
function RunCMake
......@@ -43,7 +46,18 @@ function RunCMake
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Release -DARCH_TYPE:STRING=64 -DBUILD_AGING:BOOL=ON -DBUILD_NUMERIC:BOOL=ON -DBUILD_SYMBOLIC:BOOL=ON -DBUILD_UNITTESTS:BOOL=ON -DBUILD_DOCS:BOOL=ON -DCREATE_RELEASE_DIRS:BOOL=ON"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_VISUALIZER:BOOL=ON -DBUILD_DOT_EXPORT:BOOL=ON -DBUILD_QUICKVERIFICATION:BOOL=ON -DBUILD_SVG_EXPORT:BOOL=ON -DBUILD_ELECTRICAL_SIMULATION:BOOL=ON -DBUILD_THERMAL_SIMULATION:BOOL=ON -DBUILD_THERMAL_ELECTRICAL_SIMULATION:BOOL=ON -DBUILD_AGING_SIMULATION:BOOL=ON -DBUILD_GETTOTALCAPACITY:BOOL=ON"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_EIGENWERTE:BOOL=ON -DBUILD_SYMBOLICOPTIMIZATION:BOOL=ON -DBUILD_SYMBOLIC_2_TEX:BOOL=ON -DBUILD_SYSTEM_2_TEX:BOOL=ON -DBUILD_SYSTEM_2_MATLAB:BOOL=ON -DBUILD_SYSTEM_2_SYMBOLIC:BOOL=ON"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_S_FUNCTIONS:BOOL=ON -DBUILD_SIMULINK_MATRIX_MODEL:BOOL=ON"
if [ $MATLAB -eq 1 ]
then
if [ $SFUNCTIONS -eq 1 ]
then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_S_FUNCTIONS:BOOL=ON -DBUILD_SIMULINK_MATRIX_MODEL:BOOL=ON"
else
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_S_FUNCTIONS:BOOL=OFF -DBUILD_SIMULINK_MATRIX_MODEL:BOOL=ON"
fi
else
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_S_FUNCTIONS:BOOL=OFF -DBUILD_SIMULINK_MATRIX_MODEL:BOOL=OFF"
fi
CMAKE_OPTIONS="$CMAKE_OPTIONS $CMAKE_EXTRA_OPTIONS"
cmake $CMAKE_OPTIONS ..
cmake $CMAKE_OPTIONS ..
......@@ -66,7 +80,9 @@ function main
ONLY_CONFIGURE=0
BUILDDIR=build
THREADS=20
while getopts "hwb:cj:" opt; do
MATLAB=1
SFUNCTIONS=1
while getopts "hwb:cj:e:ms" opt; do
case "$opt" in
h) PrintHelp
exit 0
......@@ -79,6 +95,12 @@ function main
;;
j) THREADS=$OPTARG
;;
m) MATLAB=0
;;
s) SFUNCTIONS=0
;;
e) CMAKE_EXTRA_OPTIONS=$OPTARG
;;
esac
done
......@@ -124,4 +146,4 @@ function main
fi
}
main $@
main "$@"
......@@ -12,7 +12,7 @@ find_path(
find_library(
MATIO_LIBRARY
NAMES matio${ARCH_TYPE} libmatio${ARCH_TYPE} matio libmatio
PATHS ${FRAMEWORK_EXTENSION_FOLDER}/lib/ $ENV{HOME}/lib)
PATHS ${FRAMEWORK_EXTENSION_FOLDER}/lib/ ${FRAMEWORK_EXTENSION_FOLDER}/lib/64 $ENV{HOME}/lib)
mark_as_advanced(MATIO_INCLUDE_DIR)
mark_as_advanced(MATIO_LIBRARY)
......
## Commands for local use of the docker environment.
Build docker image
'DOCKER_BUILDKIT=1 docker build . -t iseaframe_cicd:latest \
--secret id=MATLAB_LICENSE_KEY,src=secrets/MATLAB_LICENSE_KEY.txt \
--secret id=MATLAB_NETWORK_LICENSE,src=secrets/MATLAB_NETWORK_LICENSE.txt \
--secret id=MATLAB_UNIX_NETRC,src=secrets/MATLAB_UNIX_NETRC.txt \
--secret id=MATLAB_WIN_NETRC,src=secrets/MATLAB_WIN_NETRC.txt \
--secret id=FRAMEWORKEXTENSIONS_NETRC,src=secrets/FRAMEWORKEXTENSIONS_NETRC.txt \
--progress=plain'
Build local docker image
'DOCKER_BUILDKIT=1 docker build . -t iseaframe_cicd:local -f Dockerfile.local'
Run local docker image
'docker run --rm -it iseaframe_cicd:local'
ARG BASE_IMAGE=base
FROM phusion/baseimage:hirsute AS iseaframe-base
FROM mathworks/matlab:r2020b AS iseaframe-matlab
FROM iseaframe-${BASE_IMAGE} AS iseaframebase
ARG DEBIAN_FRONTEND=noninteractive
# Set locale environment
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8
# install base packages
RUN set -ex ; \
apt-get update ; \
apt-get -y -qq install --no-install-recommends \
build-essential \
cxxtest \
doxygen \
g++ \
gcc \
git \
make \
python3 \
python3-pip \
cmake \
libeigen3-dev \
libmatio-dev \
libarmadillo-dev \
valgrind \
graphviz ; \
apt-get -y -qq install --no-install-recommends ccache ; \
rm -rf /var/lib/apt/lists/*
# install python packages
RUN pip install --no-cache-dir numpy matplotlib scipy
FROM iseaframebase AS iseaframelinux
# noop if base=matlab, needed otherwise
COPY --from=iseaframe-matlab /opt/matlab/R2020b/appdata/version.xml /usr/local/MATLAB/R2020b/appdata/version.xml
COPY --from=iseaframe-matlab /opt/matlab/R2020b/extern /usr/local/MATLAB/R2020b/extern/
COPY --from=iseaframe-matlab /opt/matlab/R2020b/bin/mexext /usr/local/MATLAB/R2020b/bin/
COPY --from=iseaframe-matlab /opt/matlab/R2020b/bin/glnxa64/libmat.so /usr/local/MATLAB/R2020b/bin/glnxa64/
COPY --from=iseaframe-matlab /opt/matlab/R2020b/bin/glnxa64/libmex.so /usr/local/MATLAB/R2020b/bin/glnxa64/
COPY --from=iseaframe-matlab /opt/matlab/R2020b/bin/glnxa64/libmx.so /usr/local/MATLAB/R2020b/bin/glnxa64/
# lbzip2 package in ubuntu hirsute is broken https://bugs.launchpad.net/ubuntu/+source/lbzip2/+bug/1926092
# temporarily installed from focal repo
# install boost
RUN set -ex; \
cp /etc/apt/sources.list /etc/apt/sources.list.bu ; \
echo "deb http://cz.archive.ubuntu.com/ubuntu focal main universe" > /etc/apt/sources.list ; \
apt-get update; \
apt-get install -y --no-install-recommends \
wget \
lbzip2 ; \
mkdir -p /usr/src/boost; \
cd /usr/src; \
wget -O boost.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/1.67.0/source/boost_1_67_0.tar.bz2; \
tar -I lbzip2 -xf boost.tar.bz2 -C boost --strip-components=1; \
cd boost; \
./bootstrap.sh; \
./b2 install -j 32; \
cd ..; \
rm -r boost; \
rm boost.tar.bz2; \
apt-get autoremove -y wget lbzip2 ; \
mv /etc/apt/sources.list.bu /etc/apt/sources.list ; \
rm -rf /var/lib/apt/lists/*
FROM iseaframebase AS iseaframecc
RUN set -ex ; \
apt-get update ; \
apt-get -y -qq install --no-install-recommends \
g++-mingw-w64 ; \
rm -rf /var/lib/apt/lists/* ; \
cd /usr/lib/ccache ; \
ln -s $(which ccache) i686-w64-mingw32-gcc-posix ; \
ln -s $(which ccache) i686-w64-mingw32-g++-posix ; \
ln -s $(which ccache) i686-w64-mingw32-windres ; \
ln -s $(which ccache) x86_64-w64-mingw32-g++-posix ; \
ln -s $(which ccache) x86_64-w64-mingw32-gcc-posix ; \
ln -s $(which ccache) x86_64-w64-mingw32-windres
# lbzip2 package in ubuntu hirsute is broken https://bugs.launchpad.net/ubuntu/+source/lbzip2/+bug/1926092
# temporarily installed from focal repo
# install boost
COPY patches/boost/gcc.jam.patch /usr/src/patches/boost/gcc.jam.patch
COPY patches/boost/mc.jam.patch /usr/src/patches/boost/mc.jam.patch
RUN set -ex; \
cp /etc/apt/sources.list /etc/apt/sources.list.bu ; \
echo "deb http://cz.archive.ubuntu.com/ubuntu focal main universe" > /etc/apt/sources.list ; \
apt-get update; \
apt-get install -y --no-install-recommends \
wget \
patch \
lbzip2 ; \
mkdir -p /usr/src/boost; \
cd /usr/src; \
wget -O boost.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2; \
tar -I lbzip2 -xf boost.tar.bz2 -C boost --strip-components=1; \
cd boost; \
patch /usr/src/boost/tools/build/src/tools/gcc.jam /usr/src/patches/boost/gcc.jam.patch ; \
patch /usr/src/boost/tools/build/src/tools/mc.jam /usr/src/patches/boost/mc.jam.patch ; \
echo "using gcc : mingw : x86_64-w64-mingw32-g++-posix ;" > user-config.jam; \
./bootstrap.sh mingw; \
./b2 --user-config=./user-config.jam toolset=gcc-mingw mc-compiler=windmc target-os=windows variant=release address-model=64 stage -j $(nproc) || :; \
mkdir -p /usr/x86_64-w64-mingw32/FrameworkExtensions/boost; \
mkdir -p /usr/x86_64-w64-mingw32/FrameworkExtensions/include; \
mkdir -p /usr/x86_64-w64-mingw32/FrameworkExtensions/lib; \
cp -R /usr/src/boost/boost /usr/x86_64-w64-mingw32/FrameworkExtensions/include/boost; \
cp stage/lib/* /usr/x86_64-w64-mingw32/FrameworkExtensions/lib/; \
cd ..; \
rm -r patches; \
rm -r boost; \
rm boost.tar.bz2; \
apt-get autoremove -y wget patch lbzip2 ; \
mv /etc/apt/sources.list.bu /etc/apt/sources.list ; \
rm -rf /var/lib/apt/lists/*
# install zlib
COPY ToolchainWin64.cmake /usr/src/toolchain_files/ToolchainWin64.cmake
RUN cd /usr/src ; \
git clone https://github.com/madler/zlib.git ; \
mkdir zlib/build ; \
cd zlib/build ; \
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/src/toolchain_files/ToolchainWin64.cmake ; \
make -j8 ; \
make install ; \
mkdir -p /usr/x86_64-w64-mingw32/FrameworkExtensions/lib/64/ ; \
cp libzlib.dll /usr/x86_64-w64-mingw32/FrameworkExtensions/lib/64/
# install matio
RUN cd /usr/src ; \
git clone https://github.com/tbeu/matio.git ; \
mkdir matio/build ; \
cd matio/build ; \
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/src/toolchain_files/ToolchainWin64.cmake -DMATIO_MAT73:BOOL=OFF -DMATIO_WITH_HDF5:BOOL=OFF -DMATIO_SHARED:BOOL=OFF ; \
make -j8 ; \
make install ; \
cp libmatio.a /usr/x86_64-w64-mingw32/FrameworkExtensions/lib/libmatio64.lib ; \
mkdir -p /usr/x86_64-w64-mingw32/FrameworkExtensions/include/ ; \
cp ../src/*.h /usr/x86_64-w64-mingw32/FrameworkExtensions/include/ ; \
cp ./src/*.h /usr/x86_64-w64-mingw32/FrameworkExtensions/include/
RUN cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/x86_64-w64-mingw32/FrameworkExtensions/lib/64/libwinpthread-1.dll ; \
cp -r /usr/include/eigen3 /usr/x86_64-w64-mingw32/FrameworkExtensions/include/eigen3 ; \
cp -r /usr/include/armadillo_bits /usr/x86_64-w64-mingw32/FrameworkExtensions/include/armadillo_bits ; \
cp /usr/include/armadillo /usr/x86_64-w64-mingw32/FrameworkExtensions/include/armadillo
FROM iseaframelinux AS iseaframedev
RUN set -ex ; \
apt-get update ; \
apt-get -y install --no-install-recommends \
liblapack-dev \
libmpich-dev \
libopenblas-dev \
clang \
clang-format \
clang-tidy \
git-lfs ; \
rm -rf /var/lib/apt/lists/*
FROM iseaframedev AS iseaframeinteractive
COPY set-home-permissions.sh /etc/my_init.d/set-home-permissions.sh
RUN set -ex ; \
useradd -m -s /bin/bash -G sudo,docker_env isea ; \
echo "isea:docker" | chpasswd ; \
echo "isea ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers ; \
rm /etc/my_init.d/10_syslog-ng.init ; \
chmod +x /etc/my_init.d/set-home-permissions.sh ; \
ldconfig
COPY --chown=root:root executables /usr/local/bin/
COPY --chown=isea:isea sFunctions /opt/iseaframe/
USER isea
ENV ISEA_HOME /home/isea
RUN set -ex ; \
touch $ISEA_HOME/.sudo_as_admin_successful ; \
mkdir $ISEA_HOME/shared
VOLUME /home/isea/shared
WORKDIR /home/isea
USER root
ENTRYPOINT ["/sbin/my_init","--quiet","--","/sbin/setuser","isea","/bin/bash","-l","-c"]
CMD ["/bin/bash","-i"]
FROM iseaframe_cicd:latest
COPY . /usr/src/iseaframe
WORKDIR /usr/src/iseaframe
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR "64")
set(ARCH_TYPE
"64"
CACHE STRING "")
# which compilers to use for C and C++
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# For static library creation the indexer should be run only once, e.g. by executing ranlib in the end.
# Hence, ar should be instructed to *not* index the static library.
set(CMAKE_STATIC_LINKER_FLAGS -S)
# some variables are apparently not propagated from the toolchain file, but the
# cache should always work
set(TOOLCHAIN_COMPILE_OPTIONS
"-O2 -Wa,-mbig-obj -static -static-libgcc -static-libstdc++ -lgcc -lstdc++ -Wl,-Bstatic -lpthread"
CACHE STRING "Compile options specified by the toolchain file")
set(TOOLCHAIN_LINK_OPTIONS
"-Bstatic -static-libgcc -static-libstdc++"
CACHE STRING "Compile options specified by the toolchain file")
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/FrameworkExtensions)
set(Matlab_INCLUDE_DIRS
/usr/x86_64-w64-mingw32/matlab/include
CACHE STRING "Path to matlab header files")
file(GLOB LIBRARIES /usr/x86_64-w64-mingw32/matlab/lib/*.lib)
set(Matlab_LIBRARIES
${LIBRARIES}
CACHE STRING "Path to matlab library files")
# adjust the default behaviour of the FIND_XXX() commands: search headers and
# libraries in the target environment, search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
--- gcc.jam.old 2022-04-06 14:06:18.807536645 +0200
+++ gcc.jam.new 2022-04-06 14:26:20.709209341 +0200
@@ -93,6 +93,7 @@
import cygwin ;
import feature ;
import fortran ;
+import mc ;
import generators ;
import os ;
import pch ;
--- mc.jam.old 2021-10-01 09:58:27.815410417 +0200
+++ mc.jam.new 2021-09-29 17:04:08.025418898 +0200
@@ -17,6 +17,9 @@
import type ;
import rc ;
+feature.feature mc-compiler : mc windmc : propagated ;
+feature.set-default mc-compiler : mc ;
+
rule init ( )
{
}
@@ -36,9 +39,15 @@
flags mc.compile MCFLAGS <mc-set-customer-bit>no : ;
flags mc.compile MCFLAGS <mc-set-customer-bit>yes : -c ;
-generators.register-standard mc.compile : MC : H RC ;
+generators.register-standard mc.compile.mc : MC : H RC : <mc-compiler>mc ;
+generators.register-standard mc.compile.windmc : MC : H RC : <mc-compiler>windmc ;
-actions compile
+actions compile.mc
{
mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"
}
+
+actions compile.windmc
+{
+ windmc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"
+}
#!/bin/bash
# Taken from the fenics project
# User can pass e.g. --env HOST_UID=1003 so that UID in the container matches
# with the UID on the host. This is useful for Linux users, Mac and Windows
# already do transparent mapping of shared volumes.
if [ "$HOST_UID" ]; then
usermod -u $HOST_UID isea
fi
if [ "$HOST_GID" ]; then
groupmod -g $HOST_GID isea
fi
# This makes sure that all files in /home/isea are accessible by the user
# isea. We exclude the folder ~/shared to reduce IO out to the host. Docker
# for Mac, Docker for Windows and the UID/GID trick above should mean that file
# permissions work seamlessly now.
find /home/isea -maxdepth 1 | sed "1d" | grep -v "/home/isea/shared" | xargs chown -R isea:isea 2> /dev/null || true
......@@ -1486,7 +1486,7 @@ FORMULA_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
USE_MATHJAX = YES
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
......@@ -1509,7 +1509,7 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_RELPATH =
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
......
......@@ -1480,7 +1480,7 @@ FORMULA_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
USE_MATHJAX = YES
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
......@@ -1503,7 +1503,7 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_RELPATH =
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
......
......@@ -134,6 +134,8 @@ FormulaCapacity | string | | Formula us
FormulaResistance | string | | Formula used to calculate the value of alpha. The symbols V, T and SOC can be used for the cell's voltage, temperature and SOC
MinAlphaCapacity | double | | Minimum value for the stress factor. If a lower value is calculated, this value is used instead.
MinAlphaResistance | double | | Minimum value for the stress factor. If a lower value is calculated, this value is used instead.
MaxAlphaCapacity | double | | Maximum value for the stress factor. If a higher value is calculated, this value is used instead.
MaxAlphaResistance | double | | Maximum value for the stress factor. If a higher value is calculated, this value is used instead.
InitialCapacityFactor | double | 0 - 1 | Initial value for the capacity factor. Optional, default = 1.
InitialResistanceFactor | double | 0 - 1 | Initial value for the capacity factor. Optional, default = 1.
......@@ -150,6 +152,8 @@ FormulaCapacity | string | | Formula us
FormulaResistance | string | | Formula used to calculate the value of beta. The symbols meanV, deltaDOD, meanSOC and meanI can be used for the cell's average voltage, depth of discharge, average SOC and average current
MinBetaCapacity | double | | Minimum value for the stress factor. If a lower value is calculated, this value is used instead.
MinBetaResistance | double | | Minimum value for the stress factor. If a lower value is calculated, this value is used instead.
MaxBetaCapacity | double | | Maximum value for the stress factor. If a higher value is calculated, this value is used instead.
MaxBetaResistance | double | | Maximum value for the stress factor. If a higher value is calculated, this value is used instead.
InitialCapacityFactor | double | 0 - 1 | Initial value for the capacity factor. Optional, default = 1.
InitialResistanceFactor | double | 0 - 1 | Initial value for the capacity factor. Optional, default = 1.
......
......@@ -12,6 +12,8 @@ SocStopCriterion | % | 5.0 | Maximum va
ThermalStopCriterionInDegreeC | °C | 5.0 | Maximum temperature change in any thermal state during a thermal simulation step before the electrcal simulation is reset.
Cycles | int > 0 | 1 | Gives the number of times the current/power profile is executed by the [thermal-electrical standalone](xmlexecutable.html)
SampleRate | Hz | 1.0e6 | Sample rate for the automatic simplification of fast time constants, see [automatic simplification](xmlvereinfachung.html)
MaximalOperationalCellVoltageV | V | no limit | Maximum voltage of the simulated cells. If any cell voltage goes above this limit, values from the current profile are skipped until a negative value / discharge is found.
MinimalOperationalCellVoltageV | V | no limit | Minimum voltage of the simulated cells. If any cell voltage goes below this limit, values from the current profile are skipped until a positive value / charge is found.
Thermal model
===============
......
......@@ -6,12 +6,13 @@
namespace aging
{
CalendarianAging::CalendarianAging( const double agingStepTime, const double minAlphaCapacity, const double minAlphaResistance,
const double maxAlphaCapacity, const double maxAlphaResistance,
const boost::shared_ptr< object::Object< double > >& alphaCapacity,
const boost::shared_ptr< object::Object< double > >& alphaResistance,
const double initialCapacityFactor, const double initialResistanceFactor,
const bool isEnabled, const double timeExponent )
: EmpiricalAging( agingStepTime, minAlphaCapacity, minAlphaResistance, alphaCapacity, alphaResistance,
initialCapacityFactor, initialResistanceFactor, isEnabled )
: EmpiricalAging( agingStepTime, minAlphaCapacity, minAlphaResistance, maxAlphaCapacity, maxAlphaResistance,
alphaCapacity, alphaResistance, initialCapacityFactor, initialResistanceFactor, isEnabled )
, mTimeExponent( timeExponent )
, mActualVoltage( 0.0 )
, mActualTemperature( 0.0 )
......@@ -39,10 +40,8 @@ void CalendarianAging::CalculateAging( const TwoportState& twoportState, double
dt = mTimeValues[i] - previousTime;
alphaCap = this->mCapacityStressFactor->GetValue();
alphaRes = this->mResistanceStressFactor->GetValue();
if ( alphaCap < this->mMinStressFactorCapacity )
alphaCap = this->mMinStressFactorCapacity;
if ( alphaRes < this->mMinStressFactorResistance )
alphaRes = this->mMinStressFactorResistance;
alphaCap = clamp( alphaCap, this->mMinStressFactorCapacity, this->mMaxStressFactorCapacity );
alphaRes = clamp( alphaRes, this->mMinStressFactorResistance, this->mMaxStressFactorResistance );
alphaCapSum += alphaCap * dt;
alphaResSum += alphaRes * dt;
previousTime = mTimeValues[i];
......
......@@ -29,6 +29,7 @@ class CalendarianAging : public EmpiricalAging
public:
/// Constructor
CalendarianAging( const double agingStepTime, const double minAlphaCapacity, const double minAlphaResistance,
const double maxAlphaCapacity, const double maxAlphaResistance,
const boost::shared_ptr< object::Object< double > >& alphaCapacity,
const boost::shared_ptr< object::Object< double > >& alphaResistance, const double initialCapacityFactor,
const double initialResistanceFactor, const bool isEnabled, const double timeExponent );
......
......@@ -6,12 +6,13 @@
namespace aging
{
CyclicalAging::CyclicalAging( const double agingStepTime, const double minBetaCapacity, const double minBetaResistance,
const double maxBetaCapacity, const double maxBetaResistance,
const boost::shared_ptr< object::Object< double > >& alphaCapacity,
const boost::shared_ptr< object::Object< double > >& alphaResistance,
const double initialCapacityFactor, const double initialResistanceFactor, const bool isEnabled,
const double chargeThroughputExponentCapacity, const double chargeThroughputExponentResistance )
: EmpiricalAging( agingStepTime, minBetaCapacity, minBetaResistance, alphaCapacity, alphaResistance,
initialCapacityFactor, initialResistanceFactor, isEnabled )
: EmpiricalAging( agingStepTime, minBetaCapacity, minBetaResistance, maxBetaCapacity, maxBetaResistance,
alphaCapacity, alphaResistance, initialCapacityFactor, initialResistanceFactor, isEnabled )
, mChargeThroughputExponentCapacity( chargeThroughputExponentCapacity )
, mChargeThroughputExponentResistance( chargeThroughputExponentResistance )
, mActualDod( 0.0 )
......@@ -50,6 +51,8 @@ void CyclicalAging::CalculateAging( const TwoportState& twoportState, double tim
mActualVoltage = GetAverageVoltage( cycleStart, cycleEnd );
double betaCapacity = this->mCapacityStressFactor->GetValue();
double betaResistance = this->mResistanceStressFactor->GetValue();
betaCapacity = clamp( betaCapacity, this->mMinStressFactorCapacity, this->mMaxStressFactorCapacity );
betaResistance = clamp( betaResistance, this->mMinStressFactorResistance, this->mMaxStressFactorResistance );
if ( betaCapacity < this->mMinStressFactorCapacity )
betaCapacity = this->mMinStressFactorCapacity;
if ( betaResistance < this->mMinStressFactorResistance )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment