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
19 std::vector<std::array<UInt, 3>> abcStateIndexTriples;
20};
21
33public:
34 using Ptr = std::shared_ptr<MNAStateSpaceContributor>;
35 using List = std::vector<Ptr>;
36
37 virtual ~MNAStateSpaceContributor() = default;
38
40 virtual UInt getStateCount() const = 0;
41
43 virtual Bool isVariable() const { return false; }
44
46 virtual void stamp(Matrix &AdLocal, Matrix &BdMna, Matrix &CdMna,
47 UInt stateOffset, UInt mnaVectorSize) const = 0;
48
53 virtual void contributeMetadata(StateSpaceMetadata &metadata,
54 UInt stateOffset) const {}
55};
56
63public:
64 static MNAStateSpaceContributor::List
65 createList(const CPS::MNAInterface::List &components);
66
67private:
68 static MNAStateSpaceContributor::Ptr
69 create(const CPS::MNAInterface::Ptr &component);
70};
71
72} // 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::vector< std::array< UInt, 3 > > abcStateIndexTriples