DPsim
Loading...
Searching...
No Matches
DirectLinearSolverConfiguration.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/Config.h>
12#include <dpsim/Definitions.h>
13
14namespace DPsim {
15// Define method to scale the input matrix
16enum class SCALING_METHOD { NO_SCALING, SUM_SCALING, MAX_SCALING };
17
18// Define preordering to reduce fill-in
19enum class FILL_IN_REDUCTION_METHOD {
20 AMD,
21 AMD_NV, // AMD ordering with non-varying preference
22 AMD_RA, // AMD ordering with right arranging of varying entries
23 COLAMD
24};
25
26// Define partial refactorization method, if applicable
27enum class PARTIAL_REFACTORIZATION_METHOD {
28 NO_PARTIAL_REFACTORIZATION,
29 FACTORIZATION_PATH,
30 REFACTORIZATION_RESTART
31};
32
33// Define BTF usage, if applicable
34enum class USE_BTF { NO_BTF, DO_BTF };
35
36class DirectLinearSolverConfiguration {
37 SCALING_METHOD mScalingMethod;
38 FILL_IN_REDUCTION_METHOD mFillInReductionMethod;
39 PARTIAL_REFACTORIZATION_METHOD mPartialRefactorizationMethod;
40 USE_BTF mUseBTF;
41
42public:
43 DirectLinearSolverConfiguration();
44
45 void setFillInReductionMethod(FILL_IN_REDUCTION_METHOD fillInReductionMethod);
46
47 void setScalingMethod(SCALING_METHOD scalingMethod);
48
49 void setPartialRefactorizationMethod(
50 PARTIAL_REFACTORIZATION_METHOD partialRefactorizationMethod);
51
52 void setBTF(USE_BTF useBTF);
53
54 SCALING_METHOD getScalingMethod() const;
55
56 FILL_IN_REDUCTION_METHOD getFillInReductionMethod() const;
57
58 PARTIAL_REFACTORIZATION_METHOD getPartialRefactorizationMethod() const;
59
60 USE_BTF getBTF() const;
61
62 String getScalingMethodString() const;
63
64 String getFillInReductionMethodString() const;
65
66 String getPartialRefactorizationMethodString() const;
67
68 String getBTFString() const;
69};
70} // namespace DPsim