DPsim
Loading...
Searching...
No Matches
MNASyncGenInterface.h
1/* Copyright 2017-2020 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/AttributeList.h>
12#include <dpsim-models/Config.h>
13#include <dpsim-models/Definitions.h>
14
15namespace CPS {
18protected:
20 Attribute<Int>::Ptr mNumIter;
22 Int mMaxIter = 25;
24 Real mTolerance = 1e-6;
25
26public:
27 typedef std::shared_ptr<MNASyncGenInterface> Ptr;
28 typedef std::vector<Ptr> List;
29
30 virtual ~MNASyncGenInterface(){};
31
32 // Solver functions
34 virtual void correctorStep() = 0;
36 virtual void updateVoltage(const Matrix &leftVector) = 0;
38 virtual bool requiresIteration() { return false; }
39
42 void setMaxIterations(Int maxIterations) { mMaxIter = maxIterations; }
44 void setTolerance(Real Tolerance) { mTolerance = Tolerance; }
45
46protected:
49};
50} // namespace CPS
void setMaxIterations(Int maxIterations)