Skip to content

Commit

Permalink
Change default linear solver to KLU (#250)
Browse files Browse the repository at this point in the history
This PR changes the default linear solver from SparseLU to KLU. KLU
performs per default a complete refactorisation. Besides, for partial
refactorisation, which can be chosen as an option by the user, a fix is
included for `mVariableSystemMatrixEntries` of
`DP_Ph1_ReducedOrderSynchronGeneratorVBR` when modelled as Norton
equivalent.
  • Loading branch information
dinkelbachjan authored Oct 18, 2023
2 parents ac67f2f + 65300f8 commit a4aa8cf
Show file tree
Hide file tree
Showing 41 changed files with 643 additions and 57 deletions.
16 changes: 10 additions & 6 deletions dpsim-models/src/DP/DP_Ph1_ReducedOrderSynchronGeneratorVBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ void DP::Ph1::ReducedOrderSynchronGeneratorVBR::mnaCompInitialize(Real omega,

mDomainInterface.setDPShiftFrequency(mBase_OmMech);

// get matrix dimension to properly set variable entries
auto n = leftVector->asRawPointer()->rows();
auto complexOffset = (UInt)(n / 2);

// set variable matrix entries depending on equivalent representation
if (mModelAsNortonSource) {
// FIXME set variable matrix entries accordingly as shown below
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0), matrixNodeIndex(0, 0)));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0) + complexOffset, matrixNodeIndex(0, 0)));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0), matrixNodeIndex(0, 0) + complexOffset));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0) + complexOffset, matrixNodeIndex(0, 0) + complexOffset));
} else {
// get matrix dimension to properly set variable entries
auto n = leftVector->asRawPointer()->rows();
auto complexOffset = (UInt)(n / 2);

// upper left
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex(), mVirtualNodes[0]->matrixNodeIndex()));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex() + complexOffset, mVirtualNodes[0]->matrixNodeIndex()));
Expand All @@ -68,12 +71,13 @@ void DP::Ph1::ReducedOrderSynchronGeneratorVBR::mnaCompInitialize(Real omega,
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0), matrixNodeIndex(0, 0) + complexOffset));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0) + complexOffset, matrixNodeIndex(0, 0) + complexOffset));

// off diagonal
// first off diagonal
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex(), matrixNodeIndex(0, 0)));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex() + complexOffset, matrixNodeIndex(0, 0)));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex(), matrixNodeIndex(0, 0) + complexOffset));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(mVirtualNodes[0]->matrixNodeIndex() + complexOffset, matrixNodeIndex(0, 0) + complexOffset));

// second off diagonal
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0), mVirtualNodes[0]->matrixNodeIndex()));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0) + complexOffset, mVirtualNodes[0]->matrixNodeIndex()));
mVariableSystemMatrixEntries.push_back(std::make_pair<UInt,UInt>(matrixNodeIndex(0, 0), mVirtualNodes[0]->matrixNodeIndex() + complexOffset));
Expand Down
4 changes: 2 additions & 2 deletions dpsim-models/src/DP/DP_Ph1_SynchronGenerator4OrderTPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ void DP::Ph1::SynchronGenerator4OrderTPM::setOperationalParametersPerUnit(Real n
nomVolt, nomFreq, H, Ld, Lq, L0,
Ld_t, Lq_t, Td0_t, Tq0_t);

mSLog->info("Set base parameters: \n"
SPDLOG_LOGGER_INFO(mSLog,"Set base parameters: \n"
"nomPower: {:e}\nnomVolt: {:e}\nnomFreq: {:e}\n",
nomPower, nomVolt, nomFreq);

mSLog->info("Set operational parameters in per unit: \n"
SPDLOG_LOGGER_INFO(mSLog,"Set operational parameters in per unit: \n"
"inertia: {:e}\n"
"Ld: {:e}\nLq: {:e}\nL0: {:e}\n"
"Ld_t: {:e}\nLq_t: {:e}\n"
Expand Down
2 changes: 1 addition & 1 deletion dpsim-models/src/DP/DP_Ph1_SynchronGenerator6OrderPCM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void DP::Ph1::SynchronGenerator6OrderPCM::specificInitialization() {
//
mEdqts << **mEdq_t, **mEdq_s;

mSLog->info(
SPDLOG_LOGGER_INFO(mSLog,
"\n--- Model specific initialization ---"
"\nInitial Ed_t (per unit): {:f}"
"\nInitial Eq_t (per unit): {:f}"
Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/CIM/DP_WSCC9bus_SGReducedOrderIter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ int main(int argc, char *argv[]) {
sim.setSolverType(Solver::Type::MNA);
sim.setTimeStep(timeStep);
sim.setFinalTime(finalTime);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.addLogger(logger);

// Optionally add switch event
Expand Down
2 changes: 1 addition & 1 deletion dpsim/examples/cxx/CIM/DP_WSCC9bus_SGReducedOrderVBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
String faultBusName= "BUS6";
Real inertiaScalingFactor = 1.0;
String logDirectory = "logs";
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::SparseLU;
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::KLU;

// Find CIM files
std::list<fs::path> filenames;
Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/CIM/EMT_WSCC-9bus_FullOrderSG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ int main(int argc, char *argv[]) {
sim.setSystem(sys);
sim.setDomain(Domain::EMT);
sim.setSolverType(Solver::Type::MNA);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.setTimeStep(timeStep);
sim.setFinalTime(finalTime);
sim.addLogger(logger);
Expand Down
2 changes: 1 addition & 1 deletion dpsim/examples/cxx/CIM/EMT_WSCC-9bus_VBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) {
String simName = "EMT_WSCC-9bus_VBR";
Real timeStep;
Real finalTime;
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::SparseLU;
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::KLU;

// Find CIM files
std::list<fs::path> filenames;
Expand Down
2 changes: 1 addition & 1 deletion dpsim/examples/cxx/CIM/EMT_WSCC9bus_SGReducedOrderVBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
String faultBusName= "BUS6";
Real inertiaScalingFactor = 1.0;
String logDirectory = "logs";
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::SparseLU;
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::KLU;

// Find CIM files
std::list<fs::path> filenames;
Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/CIM/SP_WSCC9bus_SGReducedOrderVBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ int main(int argc, char *argv[]) {
sim.setTimeStep(timeStep);
sim.setFinalTime(finalTime);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.addLogger(logger);

// Optionally add switch event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ int main(int argc, char* argv[]) {
simDP.setTimeStep(timeStep);
simDP.setFinalTime(finalTime);
simDP.setDomain(Domain::DP);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simDP.addLogger(loggerDP);
simDP.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ int main(int argc, char* argv[]) {
simDP.setTimeStep(timeStep);
simDP.setFinalTime(finalTime);
simDP.setDomain(Domain::DP);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simDP.addLogger(loggerDP);
simDP.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ int main(int argc, char* argv[]) {
simDP.setTimeStep(timeStep);
simDP.setFinalTime(finalTime);
simDP.setDomain(Domain::DP);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simDP.addLogger(logger);

// Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ int main(int argc, char* argv[]) {
simDP.setTimeStep(timeStep);
simDP.setFinalTime(finalTime);
simDP.setDomain(Domain::DP);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simDP.addLogger(logger);
simDP.doSystemMatrixRecomputation(true);

Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/Circuits/DP_SynGenTrStab_3Bus_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ void DP_SynGenTrStab_3Bus_Fault(String simName, Real timeStep, Real finalTime, b
simDP.setDomain(Domain::DP);
simDP.addLogger(loggerDP);
simDP.doSystemMatrixRecomputation(true);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/Circuits/DP_SynGenTrStab_SMIB_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void DP_1ph_SynGenTrStab_Fault(String simName, Real timeStep, Real finalTime, bo
simDP.setDomain(Domain::DP);
simDP.addLogger(loggerDP);
simDP.doSystemMatrixRecomputation(true);
simDP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ int main(int argc, char* argv[]) {
simEMT.setTimeStep(timeStep);
simEMT.setFinalTime(finalTime);
simEMT.setDomain(Domain::EMT);
simEMT.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simEMT.addLogger(loggerEMT);
simEMT.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ int main(int argc, char* argv[]) {
simEMT.setTimeStep(timeStep);
simEMT.setFinalTime(finalTime);
simEMT.setDomain(Domain::EMT);
simEMT.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simEMT.addLogger(loggerEMT);
simEMT.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ int main(int argc, char* argv[]) {
simEMT.setTimeStep(timeStep);
simEMT.setFinalTime(finalTime);
simEMT.setDomain(Domain::EMT);
simEMT.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simEMT.addLogger(logger);

// Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ int main(int argc, char* argv[]) {
simEMT.setTimeStep(timeStep);
simEMT.setFinalTime(finalTime);
simEMT.setDomain(Domain::EMT);
simEMT.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simEMT.addLogger(logger);
simEMT.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ void EMT_3ph_4OrderSynGenIter(String simName, Real timeStep, Real finalTime, Rea
simEMT.setFinalTime(finalTime);
simEMT.setDomain(Domain::EMT);
simEMT.addLogger(loggerEMT);
simEMT.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
auto sw1 = SwitchEvent3Ph::make(startTimeFault, fault, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ void DP_1ph_SynGenTrStab_Fault(Real timeStep, Real finalTime, bool startFaultEve
sim.setDomain(Domain::DP);
sim.addLogger(logger);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down Expand Up @@ -459,7 +458,6 @@ void SP_1ph_SynGenTrStab_Fault(Real timeStep, Real finalTime, bool startFaultEve
sim.setDomain(Domain::SP);
sim.addLogger(logger);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Real finalTime = 1.0;
Real timeStep = 10e-6;
Real startTimeFault=0.2;

int main(int argc, char* argv[]) {
int main(int argc, char* argv[]) {

if (argc > 1) {
CommandLineArgs args(argc, argv);
Expand Down Expand Up @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
extnetPF->setParameters(VnomMV);
extnetPF->setBaseVoltage(VnomMV);
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);

//Line
auto linePF = SP::Ph1::PiLine::make("PiLine", Logger::Level::debug);
linePF->setParameters(lineResistance, lineInductance, lineCapacitance, lineConductance);
Expand Down Expand Up @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) {
syngenKundur.nomPower, syngenKundur.nomVoltage, syngenKundur.nomFreq, syngenKundur.poleNum, syngenKundur.nomFieldCurr,
syngenKundur.Rs, syngenKundur.Ld, syngenKundur.Lq, syngenKundur.Ld_t, syngenKundur.Lq_t, syngenKundur.Ld_s,
syngenKundur.Lq_s, syngenKundur.Ll, syngenKundur.Td0_t, syngenKundur.Tq0_t, syngenKundur.Td0_s, syngenKundur.Tq0_s, syngenKundur.H);

//Grid bus as Slack
auto extnet = EMT::Ph3::NetworkInjection::make("Slack", Logger::Level::debug);

Expand Down Expand Up @@ -172,6 +172,5 @@ int main(int argc, char* argv[]) {
sim.addLogger(logger);
sim.addEvent(sw1);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.run();
}
1 change: 0 additions & 1 deletion dpsim/examples/cxx/Circuits/EMT_SynGenVBR_SMIB_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,5 @@ int main(int argc, char* argv[]) {
sim.addLogger(logger);
sim.addEvent(sw1);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ int main(int argc, char* argv[]) {
simSP.setTimeStep(timeStep);
simSP.setFinalTime(finalTime);
simSP.setDomain(Domain::SP);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simSP.addLogger(loggerSP);
simSP.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ int main(int argc, char* argv[]) {
simSP.setTimeStep(timeStep);
simSP.setFinalTime(finalTime);
simSP.setDomain(Domain::SP);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simSP.addLogger(loggerSP);
simSP.doSystemMatrixRecomputation(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ int main(int argc, char* argv[]) {
simSP.setTimeStep(timeStep);
simSP.setFinalTime(finalTime);
simSP.setDomain(Domain::SP);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
simSP.addLogger(logger);
simSP.doSystemMatrixRecomputation(true);

Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/Circuits/SP_SynGenTrStab_3Bus_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ void SP_SynGenTrStab_3Bus_Fault(String simName, Real timeStep, Real finalTime, b
simSP.setDomain(Domain::SP);
simSP.addLogger(loggerSP);
simSP.doSystemMatrixRecomputation(true);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down
1 change: 0 additions & 1 deletion dpsim/examples/cxx/Circuits/SP_SynGenTrStab_SMIB_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void SP_1ph_SynGenTrStab_Fault(String simName, Real timeStep, Real finalTime, bo
simSP.setDomain(Domain::SP);
simSP.addLogger(loggerSP);
simSP.doSystemMatrixRecomputation(true);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
if (startFaultEvent){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ void SP_1ph_SynGenTrStab_Fault(String simName, Real timeStep, Real finalTime, Re
simSP.setDomain(Domain::SP);
simSP.addLogger(loggerSP);
// simSP.doSystemMatrixRecomputation(true);
simSP.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);

// Events
auto sw1 = SwitchEvent::make(std::round(startTimeFault/timeStep)*timeStep, faultSP, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char* argv[]) {
Bool withExciter = false;
Real timeStepEvent = 30.0;
Real cmdLoadFactor = 1.5;


CommandLineArgs args(argc, argv);
if (argc > 1) {
Expand Down Expand Up @@ -79,14 +79,14 @@ int main(int argc, char* argv[]) {
gen->setInitialValues(initActivePower, initReactivePower, initTerminalVoltageMagnitude,
initTerminalVoltageAngle, initMechPower);

if (withGovernor)
if (withGovernor)
gen->addGovernor(govKundur.Ta_t, govKundur.Tb, govKundur.Tc, govKundur.Fa, govKundur.Fb, govKundur.Fc, govKundur.Kg, govKundur.Tsr, govKundur.Tsm, initActivePower / syngenKundur.nomPower, initMechPower / syngenKundur.nomPower);

if (withExciter)
gen->addExciter(excEremia.Ta, excEremia.Ka, excEremia.Te, excEremia.Ke, excEremia.Tf, excEremia.Kf, excEremia.Tr);

auto fault = CPS::EMT::Ph3::Switch::make("Br_fault", CPS::Logger::Level::info);
fault->setParameters(Math::singlePhaseParameterToThreePhase(RloadOriginal),
fault->setParameters(Math::singlePhaseParameterToThreePhase(RloadOriginal),
Math::singlePhaseParameterToThreePhase(RloadNew));
fault->openSwitch();

Expand Down Expand Up @@ -115,7 +115,6 @@ int main(int argc, char* argv[]) {
sim.setTimeStep(timeStep);
sim.setFinalTime(finalTime);
sim.doSystemMatrixRecomputation(true);
sim.setDirectLinearSolverImplementation(DPsim::DirectLinearSolverImpl::SparseLU);
sim.setDomain(Domain::EMT);
sim.addLogger(logger);

Expand Down
5 changes: 4 additions & 1 deletion dpsim/include/dpsim/KLUAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace DPsim
std::vector<Int> mVaryingRows;

/// KLU-specific structs
klu_common mCommon;
klu_common mCommon;
klu_numeric* mNumeric = nullptr;
klu_symbolic* mSymbolic = nullptr;

Expand All @@ -47,6 +47,9 @@ namespace DPsim
/// AMD_ORDERING is defined in SuiteSparse/AMD
int mPreordering = AMD_ORDERING;

/// Count Pivot faults
int mPivotFaults = 0;

PARTIAL_REFACTORIZATION_METHOD mPartialRefactorizationMethod = PARTIAL_REFACTORIZATION_METHOD::FACTORIZATION_PATH;

/// Temporary value to store the number of nonzeros
Expand Down
6 changes: 3 additions & 3 deletions dpsim/include/dpsim/MNASolverFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ class MnaSolverFactory {
static std::shared_ptr<MnaSolver<VarType>> factory(String name,
CPS::Domain domain = CPS::Domain::DP,
CPS::Logger::Level logLevel = CPS::Logger::Level::info,
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::SparseLU,
DirectLinearSolverImpl implementation = DirectLinearSolverImpl::KLU,
String pluginName = "plugin.so")
{
//To avoid regression we use SparseLU in case of undefined implementation
//To avoid regression we use KLU in case of undefined implementation
if (implementation == DirectLinearSolverImpl::Undef) {
implementation = DirectLinearSolverImpl::SparseLU;
implementation = DirectLinearSolverImpl::KLU;
}
CPS::Logger::Log log = CPS::Logger::get("MnaSolverFactory", CPS::Logger::Level::info, CPS::Logger::Level::info);

Expand Down
4 changes: 2 additions & 2 deletions dpsim/include/dpsim/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CommandLineArgs {
Bool si = false,
CPS::Domain sd = CPS::Domain::DP,
Solver::Type st = Solver::Type::MNA,
DirectLinearSolverImpl mi = DirectLinearSolverImpl::SparseLU,
DirectLinearSolverImpl mi = DirectLinearSolverImpl::KLU,
String spn = "plugin.so",
String params = "default.json"
);
Expand All @@ -80,7 +80,7 @@ class CommandLineArgs {
Bool si = false,
CPS::Domain sd = CPS::Domain::DP,
Solver::Type st = Solver::Type::MNA,
DirectLinearSolverImpl mi = DirectLinearSolverImpl::SparseLU,
DirectLinearSolverImpl mi = DirectLinearSolverImpl::KLU,
String spn = "plugin.so"
);

Expand Down
Loading

0 comments on commit a4aa8cf

Please sign in to comment.