Commit 097c8817 authored by Markus Mirz's avatar Markus Mirz
Browse files

remove Component from core classes

parent 374eee9a
/**
* @file
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
......@@ -83,7 +81,7 @@ namespace CIM {
/// Model from CIM++
CIMModel *mModel;
/// All components after mapping
Component::List mComponents;
IdentifiedObject::List mComponents;
/// System frequency (has to be given to convert between reactances
/// in CIM and inductances used inside the simulation)
Real mFrequency;
......@@ -99,7 +97,7 @@ namespace CIM {
/// as given in the component constructors (0 for the first node, -1 or GND for ground).
std::map<String, TopologicalNode::Ptr> mPowerflowNodes;
/// Maps the RID of a ConductingEquipment to a PowerflowEquipment
std::map<String, Component::Ptr> mPowerflowEquipment;
std::map<String, TopologicalComponent::Ptr> mPowerflowEquipment;
/// Maps the RID of a Terminal to a PowerflowTerminal
std::map<String, TopologicalTerminal::Ptr> mPowerflowTerminals;
///
......@@ -131,28 +129,28 @@ namespace CIM {
/// Returns simulation node index which belongs to mRID.
Matrix::Index mapTopologicalNode(String mrid);
/// Maps CIM components to CPowerSystem components.
Component::Ptr mapComponent(BaseClass* obj);
TopologicalComponent::Ptr mapComponent(BaseClass* obj);
/// Returns an RX-Line.
/// The voltage should be given in kV and the angle in degree.
/// TODO: Introduce different models such as PI and wave model.
Component::Ptr mapACLineSegment(IEC61970::Base::Wires::ACLineSegment* line);
TopologicalComponent::Ptr mapACLineSegment(IEC61970::Base::Wires::ACLineSegment* line);
/// Returns a transformer, either ideal or with RL elements to model losses.
Component::Ptr mapPowerTransformer(IEC61970::Base::Wires::PowerTransformer *trans);
TopologicalComponent::Ptr mapPowerTransformer(IEC61970::Base::Wires::PowerTransformer *trans);
/// Returns an IdealVoltageSource with voltage setting according to load flow data
/// at machine terminals. The voltage should be given in kV and the angle in degree.
/// TODO: Introduce real synchronous generator models here.
Component::Ptr mapSynchronousMachine(IEC61970::Base::Wires::SynchronousMachine* machine);
TopologicalComponent::Ptr mapSynchronousMachine(IEC61970::Base::Wires::SynchronousMachine* machine);
/// Returns an PQload with voltage setting according to load flow data.
/// Currently the only option is to create an RL-load.
/// The voltage should be given in kV and the angle in degree.
/// TODO: Introduce real PQload model here.
Component::Ptr mapEnergyConsumer(IEC61970::Base::Wires::EnergyConsumer* consumer);
TopologicalComponent::Ptr mapEnergyConsumer(IEC61970::Base::Wires::EnergyConsumer* consumer);
/// Adds CIM files to list of files to be parsed.
/// Returns an external grid injection.
Component::Ptr mapExternalNetworkInjection(IEC61970::Base::Wires::ExternalNetworkInjection* extnet);
TopologicalComponent::Ptr mapExternalNetworkInjection(IEC61970::Base::Wires::ExternalNetworkInjection* extnet);
/// Returns a shunt
Component::Ptr mapEquivalentShunt(IEC61970::Base::Equivalents::EquivalentShunt *shunt);
TopologicalComponent::Ptr mapEquivalentShunt(IEC61970::Base::Equivalents::EquivalentShunt *shunt);
public:
///
enum GeneratorType{Static, Transient};
......
......@@ -24,7 +24,6 @@
#include <vector>
#include <algorithm>
#include <cps/PowerComponent.h>
#include <cps/TopologicalComponent.h>
#include <cps/PowerComponent.h>
#include <cps/Node.h>
......@@ -43,12 +42,12 @@ namespace CPS {
/// List of network nodes
TopologicalNode::List mNodes;
/// List of network components
Component::List mComponents;
IdentifiedObject::List mComponents;
/// List of tearing components could be used
/// by a solver to split the network into subnetworks
Component::List mTearComponents;
IdentifiedObject::List mTearComponents;
/// Map of network components connected to network nodes
std::map<TopologicalNode::Ptr, Component::List> mComponentsAtNode;
std::map<TopologicalNode::Ptr, TopologicalComponent::List> mComponentsAtNode;
// #### Deprecated ####
// Better use mFrequencies
......@@ -74,20 +73,20 @@ namespace CPS {
/// This constructor requires a search for all nodes
/// which is not implemented yet!
SystemTopology(Real frequency, Component::List components)
SystemTopology(Real frequency, IdentifiedObject::List components)
: SystemTopology(frequency) {
mComponents = components;
}
/// Standard constructor for single frequency simulations
SystemTopology(Real frequency, TopologicalNode::List nodes, Component::List components)
SystemTopology(Real frequency, TopologicalNode::List nodes, IdentifiedObject::List components)
: SystemTopology(frequency) {
addNodes(nodes);
addComponents(components);
}
/// Standard constructor for multi frequency simulations
SystemTopology(Real frequency, Matrix frequencies, TopologicalNode::List nodes, Component::List components)
SystemTopology(Real frequency, Matrix frequencies, TopologicalNode::List nodes, IdentifiedObject::List components)
: SystemTopology(frequency) {
mFrequencies = frequencies;
addNodes(nodes);
......@@ -131,7 +130,7 @@ namespace CPS {
}
/// Adds component and initializes frequencies
void addComponent(Component::Ptr component) {
void addComponent(IdentifiedObject::Ptr component) {
auto powerCompComplex = std::dynamic_pointer_cast<PowerComponent<Complex>>(component);
if (powerCompComplex) powerCompComplex->initialize(mFrequencies);
......@@ -142,13 +141,13 @@ namespace CPS {
}
/// Add multiple components
void addComponents(Component::List components) {
void addComponents(IdentifiedObject::List components) {
for (auto comp : components)
addComponent(comp);
}
/// Adds component and initializes frequencies
void addTearComponent(Component::Ptr component) {
void addTearComponent(IdentifiedObject::Ptr component) {
auto powerCompComplex = std::dynamic_pointer_cast<PowerComponent<Complex>>(component);
if (powerCompComplex) powerCompComplex->initialize(mFrequencies);
......@@ -159,7 +158,7 @@ namespace CPS {
}
/// Add multiple components
void addTearComponents(Component::List components) {
void addTearComponents(IdentifiedObject::List components) {
for (auto comp : components)
addTearComponent(comp);
}
......
/**
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
......@@ -86,7 +85,7 @@ Real Reader::unitValue(Real value, UnitMultiplier mult) {
return value;
}
Component::Ptr Reader::mapComponent(BaseClass* obj) {
TopologicalComponent::Ptr Reader::mapComponent(BaseClass* obj) {
if (ACLineSegment *line = dynamic_cast<ACLineSegment*>(obj))
return mapACLineSegment(line);
if (EnergyConsumer *consumer = dynamic_cast<EnergyConsumer*>(obj))
......@@ -167,7 +166,7 @@ void Reader::parseFiles() {
// Check if object is already in equipment list
if (mPowerflowEquipment.find(idObj->mRID) == mPowerflowEquipment.end()) {
Component::Ptr comp = mapComponent(obj);
TopologicalComponent::Ptr comp = mapComponent(obj);
if (comp)
mPowerflowEquipment.insert(std::make_pair(comp->uid(), comp));
}
......@@ -270,7 +269,7 @@ SystemTopology Reader::systemTopology() {
TopologicalNode::Ptr node=term->topologicalNodes();
//TopologicalNode::Ptr node = powercomp->topologicalTerminals().back()->topologicalNodes();
if (system.mComponentsAtNode.find(node) == system.mComponentsAtNode.end()) {
Component::List complist;
TopologicalComponent::List complist;
complist.push_back(powercomp);
system.mComponentsAtNode.insert(std::make_pair(node, complist));
}
......@@ -300,7 +299,7 @@ Matrix::Index Reader::mapTopologicalNode(String mrid) {
return search->second->simNode();
}
Component::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
TopologicalComponent::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
mSLog->info(" Found EnergyConsumer {}", consumer->name);
if (mDomain == Domain::EMT) {
if (mPhase == PhaseType::ABC) {
......@@ -336,7 +335,7 @@ Component::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
}
}
Component::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
TopologicalComponent::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
mSLog->info(" Found ACLineSegment {} r={} x={} bch={} gch={}", line->name,
(float) line->r.value,
(float) line->x.value,
......@@ -406,7 +405,7 @@ Component::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
}
Component::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
TopologicalComponent::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
if (trans->PowerTransformerEnd.size() != 2) {
mSLog->warn("PowerTransformer {} does not have exactly two windings, ignoring", trans->name);
return nullptr;
......@@ -526,7 +525,7 @@ Component::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
}
}
Component::Ptr Reader::mapSynchronousMachine(SynchronousMachine* machine) {
TopologicalComponent::Ptr Reader::mapSynchronousMachine(SynchronousMachine* machine) {
mSLog->info(" Found Synchronous machine {}", machine->name);
if (mGeneratorType == GeneratorType::Transient) {
......@@ -611,7 +610,7 @@ Component::Ptr Reader::mapSynchronousMachine(SynchronousMachine* machine) {
}
}
Component::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInjection* extnet) {
TopologicalComponent::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInjection* extnet) {
mSLog->info("Found External Network Injection {}", extnet->name);
if (mDomain == Domain::EMT) {
if (mPhase == PhaseType::ABC) {
......@@ -634,7 +633,7 @@ Component::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInjection* ext
return nullptr; // DP network injection not considered yet
}
Component::Ptr Reader::mapEquivalentShunt(EquivalentShunt* shunt){
TopologicalComponent::Ptr Reader::mapEquivalentShunt(EquivalentShunt* shunt){
mSLog->info("Found shunt {}", shunt->name);
Real baseVoltage = 0;
......@@ -733,7 +732,7 @@ void Reader::processTopologicalNode(IEC61970::Base::Topology::TopologicalNode* t
// Insert Equipment if it does not exist in the map and add reference to Terminal.
// This could be optimized because the Equipment is searched twice.
if (mPowerflowEquipment.find(equipment->mRID) == mPowerflowEquipment.end()) {
Component::Ptr comp = mapComponent(equipment);
TopologicalComponent::Ptr comp = mapComponent(equipment);
if (comp) {
mPowerflowEquipment.insert(std::make_pair(equipment->mRID, comp));
} else {
......
/**
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
......@@ -102,7 +101,7 @@ void SystemTopology::splitSubnets(std::vector<SystemTopology>& splitSystems) {
if (numberSubnets == 1) {
splitSystems.push_back(*this);
} else {
std::vector<Component::List> components(numberSubnets);
std::vector<IdentifiedObject::List> components(numberSubnets);
std::vector<TopologicalNode::List> nodes(numberSubnets);
// Split nodes into subnet groups
......
......@@ -46,7 +46,7 @@ namespace DPsim {
// #### CPS for users ####
using SystemTopology = CPS::SystemTopology;
using SystemNodeList = CPS::TopologicalNode::List;
using SystemComponentList = CPS::Component::List;
using SystemComponentList = CPS::IdentifiedObject::List;
using Logger = CPS::Logger;
using Domain = CPS::Domain;
using PhaseType = CPS::PhaseType;
......
......@@ -54,7 +54,7 @@ namespace DPsim {
/// Number of equations in problem
Int mNEQ;
/// Components of the Problem
CPS::Component::List mComponents;
CPS::IdentifiedObject::List mComponents;
/// Nodes of the Problem
CPS::Node<Complex>::List mNodes;
......
......@@ -114,7 +114,7 @@ namespace DPsim {
void log(Real time);
public:
DiakopticsSolver(String name, CPS::SystemTopology system, CPS::Component::List tearComponents, Real timeStep, CPS::Logger::Level logLevel);
DiakopticsSolver(String name, CPS::SystemTopology system, CPS::IdentifiedObject::List tearComponents, Real timeStep, CPS::Logger::Level logLevel);
CPS::Task::List getTasks();
......
/** MNASolver
*
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
/**
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* DPsim
*
......@@ -67,7 +65,7 @@ namespace DPsim {
///
typename CPS::Node<VarType>::List mNodes;
///
CPS::MNAInterface::List mPowerComponents;
CPS::MNAInterface::List mMNAComponents;
///
CPS::MNASwitchInterface::List mSwitches;
///
......@@ -162,7 +160,7 @@ namespace DPsim {
public:
SolveTask(MnaSolver<VarType>& solver, Bool steadyStateInit) :
Task(solver.mName + ".Solve"), mSolver(solver), mSteadyStateInit(steadyStateInit) {
for (auto it : solver.mPowerComponents) {
for (auto it : solver.mMNAComponents) {
if (it->template attribute<Matrix>("right_vector")->get().size() != 0) {
mAttributeDependencies.push_back(it->attribute("right_vector"));
}
......@@ -184,7 +182,7 @@ namespace DPsim {
public:
SolveTaskHarm(MnaSolver<VarType>& solver, Bool steadyStateInit, UInt freqIdx) :
Task(solver.mName + ".Solve"), mSolver(solver), mSteadyStateInit(steadyStateInit), mFreqIdx(freqIdx) {
for (auto it : solver.mPowerComponents) {
for (auto it : solver.mMNAComponents) {
if (it->template attribute<Matrix>("right_vector")->get().size() != 0) {
mAttributeDependencies.push_back(it->attribute("right_vector"));
}
......
......@@ -93,7 +93,7 @@ namespace DPsim {
Bool mSplitSubnets = true;
/// If tearing components exist, the Diakoptics
/// solver is selected automatically.
CPS::Component::List mTearComponents = CPS::Component::List();
CPS::IdentifiedObject::List mTearComponents = CPS::IdentifiedObject::List();
/// Determines if the system matrix is split into
/// several smaller matrices, one for each frequency.
/// This can only be done if the network is composed
......@@ -140,7 +140,7 @@ namespace DPsim {
CPS::Logger::Level logLevel = CPS::Logger::Level::info);
template <typename VarType>
void createSolvers(CPS::SystemTopology& system, CPS::Component::List& tearComponents);
void createSolvers(CPS::SystemTopology& system, CPS::IdentifiedObject::List& tearComponents);
void prepSchedule();
public:
......@@ -161,7 +161,7 @@ namespace DPsim {
Bool powerFlowInit = false,
Bool steadyStateInit = false,
Bool splitSubnets = true,
CPS::Component::List tearComponents = CPS::Component::List());
CPS::IdentifiedObject::List tearComponents = CPS::IdentifiedObject::List());
/// Desctructor
virtual ~Simulation() { }
......@@ -184,7 +184,7 @@ namespace DPsim {
///
void doSplitSubnets(Bool splitSubnets = true) { mSplitSubnets = splitSubnets; }
///
void setTearingComponents(CPS::Component::List tearComponents = CPS::Component::List()) {
void setTearingComponents(CPS::IdentifiedObject::List tearComponents = CPS::IdentifiedObject::List()) {
mTearComponents = tearComponents;
}
/// Set the scheduling method
......
......@@ -42,7 +42,7 @@ DAESolver::DAESolver(String name, CPS::SystemTopology system, Real dt, Real t0)
mOffsets.push_back(0);
// Set initial values of all required variables and create IDA solver environment
for(Component::Ptr comp : mSystem.mComponents) {
for(IdentifiedObject::Ptr comp : mSystem.mComponents) {
auto daeComp = std::dynamic_pointer_cast<DAEInterface>(comp);
std::cout <<"Added Comp"<<std::endl;
if (!daeComp)
......@@ -111,7 +111,7 @@ void DAESolver::initialize(Real t0) {
for (Component::Ptr comp : mComponents) {
for (IdentifiedObject::Ptr comp : mComponents) {
auto emtComp = std::dynamic_pointer_cast<PowerComponent<Complex> >(comp);
if (emtComp) {
emtComp->initializeFromPowerflow(mSystem.mSystemFrequency);// Set initial values of all components
......
......@@ -35,7 +35,7 @@ namespace DPsim {
template <typename VarType>
DiakopticsSolver<VarType>::DiakopticsSolver(String name,
SystemTopology system, Component::List tearComponents,
SystemTopology system, IdentifiedObject::List tearComponents,
Real timeStep, Logger::Level logLevel) :
Solver(name, logLevel), mTimeStep(timeStep) {
......
......@@ -83,8 +83,13 @@ void MnaSolver<VarType>::initialize() {
steadyStateInitialization();
// Some components feature a different behaviour for simulation and initialization
for (auto comp : mSystem.mComponents)
comp->setBehaviour(Component::Behaviour::Simulation);
for (auto comp : mSystem.mComponents) {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Simulation);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) sigComp->setBehaviour(SignalComponent::Behaviour::Simulation);
}
// Initialize system matrices and source vector.
initializeSystem();
......@@ -99,7 +104,7 @@ void MnaSolver<VarType>::initialize() {
template <>
void MnaSolver<Real>::initializeComponents() {
mSLog->info("-- Initialize components from power flow");
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
auto pComp = std::dynamic_pointer_cast<PowerComponent<Real>>(comp);
if (!pComp) continue;
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
......@@ -110,7 +115,7 @@ void MnaSolver<Real>::initializeComponents() {
comp->initialize(mSystem.mSystemOmega, mTimeStep);
// Initialize MNA specific parts of components.
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
comp->mnaInitialize(mSystem.mSystemOmega, mTimeStep, attribute<Matrix>("left_vector"));
const Matrix& stamp = comp->template attribute<Matrix>("right_vector")->get();
if (stamp.size() != 0) {
......@@ -126,7 +131,7 @@ void MnaSolver<Complex>::initializeComponents() {
mSLog->info("-- Initialize components from power flow");
// Initialize power components with frequencies and from powerflow results
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
auto pComp = std::dynamic_pointer_cast<PowerComponent<Complex>>(comp);
if (!pComp) continue;
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
......@@ -139,7 +144,7 @@ void MnaSolver<Complex>::initializeComponents() {
mSLog->info("-- Initialize MNA properties of components");
if (mFrequencyParallel) {
// Initialize MNA specific parts of components.
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
// Initialize MNA specific parts of components.
comp->mnaInitializeHarm(mSystem.mSystemOmega, mTimeStep, mLeftVectorHarmAttributes);
const Matrix& stamp = comp->template attribute<Matrix>("right_vector")->get();
......@@ -152,7 +157,7 @@ void MnaSolver<Complex>::initializeComponents() {
}
else {
// Initialize MNA specific parts of components.
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
comp->mnaInitialize(mSystem.mSystemOmega, mTimeStep, attribute<Matrix>("left_vector"));
const Matrix& stamp = comp->template attribute<Matrix>("right_vector")->get();
if (stamp.size() != 0) {
......@@ -183,21 +188,21 @@ void MnaSolver<VarType>::initializeSystem() {
if (mFrequencyParallel) {
for(Int freq = 0; freq < mSystem.mFrequencies.size(); freq++) {
// Create system matrix if no switches were added
for (auto comp : mPowerComponents)
for (auto comp : mMNAComponents)
comp->mnaApplySystemMatrixStampHarm(mSwitchedMatricesHarm[std::bitset<SWITCH_NUM>(0)][freq], freq);
mLuFactorizationsHarm[std::bitset<SWITCH_NUM>(0)].push_back(
Eigen::PartialPivLU<Matrix>(mSwitchedMatricesHarm[std::bitset<SWITCH_NUM>(0)][freq]));
// Initialize source vector
for (auto comp : mPowerComponents)
for (auto comp : mMNAComponents)
comp->mnaApplyRightSideVectorStampHarm(mRightSideVectorHarm[freq], freq);
}
}
else {
if (mSwitches.size() < 1) {
// Create system matrix if no switches were added
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
comp->mnaApplySystemMatrixStamp(mSwitchedMatrices[std::bitset<SWITCH_NUM>(0)]);
auto idObj = std::dynamic_pointer_cast<IdentifiedObject>(comp);
mSLog->debug("Stamping {:s} {:s} into system matrix: \n{:s}",
......@@ -208,7 +213,7 @@ void MnaSolver<VarType>::initializeSystem() {
else {
// Generate switching state dependent system matrices
for (auto& sys : mSwitchedMatrices) {
for (auto comp : mPowerComponents)
for (auto comp : mMNAComponents)
comp->mnaApplySystemMatrixStamp(sys.second);
for (UInt i = 0; i < mSwitches.size(); i++)
mSwitches[i]->mnaApplySwitchSystemMatrixStamp(sys.second, sys.first[i]);
......@@ -218,7 +223,7 @@ void MnaSolver<VarType>::initializeSystem() {
updateSwitchStatus();
}
// Initialize source vector for debugging
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
comp->mnaApplyRightSideVectorStamp(mRightSideVector);
auto idObj = std::dynamic_pointer_cast<IdentifiedObject>(comp);
......@@ -256,7 +261,7 @@ void MnaSolver<VarType>::identifyTopologyObjects() {
}
auto mnaComp = std::dynamic_pointer_cast<CPS::MNAInterface>(comp);
if (mnaComp) mPowerComponents.push_back(mnaComp);
if (mnaComp) mMNAComponents.push_back(mnaComp);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) mSignalComponents.push_back(sigComp);
......@@ -343,7 +348,7 @@ void MnaSolver<VarType>::createVirtualNodes() {
// virtual nodes are placed after network nodes
UInt virtualNode = mNumNetNodes - 1;
// Check if component requires virtual node and if so set one
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
auto pComp = std::dynamic_pointer_cast<PowerComponent<VarType>>(comp);
if (!pComp) continue;
......@@ -388,8 +393,13 @@ void MnaSolver<VarType>::steadyStateInitialization() {
Matrix diff = Matrix::Zero(2 * mNumNodes, 1);
Matrix prevLeftSideVector = Matrix::Zero(2 * mNumNodes, 1);
for (auto comp : mSystem.mComponents)
comp->setBehaviour(Component::Behaviour::Initialization);
for (auto comp : mSystem.mComponents) {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Initialization);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) sigComp->setBehaviour(SignalComponent::Behaviour::Initialization);
}
initializeSystem();
logSystemMatrices();
......@@ -405,7 +415,7 @@ void MnaSolver<VarType>::steadyStateInitialization() {
for (auto task : node->mnaTasks())
tasks.push_back(task);
}
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
for (auto task : comp->mnaTasks()) {
tasks.push_back(task);
}
......@@ -462,7 +472,7 @@ template <typename VarType>
Task::List MnaSolver<VarType>::getTasks() {
Task::List l;
for (auto comp : mPowerComponents) {
for (auto comp : mMNAComponents) {
for (auto task : comp->mnaTasks()) {
l.push_back(task);
}
......
......@@ -76,7 +76,7 @@ Simulation::Simulation(String name, SystemTopology system,
Bool powerFlowInit,
Bool steadyStateInit,
Bool splitSubnets,
Component::List tearComponents) :
IdentifiedObject::List tearComponents) :
Simulation(name, logLevel) {
mTimeStep = timeStep;
......@@ -124,7 +124,7 @@ void Simulation::initialize() {
template <typename VarType>
void Simulation::createSolvers(
CPS::SystemTopology& system,
Component::List& tearComponents) {
IdentifiedObject::List& tearComponents) {
std::vector<SystemTopology> subnets;
// The Diakoptics solver splits the system at a later point.
......
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