Commit 2252c20c authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

change includes and include paths for new location of CPS submodule

parent 153bcb29
......@@ -4,6 +4,7 @@ set(INCLUDE_DIRS
${EIGEN3_INCLUDE_DIR}
"${CMAKE_CURRENT_BINARY_DIR}/../../Source"
"${CMAKE_CURRENT_SOURCE_DIR}/../../Source"
"${CMAKE_CURRENT_SOURCE_DIR}/../../Dependencies"
)
if (NOT WIN32)
......
......@@ -5,45 +5,45 @@ add_library(dpsim
MNA_Simulation.cpp
FaultSimulation.cpp
SynGenSimulation.cpp
CPowerSystems/Source/Logger.cpp
CPowerSystems/Source/MathUtils.cpp
CPowerSystems/Source/Attribute.cpp
CPowerSystems/Source/Component.cpp
../Dependencies/cps/Source/Logger.cpp
../Dependencies/cps/Source/MathUtils.cpp
../Dependencies/cps/Source/Attribute.cpp
../Dependencies/cps/Source/Component.cpp
)
list(APPEND SOURCES
CPowerSystems/Source/Components/DP_Capacitor.cpp
CPowerSystems/Source/Components/DP_CurrentSource.cpp
CPowerSystems/Source/Components/DP_Inductor.cpp
CPowerSystems/Source/Components/DP_Line_Pi.cpp
CPowerSystems/Source/Components/DP_Line_Rx.cpp
CPowerSystems/Source/Components/DP_Load_PQ.cpp
CPowerSystems/Source/Components/DP_Resistor.cpp
CPowerSystems/Source/Components/DP_Transformer.cpp
CPowerSystems/Source/Components/DP_VoltageSource.cpp
CPowerSystems/Source/Components/DP_VoltageSource_Freq.cpp
CPowerSystems/Source/Components/DP_VoltageSource_Norton.cpp
CPowerSystems/Source/Components/EMT_Capacitor.cpp
CPowerSystems/Source/Components/EMT_CurrentSource.cpp
CPowerSystems/Source/Components/EMT_Inductor.cpp
CPowerSystems/Source/Components/EMT_Resistor.cpp
CPowerSystems/Source/Components/EMT_VoltageSource.cpp
CPowerSystems/Source/Components/EMT_VoltageSource_Freq.cpp
CPowerSystems/Source/Components/EMT_VoltageSource_Norton.cpp
CPowerSystems/Source/Components/Exciter.cpp
CPowerSystems/Source/Components/TurbineGovernor.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_Ideal.cpp
CPowerSystems/Source/Components/Base_SynchronGenerator.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_Classic_Simplified.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_Classic.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_VBR.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_VBR_UnitTest.cpp
CPowerSystems/Source/Components/DP_SynchronGenerator_VBR_Simplified.cpp
CPowerSystems/Source/Components/EMT_SynchronGenerator_Classic.cpp
CPowerSystems/Source/Components/EMT_SynchronGenerator_Classic_Simplified.cpp
CPowerSystems/Source/Components/EMT_SynchronGenerator_Classic_Simpl_CurrentComp.cpp
CPowerSystems/Source/Components/EMT_SynchronGenerator_VBR.cpp
CPowerSystems/Source/Components/EMT_SynchronGenerator_VBR_UnitTest.cpp
../Dependencies/cps/Source/Components/DP_Capacitor.cpp
../Dependencies/cps/Source/Components/DP_CurrentSource.cpp
../Dependencies/cps/Source/Components/DP_Inductor.cpp
../Dependencies/cps/Source/Components/DP_Line_Pi.cpp
../Dependencies/cps/Source/Components/DP_Line_Rx.cpp
../Dependencies/cps/Source/Components/DP_Load_PQ.cpp
../Dependencies/cps/Source/Components/DP_Resistor.cpp
../Dependencies/cps/Source/Components/DP_Transformer.cpp
../Dependencies/cps/Source/Components/DP_VoltageSource.cpp
../Dependencies/cps/Source/Components/DP_VoltageSource_Freq.cpp
../Dependencies/cps/Source/Components/DP_VoltageSource_Norton.cpp
../Dependencies/cps/Source/Components/EMT_Capacitor.cpp
../Dependencies/cps/Source/Components/EMT_CurrentSource.cpp
../Dependencies/cps/Source/Components/EMT_Inductor.cpp
../Dependencies/cps/Source/Components/EMT_Resistor.cpp
../Dependencies/cps/Source/Components/EMT_VoltageSource.cpp
../Dependencies/cps/Source/Components/EMT_VoltageSource_Freq.cpp
../Dependencies/cps/Source/Components/EMT_VoltageSource_Norton.cpp
../Dependencies/cps/Source/Components/Exciter.cpp
../Dependencies/cps/Source/Components/TurbineGovernor.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_Ideal.cpp
../Dependencies/cps/Source/Components/Base_SynchronGenerator.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_Classic_Simplified.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_Classic.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_VBR.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_VBR_UnitTest.cpp
../Dependencies/cps/Source/Components/DP_SynchronGenerator_VBR_Simplified.cpp
../Dependencies/cps/Source/Components/EMT_SynchronGenerator_Classic.cpp
../Dependencies/cps/Source/Components/EMT_SynchronGenerator_Classic_Simplified.cpp
../Dependencies/cps/Source/Components/EMT_SynchronGenerator_Classic_Simpl_CurrentComp.cpp
../Dependencies/cps/Source/Components/EMT_SynchronGenerator_VBR.cpp
../Dependencies/cps/Source/Components/EMT_SynchronGenerator_VBR_UnitTest.cpp
)
set(INCLUDE_DIRS
......@@ -70,8 +70,8 @@ if(WITH_SHMEM)
list(APPEND INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS})
list(APPEND SOURCES
CPowerSystems/Source/Interfaces/ExternalInterface.cpp
CPowerSystems/Source/Interfaces/ShmemInterface.cpp
../Dependencies/cps/Source/Interfaces/ExternalInterface.cpp
../Dependencies/cps/Source/Interfaces/ShmemInterface.cpp
)
endif()
......@@ -83,11 +83,13 @@ if(WITH_PYTHON)
endif()
if(WITH_CIM)
list(APPEND SOURCES CPowerSystems/Source/CIM/Reader.cpp)
list(APPEND SOURCES ../Dependencies/cps/Source/CIM/Reader.cpp)
list(APPEND INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})
list(APPEND LIBRARIES ${CIMPP_LIBRARIES})
endif()
list(APPEND INCLUDE_DIRS ../Dependencies)
target_sources(dpsim PRIVATE ${SOURCES})
target_link_libraries(dpsim ${LIBRARIES})
target_include_directories(dpsim PRIVATE ${INCLUDE_DIRS})
......
#include "Simulation.h"
#include "CPowerSystems/Source/Components.h"
#include "CPowerSystems/Source/Logger.h"
#include "cps/Source/Components.h"
#include "cps/Source/Logger.h"
#include "RealTimeSimulation.h"
#ifdef WITH_SHMEM
#include "CPowerSystems/Source/Interfaces/ShmemInterface.h"
#include "cps/Source/Interfaces/ShmemInterface.h"
#endif
\ No newline at end of file
......@@ -22,7 +22,7 @@
#include "MNA_Simulation.h"
#ifdef WITH_CIM
#include "CPowerSystems/Source/CIM/Reader.h"
#include "cps/Source/CIM/Reader.h"
#endif /* WITH_CIM */
using namespace DPsim;
......
......@@ -25,11 +25,11 @@
#include <vector>
#include <list>
#include "CPowerSystems/Source/Definitions.h"
#include "CPowerSystems/Source/Component.h"
#include "CPowerSystems/Source/Logger.h"
#include "CPowerSystems/Source/Interfaces/ExternalInterface.h"
#include "CPowerSystems/Source/Node.h"
#include "cps/Source/Definitions.h"
#include "cps/Source/Component.h"
#include "cps/Source/Logger.h"
#include "cps/Source/Interfaces/ExternalInterface.h"
#include "cps/Source/Node.h"
namespace DPsim {
/// Ground node
......
......@@ -30,6 +30,7 @@ endif()
list(APPEND INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../../Dependencies
${CMAKE_CURRENT_BINARY_DIR}/..
)
......
......@@ -20,7 +20,7 @@
*********************************************************************************/
#include "Python/Component.h"
#include "CPowerSystems/Source/Components.h"
#include "cps/Source/Components.h"
using namespace DPsim;
......
......@@ -33,7 +33,7 @@
#include <vector>
#include <memory>
#include "CPowerSystems/Source/Component.h"
#include "cps/Source/Component.h"
namespace DPsim {
namespace Python {
......
......@@ -22,7 +22,7 @@
#pragma once
#include "Python/Component.h"
#include "CPowerSystems/Source/Components/DP_Line_Rx.h"
#include "cps/Source/Components/DP_Line_Rx.h"
namespace DPsim {
namespace Python {
......
......@@ -25,7 +25,7 @@
#include "Python/Interface.h"
#ifdef WITH_SHMEM
#include "CPowerSystems/Source/Interfaces/ShmemInterface.h"
#include "cps/Source/Interfaces/ShmemInterface.h"
#endif
using namespace DPsim;
......
......@@ -30,7 +30,7 @@
#include <Python.h>
#endif
#include "CPowerSystems/Source/Interfaces/ExternalInterface.h"
#include "cps/Source/Interfaces/ExternalInterface.h"
namespace DPsim {
namespace Python {
......
......@@ -23,10 +23,10 @@
#include "Python/LoadCim.h"
#include "Python/Component.h"
#include "CPowerSystems/Source/Components.h"
#include "cps/Source/Components.h"
#ifdef WITH_CIM
#include "CPowerSystems/Source/CIM/Reader.h"
#include "cps/Source/CIM/Reader.h"
#endif
using namespace DPsim;
......
......@@ -28,7 +28,7 @@
#endif
#include "Config.h"
#include "CPowerSystems/Source/Components.h"
#include "cps/Source/Components.h"
#include "Python/Component.h"
#include "Python/LoadCim.h"
......
......@@ -38,7 +38,7 @@
#include "Config.h"
#include "../Simulation.h"
#include "CPowerSystems/Source/Component.h"
#include "cps/Source/Component.h"
namespace DPsim {
......
......@@ -22,7 +22,7 @@
#include "Simulation.h"
#ifdef WITH_CIM
#include "CPowerSystems/Source/CIM/Reader.h"
#include "cps/Source/CIM/Reader.h"
#endif /* WITH_CIM */
using namespace DPsim;
......@@ -62,19 +62,8 @@ Simulation::Simulation(String name, Component::List comps, Real om, Real dt,
Simulation::Simulation(String name,
std::list<String> cimFiles,
Real frequency, Real timeStep, Real finalTime,
Logger::Level logLevel, SimulationType simType) :
mLog("Logs/" + name + ".log", logLevel),
mLeftVectorLog("Logs/" + name + "_LeftVector.csv", logLevel),
mRightVectorLog("Logs/" + name + "_RightVector.csv", logLevel) {
mGnd = std::make_shared<Node>(-1);
mName = name;
mLogLevel = logLevel;
mSystemModel.setSimType(simType);
mSystemModel.setTimeStep(timeStep);
mSystemModel.setOmega(2*PI*frequency);
mFinalTime = finalTime;
Logger::Level logLevel, SimulationType simType)
{
CIM::Reader reader(frequency, logLevel, logLevel);
for (String filename : cimFiles) {
......@@ -90,17 +79,8 @@ Simulation::Simulation(String name,
}
mNodes = reader.getNodes();
Component::List comps = reader.getComponents();
initialize(comps);
for (auto comp : comps) {
mLog.Log(Logger::Level::INFO) << "Added " << comp->getType() << " '" << comp->getName() << "' to simulation." << std::endl;
}
mLog.Log(Logger::Level::INFO) << "System matrix:" << std::endl;
mLog.LogMatrix(Logger::Level::INFO, mSystemModel.getCurrentSystemMatrix());
mLog.Log(Logger::Level::INFO) << "LU decomposition:" << std::endl;
mLog.LogMatrix(Logger::Level::INFO, mSystemModel.getLUdecomp());
mLog.Log(Logger::Level::INFO) << "Right side vector:" << std::endl;
mLog.LogMatrix(Logger::Level::INFO, mSystemModel.getRightSideVector());
Simulation(name, comps, frequency, timeStep, finalTime, logLevel, simType)
}
#endif /* WITH_CIM */
......
......@@ -25,12 +25,12 @@
#include <vector>
#include <list>
#include "CPowerSystems/Source/Definitions.h"
#include "CPowerSystems/Source/Component.h"
#include "CPowerSystems/Source/Logger.h"
#include "cps/Source/Definitions.h"
#include "cps/Source/Component.h"
#include "cps/Source/Logger.h"
#include "SystemModel.h"
#include "CPowerSystems/Source/Interfaces/ExternalInterface.h"
#include "CPowerSystems/Source/Node.h"
#include "cps/Source/Interfaces/ExternalInterface.h"
#include "cps/Source/Node.h"
namespace DPsim {
......
......@@ -25,9 +25,9 @@
#include <iostream>
#include <vector>
#include "CPowerSystems/Source/Definitions.h"
#include "CPowerSystems/Source/MathUtils.h"
#include "CPowerSystems/Source/Logger.h"
#include "cps/Source/Definitions.h"
#include "cps/Source/MathUtils.h"
#include "cps/Source/Logger.h"
namespace DPsim {
......
......@@ -22,7 +22,7 @@
#pragma once
#include "CPowerSystems/Source/Definitions.h"
#include "cps/Source/Definitions.h"
namespace DPsim {
......
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