Commit a102e4a5 authored by Markus Mirz's avatar Markus Mirz
Browse files

Merge branch 'development' of git.rwth-aachen.de:acs/core/simulation/dpsim into development

parents e20388d5 cc169128
Subproject commit 176f1bb9bc5082fd0ec157baf326455cd1b90b53
Subproject commit 8deeed0e600a64efe101351c1ae51a7b0e84eaa2
......@@ -93,17 +93,44 @@ CMake for Linux
The most recent list of requirements can be found in the Dockerfiles.
1. Make sure that the required dependencies are installed.
1. Make sure that the required dependencies are installed.
**Note:** There are currently no Debian packages for `villas-node` and `libcimpp16v29a`.
If you want to use these optional feature, you have to build them.
If you want to use these optional feature, you have to build them manually.
# Install Sundials
$ git clone --branch v3.1.1 https://github.com/LLNL/sundials.git
$ mkdir sundials/build
$ pushd sundials/build
$ cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DEXAMPLES_ENABLE_C=OFF
$ make -j$(nproc) install
$ popd
# Install CIM++
$ git clone --recursive https://github.com/RWTH-ACS/libcimpp.git
$ mkdir libcimpp/build
$ pushd libcimpp/build
$ cmake .. \
-DUSE_CIM_VERSION=IEC61970_16v29a \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
$ make -j$(nproc) install
2. Fetch sources::
$ git clone --recurse-submodules git@git.rwth-aachen.de:acs/core/simulation/dpsim.git
$ cd dpsim
$ git clone https://git.rwth-aachen.de/acs/public/simulation/dpsim.git
$ cd dpsim
$ git submodule update --init Dependencies/libcps
3. Compile::.
3. Building the libraries and the Python package works like in Docker.
$ mkdir build
$ cmake ..
$ make
4. To install the generated Python module to your system::
......
......@@ -140,16 +140,16 @@ namespace DPsim {
void open();
void close();
CPS::Attribute<Int>::Ptr importInt(Int idx);
CPS::Attribute<Real>::Ptr importReal(Int idx);
CPS::Attribute<Bool>::Ptr importBool(Int idx);
CPS::Attribute<Complex>::Ptr importComplex(Int idx);
CPS::Attribute<Complex>::Ptr importComplexMagPhase(Int idx);
void addExport(CPS::Attribute<Int>::Ptr attr, Int idx);
void addExport(CPS::Attribute<Real>::Ptr attr, Int idx);
void addExport(CPS::Attribute<Bool>::Ptr attr, Int idx);
void addExport(CPS::Attribute<Complex>::Ptr attr, Int idx);
CPS::Attribute<Int>::Ptr importInt(UInt idx);
CPS::Attribute<Real>::Ptr importReal(UInt idx);
CPS::Attribute<Bool>::Ptr importBool(UInt idx);
CPS::Attribute<Complex>::Ptr importComplex(UInt idx);
CPS::Attribute<Complex>::Ptr importComplexMagPhase(UInt idx);
void addExport(CPS::Attribute<Int>::Ptr attr, UInt idx);
void addExport(CPS::Attribute<Real>::Ptr attr, UInt idx);
void addExport(CPS::Attribute<Bool>::Ptr attr, UInt idx);
void addExport(CPS::Attribute<Complex>::Ptr attr, UInt idx);
/** Read data for a timestep from the interface and passes the values
* to all registered current / voltage sources.
......
......@@ -64,8 +64,7 @@ if(WITH_OPENMP)
list(APPEND LIBRARIES ${OpenMP_CXX_FLAGS})
endif()
add_library(dpsim)
target_sources(dpsim PRIVATE ${SOURCES})
add_library(dpsim ${SOURCES})
target_link_libraries(dpsim ${LIBRARIES})
target_include_directories(dpsim PUBLIC ${INCLUDE_DIRS})
target_compile_options(dpsim PUBLIC ${DPSIM_CXX_FLAGS})
......
......@@ -159,7 +159,7 @@ void Interface::PostStep::execute(Real time, Int timeStepCount) {
mIntf.writeValues();
}
Attribute<Int>::Ptr Interface::importInt(Int idx) {
Attribute<Int>::Ptr Interface::importInt(UInt idx) {
Attribute<Int>::Ptr attr = Attribute<Int>::make(Flags::read | Flags::write);
addImport([attr, idx](Sample *smp) {
if (idx >= smp->length)
......@@ -171,7 +171,7 @@ Attribute<Int>::Ptr Interface::importInt(Int idx) {
return attr;
}
Attribute<Real>::Ptr Interface::importReal(Int idx) {
Attribute<Real>::Ptr Interface::importReal(UInt idx) {
Attribute<Real>::Ptr attr = Attribute<Real>::make(Flags::read | Flags::write);
addImport([attr, idx](Sample *smp) {
if (idx >= smp->length)
......@@ -183,7 +183,7 @@ Attribute<Real>::Ptr Interface::importReal(Int idx) {
return attr;
}
Attribute<Bool>::Ptr Interface::importBool(Int idx) {
Attribute<Bool>::Ptr Interface::importBool(UInt idx) {
Attribute<Bool>::Ptr attr = Attribute<Bool>::make(Flags::read | Flags::write);
addImport([attr, idx](Sample *smp) {
if (idx >= smp->length)
......@@ -195,7 +195,7 @@ Attribute<Bool>::Ptr Interface::importBool(Int idx) {
return attr;
}
Attribute<Complex>::Ptr Interface::importComplex(Int idx) {
Attribute<Complex>::Ptr Interface::importComplex(UInt idx) {
Attribute<Complex>::Ptr attr = Attribute<Complex>::make(Flags::read | Flags::write);
addImport([attr, idx](Sample *smp) {
if (idx >= smp->length)
......@@ -210,7 +210,7 @@ Attribute<Complex>::Ptr Interface::importComplex(Int idx) {
return attr;
}
Attribute<Complex>::Ptr Interface::importComplexMagPhase(Int idx) {
Attribute<Complex>::Ptr Interface::importComplexMagPhase(UInt idx) {
Attribute<Complex>::Ptr attr = Attribute<Complex>::make(Flags::read | Flags::write);
addImport([attr, idx](Sample *smp) {
if (idx >= smp->length)
......@@ -225,7 +225,7 @@ Attribute<Complex>::Ptr Interface::importComplexMagPhase(Int idx) {
return attr;
}
void Interface::addExport(Attribute<Int>::Ptr attr, Int idx) {
void Interface::addExport(Attribute<Int>::Ptr attr, UInt idx) {
addExport([attr, idx](Sample *smp) {
if (idx >= smp->capacity)
throw std::out_of_range("not enough space in allocated sample");
......@@ -236,7 +236,7 @@ void Interface::addExport(Attribute<Int>::Ptr attr, Int idx) {
});
}
void Interface::addExport(Attribute<Real>::Ptr attr, Int idx) {
void Interface::addExport(Attribute<Real>::Ptr attr, UInt idx) {
addExport([attr, idx](Sample *smp) {
if (idx >= smp->capacity)
throw std::out_of_range("not enough space in allocated sample");
......@@ -247,7 +247,7 @@ void Interface::addExport(Attribute<Real>::Ptr attr, Int idx) {
});
}
void Interface::addExport(Attribute<Bool>::Ptr attr, Int idx) {
void Interface::addExport(Attribute<Bool>::Ptr attr, UInt idx) {
addExport([attr, idx](Sample *smp) {
if (idx >= smp->capacity)
throw std::out_of_range("not enough space in allocated sample");
......@@ -258,7 +258,7 @@ void Interface::addExport(Attribute<Bool>::Ptr attr, Int idx) {
});
}
void Interface::addExport(Attribute<Complex>::Ptr attr, Int idx) {
void Interface::addExport(Attribute<Complex>::Ptr attr, UInt idx) {
addExport([attr, idx](Sample *smp) {
if (idx >= smp->capacity)
throw std::out_of_range("not enough space in allocated sample");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment