DPsim
Loading...
Searching...
No Matches
MNASwitchInterface.h
Go to the documentation of this file.
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
11#include <dpsim-models/Config.h>
13
14namespace CPS {
17public:
18 typedef std::shared_ptr<MNASwitchInterface> Ptr;
19 typedef std::vector<Ptr> List;
20
21 virtual ~MNASwitchInterface() = default;
22
29 virtual Bool supportsPrecomputedSystemMatrices() const { return true; }
30
31 // #### MNA section ####
33 virtual Bool mnaIsClosed() = 0;
36 SparseMatrixRow &systemMatrix,
37 Int freqIdx) final {
38 this->mnaCompApplySwitchSystemMatrixStamp(closed, systemMatrix, freqIdx);
39 systemMatrix.makeCompressed();
40 }
42 Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx) {}
43};
44} // namespace CPS
MNA interface to be used by switching devices.
std::shared_ptr< MNASwitchInterface > Ptr
virtual Bool supportsPrecomputedSystemMatrices() const
virtual void mnaApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx) final
Stamps system matrix considering the defined switch position.
virtual void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx)
virtual Bool mnaIsClosed()=0
Check if switch is closed.
virtual ~MNASwitchInterface()=default
int Int
Definition Definitions.h:61
bool Bool
Definition Definitions.h:64
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).
Definition Definitions.h:74