DPsim
Loading...
Searching...
No Matches
DirectLinearSolverConfiguration.cpp
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
10
11using namespace DPsim;
12
13namespace DPsim {
15 mScalingMethod = SCALING_METHOD::MAX_SCALING;
16 mPartialRefactorizationMethod =
18 mUseBTF = USE_BTF::DO_BTF;
19 mFillInReductionMethod = FILL_IN_REDUCTION_METHOD::AMD;
20 mUseStaticPreconditioner = false;
21}
22
24 FILL_IN_REDUCTION_METHOD fillInReductionMethod) {
25 mFillInReductionMethod = fillInReductionMethod;
26}
27
29 SCALING_METHOD scalingMethod) {
30 mScalingMethod = scalingMethod;
31}
32
34 PARTIAL_REFACTORIZATION_METHOD partialRefactorizationMethod) {
35 mPartialRefactorizationMethod = partialRefactorizationMethod;
36}
37
39 mUseBTF = useBTF;
40}
41
43 mUseStaticPreconditioner = enabled;
44}
45
49
52 return mFillInReductionMethod;
53}
54
57 return mPartialRefactorizationMethod;
58}
59
61
63 return mUseStaticPreconditioner;
64}
65
67 switch (mScalingMethod) {
69 return "max scaling";
71 return "sum scaling";
73 return "without scaling";
74 default:
75 return "using the solver's default scaling method";
76 }
77}
78
80 switch (mFillInReductionMethod) {
82 return "AMD using a preference for non-varying entries";
84 return "AMD using a right-arranging of varying entries";
86 return "COLAMD";
88 return "AMD";
89 default:
90 return "using the solver's default fill-in reduction";
91 }
92}
93
96 switch (mPartialRefactorizationMethod) {
98 return "with refactorization restart";
100 return "without partial refactorization";
102 return "with factorization path";
103 default:
104 return "with unknown method";
105 }
106}
107
109 switch (mUseBTF) {
110 case USE_BTF::DO_BTF:
111 return "with BTF";
112 case USE_BTF::NO_BTF:
113 default:
114 return "without BTF";
115 }
116}
117} // namespace DPsim
void setPartialRefactorizationMethod(PARTIAL_REFACTORIZATION_METHOD partialRefactorizationMethod)
void setFillInReductionMethod(FILL_IN_REDUCTION_METHOD fillInReductionMethod)
PARTIAL_REFACTORIZATION_METHOD getPartialRefactorizationMethod() const
FILL_IN_REDUCTION_METHOD getFillInReductionMethod() const
CPS::String String
Definition Definitions.h:20
CPS::Bool Bool
Definition Definitions.h:21