Commit 65d20312 authored by Philipp Fensch's avatar Philipp Fensch
Browse files

Merge branch 'master' of git.rwth-aachen.de:acs/public/simulation/dpsim-group/dpsim into cuda

Conflicts:
	CMakeLists.txt
	Dependencies/libcps/CMakeLists.txt
parents 5f317866 d97cbe70
build*
Dependencies/libcps/build*
models/build*
Packaging/
......@@ -18,5 +18,6 @@ indent_size = 4
indent_style = spaces
indent_size = 4
[Dockerfile]
[{CMakeLists.txt,Dockerfile}]
indent_style = tab
indent_size = 2
\ No newline at end of file
......@@ -47,6 +47,3 @@ __pycache__/
.eggs/
*.egg-info/
.ipynb_checkpoints/
# Auto-generated
Documentation/README.md
\ No newline at end of file
variables:
RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER}
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_TAG_DEV: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE: rwthacs/dpsim
DOCKER_IMAGE_DEV: rwthacs/dpsim-dev
......@@ -22,14 +21,14 @@ docker:
script:
- docker build
--file Packaging/Docker/Dockerfile.dev
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--tag ${DOCKER_IMAGE_DEV}:latest .
# build dedicated jupyter image in the future
- docker build
--file Packaging/Docker/Dockerfile.jupyter
--build-arg DOCKER_IMAGE=${DOCKER_IMAGE_DEV}
--build-arg DOCKER_TAG=${DOCKER_TAG_DEV}
--tag ${DOCKER_IMAGE_DEV}-jupyter:${DOCKER_TAG_DEV}
--build-arg DOCKER_TAG=${DOCKER_TAG}
--tag ${DOCKER_IMAGE_DEV}-jupyter:${DOCKER_TAG}
--tag ${DOCKER_IMAGE_DEV}-jupyter:latest .
tags:
- shell
......@@ -42,7 +41,7 @@ build:linux:
- cd build
- cmake ..
- make -j 32
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
cache:
paths:
- build
......@@ -76,7 +75,7 @@ build:windows:
# - cd build
# - cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9
# -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
# -DWITH_CIM_SUBMODULE=ON
# -DWITH_CIM_SUBMODULE=ON
# -DWITH_SUNDIALS=OFF ..
# - make -j $(sysctl -n hw.ncpu)
# cache:
......@@ -102,7 +101,7 @@ build:windows:
# - pytest -v Examples/Python/Circuits
# - pytest -v Examples/Python/RealTime
# #- pytest -v Examples/Python/Shmem
# image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
# image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
# dependencies:
# - build:linux
# tags:
......@@ -113,13 +112,13 @@ generate:docs:
script:
- make -j$(nproc) -C build docs
- make -j$(nproc) -C build docs_cxx
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
dependencies:
- build:linux
artifacts:
paths:
- build/Documentation/html
- build/Documentation/Cxx/html
- build/docs/sphinx/html
- build/docs/doxygen/html
tags:
- docker
......@@ -131,7 +130,7 @@ generate:packages:
- tags
tags:
- docker
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
dependencies:
- build:linux
artifacts:
......@@ -142,7 +141,7 @@ generate:packages:
build:docker:
stage: build
script:
- docker build
- docker build
--file Packaging/Docker/Dockerfile
--build-arg DOCKER_TAG=${DOCKER_TAG}
--build-arg CI=1
......@@ -163,7 +162,7 @@ test:jupyter:
PYTHONPATH: "build/Source/Python:Source/Python"
script:
- pytest -v Examples/Notebooks
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
dependencies:
- build:linux
tags:
......@@ -177,15 +176,15 @@ test:jupyter:
pages:
stage: deploy
script:
- cp -r build/Documentation/html/. public
- cp -r build/Documentation/Cxx/html/. public/cxx
- cp -r build/docs/sphinx/html/. public/sphinx
- cp -r build/docs/doxygen/html/. public/doxygen
artifacts:
paths:
- public
dependencies:
- generate:docs
only:
- master
- deploy
tags:
- shell
- linux
......@@ -193,7 +192,7 @@ pages:
deploy:docker:
stage: deploy
script:
- docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
- docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE_DEV}:latest
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}:latest
......
[submodule "Examples/CIM/grid-data"]
path = Examples/CIM/grid-data
url = ../../grid-data/cim-grid-data.git
url = https://git.rwth-aachen.de/acs/public/grid-data/cim-grid-data.git
[submodule "Dependencies/eigen"]
path = Dependencies/eigen
url = https://github.com/eigenteam/eigen-git-mirror
url = https://github.com/eigenteam/eigen-git-mirror.git
[submodule "Dependencies/libcimpp"]
path = Dependencies/libcimpp
url = https://github.com/RWTH-ACS/libcimpp
url = https://github.com/cim-iec/libcimpp.git
[submodule "Dependencies/spdlog"]
path = Dependencies/spdlog
url = https://github.com/gabime/spdlog
url = https://github.com/gabime/spdlog.git
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)
project(DPsim CXX)
set(PROJECT_AUTHOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_COPYRIGHT "2017-2020, Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_DESCRIPTION "C++ Power System Simulation Library")
set(PROJECT_HOMEPAGE_URL "https://dpsim.fein-aachen.org/")
set(PROJECT_VCS_URL "https://git.rwth-aachen.org/acs/public/simulation/dpsim")
# Required for dpsim_python
cmake_policy(SET CMP0076 NEW)
# Allow setting Graphviz_ROOT for windows builds
cmake_policy(SET CMP0074 NEW)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(TOPLEVEL_PROJECT ON)
else()
......@@ -16,27 +27,24 @@ endif()
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
add_definitions(-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake;${PROJECT_SOURCE_DIR}/Dependencies/libcps/CMake")
if(NOT WIN32)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(PROJECT_AUTHOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_COPYRIGHT "2017-2020, Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_DESCRIPTION "C++ Power System Simulation Library")
set(PROJECT_HOMEPAGE_URL "http://www.fein-aachen.org/projects/dpsim/")
set(PROJECT_VCS_URL "https://git.rwth-aachen.org/acs/public/simulation/dpsim")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake;${PROJECT_SOURCE_DIR}/models/CMake")
include(CheckCXXCompilerFlag)
if(MSVC)
if(MSVC)
# Set exception handling for portability
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
# TODO activate this again after fixing warnings
# set(DPSIM_CXX_FLAGS /W4 /WX)
endif()
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(DPSIM_CXX_FLAGS -Wall -Werror)
endif()
......@@ -52,28 +60,32 @@ include(GetVersion)
GetVersion(${PROJECT_SOURCE_DIR} "DPSIM")
find_package(Eigen3 3.0 REQUIRED)
# Workaround for spdlog in Windows
# A custom FindSpdlog does not work currently
option(SPDLOG_BUILD_TESTING "Build spdlog tests" OFF)
option(SPDLOG_BUILD_BENCH "Build spdlog benchmarks" OFF)
option(SPDLOG_BUILD_EXAMPLES "Build spdlog examples" OFF)
# Workaround for spdlog in Windows
# A custom FindSpdlog does not work currently
option(WITH_SPDLOG_SUBMODULE "Build with Spdlog as submodule" ON)
if (WITH_SPDLOG_SUBMODULE OR WIN32)
option(WITH_SPDLOG_SUBMODULE "Build with Spdlog as submodule" OFF)
if (WITH_SPDLOG_SUBMODULE OR WIN32)
set(SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/spdlog/include)
else()
find_package(spdlog REQUIRED)
endif()
find_package(CIMpp)
add_subdirectory(Dependencies/libcps)
find_package(PythonInterp 3.6)
find_package(PythonLibs 3.6)
find_package(Threads REQUIRED)
find_package(CIMpp)
find_package(Sundials)
find_package(OpenMP)
find_package(CUDA)
find_package(GSL)
find_package(Graphviz)
find_package(PythonInterp 3.6)
find_package(PythonLibs 3.6)
find_package(NumPy)
find_package(VILLASnode)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
......@@ -82,20 +94,20 @@ endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(Linux_FOUND ON)
elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
set(MacOS_FOUND ON)
endif()
# Options
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
option(BUILD_EXAMPLES "Build C++ examples" ON )
option(COMPARE_REFERENCE "Download reference results and compare" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_SHMEM "Enable shared memory interface" ON "VILLASnode_FOUND" OFF)
cmake_dependent_option(WITH_RT "Enable real-time features" ON "Linux_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" OFF "Python_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Enable OpenMP-based parallelisation" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_CUDA "Enable CUDA-based parallelisation" ON "CUDA_FOUND" OFF)
......@@ -103,51 +115,44 @@ cmake_dependent_option(WITH_CUDA "Enable CUDA-based parallelisation" ON "CUDA
if(WITH_CUDA)
enable_language(CUDA)
endif()
option(BUILD_SHARED_LIBS "Build shared library" OFF)
option(BUILD_EXAMPLES "Build C++ examples" ON)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/dpsim/Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/Include/dpsim/Config.h
)
set(INCLUDE_DIRS
set(DPSIM_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/Include
${CMAKE_CURRENT_SOURCE_DIR}/Include
)
add_subdirectory(models)
add_subdirectory(Tests)
add_subdirectory(Source)
add_subdirectory(Documentation)
add_subdirectory(docs)
#add_subdirectory(Dependencies/pybind11)
#pybind11_add_module(dpsimpy Source/pybind/main.cpp)
#target_link_libraries(dpsimpy PRIVATE dpsim)
if(BUILD_EXAMPLES)
add_subdirectory(Examples)
endif(BUILD_EXAMPLES)
if(COMPARE_REFERENCE)
include(ExternalProject)
ExternalProject_Add(reference-results
GIT_REPOSITORY https://git.rwth-aachen.de/acs/public/simulation/reference-results.git
#GIT_TAG origin/master
PREFIX reference-results
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endif()
message("Compiler Release Flags:")
message(${CMAKE_CXX_FLAGS_RELEASE})
message("Compiler Debug Flags:")
message(${CMAKE_CXX_FLAGS_DEBUG})
message(VERBOSE "Compiler Release Flags: " ${CMAKE_CXX_FLAGS_RELEASE})
message(VERBOSE "Compiler Debug Flags: " ${CMAKE_CXX_FLAGS_DEBUG})
if(TOPLEVEL_PROJECT)
# Show feature summary
include(FeatureSummary)
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Shmem WITH_SHMEM "Interface DPsim solvers via shared-memory interfaces")
add_feature_info(RT WITH_RT "Extended real-time features")
add_feature_info(GSL WITH_GSL "Use GNU Scientific library")
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Shmem WITH_SHMEM "Interface DPsim solvers via shared-memory interfaces")
add_feature_info(RT WITH_RT "Extended real-time features")
add_feature_info(GSL WITH_GSL "Use GNU Scientific library")
add_feature_info(Graphviz WITH_GRAPHVIZ "Graphviz Graphs")
add_feature_info(Sundials WITH_SUNDIALS "Sundials solvers")
feature_summary(WHAT ALL VAR enabledFeaturesText)
if (FOUND_GIT_VERSION)
......
cmake_minimum_required(VERSION 3.6)
project(CPowerSystems CXX)
if(${CMAKE_VERSION} VERSION_GREATER "3.12.0")
# Allow setting Graphviz_ROOT for windows builds
cmake_policy(SET CMP0074 NEW)
endif()
# Enable C++11 support
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include(CheckCXXCompilerFlag)
if(MSVC)
check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
# TODO activate this again after fixing warnings
# set(CPS_CXX_FLAGS /W4 /WX)
endif()
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(CPS_CXX_FLAGS -Wall -Werror)
endif()
endif()
set(Python_ADDITIONAL_VERSIONS 3.5 3.6 3.7)
find_package(Threads REQUIRED)
find_package(PythonInterp 3.5)
find_package(PythonLibs 3.5)
find_package(Graphviz)
find_package(Sundials)
find_package(GSL)
find_package(NumPy)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
set(Python_FOUND ON)
endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(Linux_FOUND ON)
elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
set(MacOS_FOUND ON)
endif()
include(CMakeDependentOption)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_NUMPY "Enable NumPy" ON "NumPy_FOUND;WITH_PYTHON" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable support for Graphviz Graphs" ON "Graphviz_FOUND" OFF)
# Show feature summary
include(FeatureSummary)
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Graphviz WITH_GRAPHVIZ "Graphviz Graphs")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Sundials WITH_SUNDIALS "Sundials solvers")
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
feature_summary(WHAT ALL VAR enabledFeaturesText)
message(STATUS "Feature summary for CPS")
message(STATUS "${enabledFeaturesText}")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/cps/Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/Include/cps/Config.h
)
set(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/Include
${CMAKE_CURRENT_BINARY_DIR}/Include
${EIGEN3_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
)
set(LIBRARIES
Threads::Threads
)
if(Linux_FOUND OR MacOS_FOUND)
# TODO This doesn't actually depend on which OS or compiler is used, but which
# stdlib. For now, under Linux only GNU's libstdc++ seems to work anyway.
# With LLVM's libc++, -lc++fs should probably be used
list(APPEND LIBRARIES stdc++fs)
endif()
add_subdirectory(Source)
add_subdirectory(Examples)
add_subdirectory(Tests)
This diff is collapsed.
*.synctex.gz
*.log
*.toc
*.aux
*.pdf
*.bbl
*.blg
*.dvi
*.out
%----------------------------------------------------------
% Packages and other configurations
%----------------------------------------------------------
\documentclass{report}
\usepackage{graphicx} % Needed to insert images into the document
\graphicspath{{img/}} % Sets the default location of pictures
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{xcolor}
\newcommand{\todo}[1]{\textcolor{red}{[TODO: #1]}}
\title{Documentation of the Dynamic Phasor Simulator - DPsim}
\author{Markus Mirz, Jan Dinkelbach, Viviane Sapucaia, Antonello Monti}
\begin{document}
\maketitle
\tableofcontents
%----------------------------------------------------------
% Content
%----------------------------------------------------------
\include{content/introduction}
\include{content/dynamic_phasors}
\include{content/nodal_analysis}
\include{content/powerflow}
\chapter{Models}
\include{content/branches}
\include{content/synchronous_machine}
\include{content/induction_machine}
\include{content/power_converters}
\include{content/appendix}
%----------------------------------------------------------
% Bibliography
%----------------------------------------------------------
\bibliographystyle{ieeetr}
\bibliography{bibliography}
%----------------------------------------------------------
% End
%----------------------------------------------------------
\end{document}
%----------------------------------------------------------
% Books
%----------------------------------------------------------
@book{kundur1994power,
title={Power system stability and control},
author={Kundur, Prabha and Balu, Neal J and Lauby, Mark G},
volume={7},
year={1994},
publisher={McGraw-hill New York}
}
@article{krause2002,
title={Analysis of Electric Machinery and Drive Systems},
author={Krause, Paul and Wasynczuk, Oleg and Sudhoff, Scott and Pekarek, Steven},
journal={IEEE Press},
year={2002}
}
@book{maas2003nonlinear,
title={Nonlinear microwave and RF circuits},
author={Maas, Stephen A},
year={2003},
publisher={Artech House}
}
@book{suarez2009analysis,
title={Analysis and design of autonomous microwave circuits},
author={Su{\'a}rez, Almudena},
volume={190},
year={2009},
publisher={John Wiley \& Sons}
}
@book{haykin2009communication,
title={Communication Systems, 5th Edition},
author={Haykin, Simon and Moher, Michael},
year={2009},
publisher={Wiley}
}
@book{proakis2001communication,
title={Communication Systems, 5th Edition},
author={Proakis, John and Salehi, Masoud},
year={2001},
publisher={Prentice Hall}
}
@book{schreier2010statistical,
title={Statistical signal processing of complex-valued data: the theory of improper and noncircular signals},
author={Schreier, Peter J and Scharf, Louis L},
year={2010},
publisher={Cambridge University Press}
}
%----------------------------------------------------------
% Papers
%----------------------------------------------------------
@article{wang2010methods,
title={Methods of interfacing rotating machine models in transient simulation programs},
author={Wang, L and Jatskevich, J and Dinavahi, V and Dommel, HW and Martinez, JA and Strunz, K and Rioual, M and Chang, GW and Iravani, R},
journal={IEEE Transactions on Power Delivery},
volume={25},
number={2},
pages={891--903},
year={2010},
publisher={IEEE}
}
@article{sanders1991generalized,
title={Generalized averaging method for power conversion circuits},
author={Sanders, Seth R and Noworolski, J Mark and Liu, Xiaojun Z and Verghese, George C},
journal={IEEE Transactions on Power Electronics},
volume={6},
number={2},
pages={251--259},
year={1991},
publisher={IEEE}
}
@article{venkatasubramanian1995fast,
title={Fast time-varying phasor analysis in the balanced three-phase large electric power system},
author={Venkatasubramanian, Vaithianathan and Schattler, Heinz and Zaborszky, John},
journal={IEEE Transactions on Automatic Control},
volume={40},
number={11},
pages={1975--1982},
year={1995},
publisher={IEEE}
}
@article{strunz2006frequency,
title={Frequency-adaptive network modeling for integrative simulation of natural and envelope waveforms in power systems and circuits},
author={Strunz, Kai and Shintaku, Rachel and Gao, Feng},
journal={IEEE Transactions on Circuits and Systems I: Regular Papers},
volume={53},
number={12},
pages={2788--2803},
year={2006},
publisher={IEEE}