14 #include <dpsim-models/SimNode.h>
15 #include <dpsim-models/SimPowerComp.h>
16 #include <dpsim-models/TopologicalPowerComp.h>
19 #include <dpsim-models/Graph.h>
25 using Ptr = std::shared_ptr<SystemTopology>;
64 IdentifiedObject::List components)
68 componentsAtNodeList();
73 TopologicalNode::List nodes, IdentifiedObject::List components)
78 componentsAtNodeList();
81 Matrix initFrequency(Real frequency)
const;
89 void addNode(TopologicalNode::Ptr topNode);
92 void addNodeAt(TopologicalNode::Ptr topNode, UInt index);
95 void addNodes(
const TopologicalNode::List &topNodes);
101 template <
typename VarType>
103 typename SimNode<VarType>::List simNodes);
105 void componentsAtNodeList();
108 void addComponents(
const IdentifiedObject::List &components);
122 template <
typename Type>
typename std::shared_ptr<Type>
node(UInt index);
125 template <
typename Type>
126 typename std::shared_ptr<Type>
node(std::string_view name);
129 template <
typename Type>
130 typename std::shared_ptr<Type>
component(
const String &name) {
132 if (comp->name() == name) {
133 auto comp2 = std::dynamic_pointer_cast<Type>(comp);
143 std::map<String, String, std::less<>> listIdObjects()
const;
151 template <
typename VarType>
152 int checkTopologySubnets(
153 std::unordered_map<
typename CPS::SimNode<VarType>::Ptr,
int> &subnet);
156 template <
typename VarType>
157 void splitSubnets(std::vector<CPS::SystemTopology> &splitSystems);
162 void renderToFile(String filename);
166 template <
typename VarType>
void multiplyPowerComps(Int numberCopies);
Real mSystemOmega
System angular frequency - omega.
void addNodes(const TopologicalNode::List &topNodes)
Add multiple nodes.
Real mSystemFrequency
System frequency.
IdentifiedObject::List mComponents
List of network components.
std::shared_ptr< Type > node(UInt index)
Returns TopologicalNode by index in node list.
void initWithPowerflow(const SystemTopology &systemPF, CPS::Domain domain)
Initialize nodes and SG power from PowerFlow.
void addNode(TopologicalNode::Ptr topNode)
Adds node and initializes frequencies.
void addTearComponent(IdentifiedObject::Ptr component)
Adds component and initializes frequencies.
TopologicalNode::List mNodes
List of network nodes.
std::shared_ptr< Type > component(const String &name)
Returns Component by name.
SystemTopology(Real frequency)
void reset()
Reset state of components.
void addNodeAt(TopologicalNode::Ptr topNode, UInt index)
Adds node at specified position and initializes frequencies.
void addComponents(const IdentifiedObject::List &components)
Add multiple components.
Matrix mFrequencies
List of considered network frequencies.
void connectComponentToNodes(typename SimPowerComp< VarType >::Ptr component, typename SimNode< VarType >::List simNodes)
Connect component to simNodes.
void addComponent(IdentifiedObject::Ptr component)
Adds component and initializes frequencies.
SystemTopology(Real frequency, Matrix frequencies, TopologicalNode::List nodes, IdentifiedObject::List components)
Standard constructor for multi frequency simulations.
SystemTopology(Real frequency, IdentifiedObject::List components)
SystemTopology(Real frequency, TopologicalNode::List nodes, IdentifiedObject::List components)
Standard constructor for single frequency simulations.
void multiply(Int numberCopies)
Copy the whole topology the given number of times and add the resulting components and nodes to the t...
IdentifiedObject::List mTearComponents
SystemTopology()
Do not use this constructor.
void addTearComponents(const IdentifiedObject::List &components)
Add multiple components.
std::map< TopologicalNode::Ptr, TopologicalPowerComp::List > mComponentsAtNode
Map of network components connected to network nodes.