sogno-platform / dpsim

Real-time power system simulator including powerflow, (dynamic) phasors and EMT
https://sogno.energy/dpsim/
Mozilla Public License 2.0
70 stars 51 forks source link

Create linear solver configuration class #191

Closed LennartSchu closed 1 year ago

LennartSchu commented 1 year ago

Currently, the linear solvers (KLU, SparseLU, etc.) are using default solver settings. These default settings may not be optimal for each simulation. Therefore, it would be reasonable to have a configuration-object that can be passed to each linear solver (which inherit from DirectLinearSolver) , from which each solver can read the required configuration. Configuration options could be:

  1. Ordering, such as
    • AMD
    • COLAMD
    • specialised orderings for partial refactorization, if applicable
  2. Scaling
  3. Partial refactorization method (Refactorization Restart or Factorization Path), if applicable

If a option is not available in the solver, it could make sense to log this circumstance as information to the user and default to a certain option. This would require the DirectLinearSolver-classes would have access to spdlog, which is not the case now.