DPsim
Loading...
Searching...
No Matches
DenseLUAdapter.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 <bitset>
12#include <iostream>
13#include <list>
14#include <memory>
15#include <unordered_map>
16#include <vector>
17
18#include <dpsim/Config.h>
19#include <dpsim/Definitions.h>
20#include <dpsim/DirectLinearSolver.h>
21
22namespace DPsim {
24 Eigen::PartialPivLU<Matrix> LUFactorized;
25
26public:
29
31 ~DenseLUAdapter() override;
32
34 void preprocessing(SparseMatrix &systemMatrix,
35 std::vector<std::pair<UInt, UInt>>
36 &listVariableSystemMatrixEntries) override;
37
39 void factorize(SparseMatrix &systemMatrix) override;
40
42 void refactorize(SparseMatrix &systemMatrix) override;
43
45 void partialRefactorize(SparseMatrix &systemMatrix,
46 std::vector<std::pair<UInt, UInt>>
47 &listVariableSystemMatrixEntries) override;
48
50 Matrix solve(Matrix &rightSideVector) override;
51};
52} // namespace DPsim
DirectLinearSolver()=default
Constructor with logging.
void factorize(SparseMatrix &systemMatrix) override
factorization function with partial pivoting
void partialRefactorize(SparseMatrix &systemMatrix, std::vector< std::pair< UInt, UInt > > &listVariableSystemMatrixEntries) override
partial refactorization withouth partial pivoting
~DenseLUAdapter() override
Destructor.
void preprocessing(SparseMatrix &systemMatrix, std::vector< std::pair< UInt, UInt > > &listVariableSystemMatrixEntries) override
preprocessing function pre-ordering and scaling the matrix
void refactorize(SparseMatrix &systemMatrix) override
refactorization without partial pivoting
Matrix solve(Matrix &rightSideVector) override
solution function for a right hand side
DirectLinearSolver()=default
Constructor.