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 <memory>
7#include <vector>
8
9#include <dpsim-models/Solver/MNAInterface.h>
10#include <dpsim/Definitions.h>
11
12namespace DPsim {
13
25public:
26 using Ptr = std::shared_ptr<MNAStateSpaceContributor>;
27 using List = std::vector<Ptr>;
28
29 virtual ~MNAStateSpaceContributor() = default;
30
32 virtual UInt getStateCount() const = 0;
33
35 virtual Bool isVariable() const { return false; }
36
38 virtual void stamp(Matrix &AdLocal, Matrix &BdMna, Matrix &CdMna,
39 UInt stateOffset, UInt mnaVectorSize) const = 0;
40};
41
48public:
49 static MNAStateSpaceContributor::List
50 createList(const CPS::MNAInterface::List &components);
51
52private:
53 static MNAStateSpaceContributor::Ptr
54 create(const CPS::MNAInterface::Ptr &component);
55};
56
57} // 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.