DPsim
Loading...
Searching...
No Matches
MNAStateSpaceContributor.h
Go to the documentation of this file.
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
11#include <dpsim/Definitions.h>
12
13namespace DPsim {
14
17 std::array<UInt, 3> indices;
18
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 contributesToUpdatedMatrices() const { return false; }
58
60 virtual Bool requiresUpdate() const { return false; }
61
64 return {};
65 }
66
68 virtual void stamp(Matrix &AdLocal, Matrix &BdMna, Matrix &CdMna,
69 UInt stateOffset, UInt mnaVectorSize) const = 0;
70
75 virtual void contributeMetadata(StateSpaceMetadata &metadata,
76 UInt stateOffset) const {}
77};
78
85public:
87 createList(const CPS::MNAInterface::List &components);
88
89private:
91 create(const CPS::MNAInterface::Ptr &component);
92};
93
94} // namespace DPsim
std::vector< Ptr > List
Definition Attribute.h:123
std::vector< Ptr > List
std::shared_ptr< MNAInterface > Ptr
static MNAStateSpaceContributor::List createList(const CPS::MNAInterface::List &components)
std::shared_ptr< MNAStateSpaceContributor > Ptr
virtual Bool requiresUpdate() const
Whether this contributor requests its matrices to be refreshed.
virtual UInt getStateCount() const =0
Number of local extraction states contributed by this component.
virtual CPS::AttributeBase::List getAttributeDependencies() const
Attributes that must be up to date before this contribution is stamped.
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
virtual Bool contributesToUpdatedMatrices() const
Whether this contributor belongs to the updated matrix group.
virtual ~MNAStateSpaceContributor()=default
CPS::String String
Definition Definitions.h:20
CPS::Matrix Matrix
Definition Definitions.h:24
CPS::Bool Bool
Definition Definitions.h:21
CPS::UInt UInt
Definition Definitions.h:23
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.