DPsim
Loading...
Searching...
No Matches
MNAStateSpaceContributor.h
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include <array>
7#include <memory>
8#include <vector>
9
10#include <dpsim-models/Solver/MNAInterface.h>
11#include <dpsim/Definitions.h>
12
13namespace DPsim {
14
17 std::array<UInt, 3> indices;
18
23 String name;
24};
25
28 std::vector<String> stateNames;
29
33 std::vector<StateSpaceAbcStateBlock> abcStateBlocks;
34};
35
47public:
48 using Ptr = std::shared_ptr<MNAStateSpaceContributor>;
49 using List = std::vector<Ptr>;
50
51 virtual ~MNAStateSpaceContributor() = default;
52
54 virtual UInt getStateCount() const = 0;
55
57 virtual Bool isVariable() const { return false; }
58
60 virtual void stamp(Matrix &AdLocal, Matrix &BdMna, Matrix &CdMna,
61 UInt stateOffset, UInt mnaVectorSize) const = 0;
62
67 virtual void contributeMetadata(StateSpaceMetadata &metadata,
68 UInt stateOffset) const {}
69};
70
77public:
78 static MNAStateSpaceContributor::List
79 createList(const CPS::MNAInterface::List &components);
80
81private:
82 static MNAStateSpaceContributor::Ptr
83 create(const CPS::MNAInterface::Ptr &component);
84};
85
86} // namespace DPsim
virtual Bool isVariable() const
Returns true if the local matrices may change during simulation.
virtual UInt getStateCount() const =0
Number of local extraction states contributed by this component.
virtual void stamp(Matrix &AdLocal, Matrix &BdMna, Matrix &CdMna, UInt stateOffset, UInt mnaVectorSize) const =0
Stamp this component's current local state-space contribution.
virtual void contributeMetadata(StateSpaceMetadata &metadata, UInt stateOffset) const
std::array< UInt, 3 > indices
Global extracted-state indices representing one native abc-frame state block.
std::vector< StateSpaceAbcStateBlock > abcStateBlocks
std::vector< String > stateNames
Names of extracted states in native extracted-state order.