DPsim
MNASwitchInterface.h
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>
12 #include <dpsim-models/Definitions.h>
13 
14 namespace CPS {
17 public:
18  typedef std::shared_ptr<MNASwitchInterface> Ptr;
19  typedef std::vector<Ptr> List;
20 
21  virtual ~MNASwitchInterface() = default;
22 
23  // #### MNA section ####
25  virtual Bool mnaIsClosed() = 0;
27  virtual void mnaApplySwitchSystemMatrixStamp(Bool closed,
28  SparseMatrixRow &systemMatrix,
29  Int freqIdx) final {
30  this->mnaCompApplySwitchSystemMatrixStamp(closed, systemMatrix, freqIdx);
31  systemMatrix.makeCompressed();
32  }
33  virtual void mnaCompApplySwitchSystemMatrixStamp(
34  Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx) {}
35 };
36 } // namespace CPS
MNA interface to be used by switching devices.
virtual void mnaApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, Int freqIdx) final
Stamps system matrix considering the defined switch position.
virtual Bool mnaIsClosed()=0
Check if switch is closed.