9 #include <dpsim/DirectLinearSolverConfiguration.h>
11 using namespace DPsim;
14 DirectLinearSolverConfiguration::DirectLinearSolverConfiguration() {
15 mScalingMethod = SCALING_METHOD::MAX_SCALING;
16 mPartialRefactorizationMethod =
17 PARTIAL_REFACTORIZATION_METHOD::NO_PARTIAL_REFACTORIZATION;
18 mUseBTF = USE_BTF::DO_BTF;
19 mFillInReductionMethod = FILL_IN_REDUCTION_METHOD::AMD;
22 void DirectLinearSolverConfiguration::setFillInReductionMethod(
23 FILL_IN_REDUCTION_METHOD fillInReductionMethod) {
24 mFillInReductionMethod = fillInReductionMethod;
27 void DirectLinearSolverConfiguration::setScalingMethod(
28 SCALING_METHOD scalingMethod) {
29 mScalingMethod = scalingMethod;
32 void DirectLinearSolverConfiguration::setPartialRefactorizationMethod(
33 PARTIAL_REFACTORIZATION_METHOD partialRefactorizationMethod) {
34 mPartialRefactorizationMethod = partialRefactorizationMethod;
37 void DirectLinearSolverConfiguration::setBTF(USE_BTF useBTF) {
41 SCALING_METHOD DirectLinearSolverConfiguration::getScalingMethod()
const {
42 return mScalingMethod;
45 FILL_IN_REDUCTION_METHOD
46 DirectLinearSolverConfiguration::getFillInReductionMethod()
const {
47 return mFillInReductionMethod;
50 PARTIAL_REFACTORIZATION_METHOD
51 DirectLinearSolverConfiguration::getPartialRefactorizationMethod()
const {
52 return mPartialRefactorizationMethod;
56 DirectLinearSolverConfiguration::DirectLinearSolverConfiguration::getBTF()
61 String DirectLinearSolverConfiguration::getScalingMethodString()
const {
62 switch (mScalingMethod) {
63 case SCALING_METHOD::MAX_SCALING:
65 case SCALING_METHOD::SUM_SCALING:
67 case SCALING_METHOD::NO_SCALING:
68 return "without scaling";
70 return "using the solver's default scaling method";
74 String DirectLinearSolverConfiguration::getFillInReductionMethodString()
const {
75 switch (mFillInReductionMethod) {
76 case FILL_IN_REDUCTION_METHOD::AMD_NV:
77 return "AMD using a preference for non-varying entries";
78 case FILL_IN_REDUCTION_METHOD::AMD_RA:
79 return "AMD using a right-arranging of varying entries";
80 case FILL_IN_REDUCTION_METHOD::COLAMD:
82 case FILL_IN_REDUCTION_METHOD::AMD:
85 return "using the solver's default fill-in reduction";
90 DirectLinearSolverConfiguration::getPartialRefactorizationMethodString()
const {
91 switch (mPartialRefactorizationMethod) {
92 case PARTIAL_REFACTORIZATION_METHOD::REFACTORIZATION_RESTART:
93 return "with refactorization restart";
94 case PARTIAL_REFACTORIZATION_METHOD::NO_PARTIAL_REFACTORIZATION:
95 return "without partial refactorization";
96 case PARTIAL_REFACTORIZATION_METHOD::FACTORIZATION_PATH:
97 return "with factorization path";
99 return "with unknown method";
103 String DirectLinearSolverConfiguration::getBTFString()
const {
105 case USE_BTF::DO_BTF:
107 case USE_BTF::NO_BTF:
109 return "without BTF";