34#ifndef SVZERODSOLVER_ALGREBRA_SPARSESYSTEM_HPP_
35#define SVZERODSOLVER_ALGREBRA_SPARSESYSTEM_HPP_
37#include <Eigen/Sparse>
38#include <Eigen/SparseLU>
109 Eigen::SparseMatrix<double>
F;
110 Eigen::SparseMatrix<double>
E;
113 Eigen::Matrix<double, Eigen::Dynamic, 1>
C;
116 Eigen::Matrix<double, Eigen::Dynamic, 1>
118 Eigen::Matrix<double, Eigen::Dynamic, 1>
121 std::shared_ptr<Eigen::SparseLU<Eigen::SparseMatrix<double>>>
solver =
122 std::shared_ptr<Eigen::SparseLU<Eigen::SparseMatrix<double>>>(
123 new Eigen::SparseLU<Eigen::SparseMatrix<double>>());
140 Eigen::Matrix<double, Eigen::Dynamic, 1> &ydot);
Model of 0D elements.
Definition Model.h:75
Sparse system.
Definition SparseSystem.h:88
Eigen::SparseMatrix< double > dC_dy
System matrix dC/dy.
Definition SparseSystem.h:111
void reserve(Model *model)
Reserve memory in system matrices based on number of triplets.
Definition SparseSystem.cpp:57
void clean()
Delete dynamically allocated memory (class member Eigen::SparseLU<Eigen::SparseMatrix> *solver)
Definition SparseSystem.cpp:51
Eigen::SparseMatrix< double > E
System matrix E.
Definition SparseSystem.h:110
Eigen::SparseMatrix< double > dC_dydot
System matrix dC/dydot.
Definition SparseSystem.h:112
Eigen::Matrix< double, Eigen::Dynamic, 1 > C
System vector C.
Definition SparseSystem.h:113
Eigen::Matrix< double, Eigen::Dynamic, 1 > residual
Residual of the system.
Definition SparseSystem.h:117
SparseSystem()
Construct a new Sparse System object.
Definition SparseSystem.cpp:35
void solve()
Solve the system.
Definition SparseSystem.cpp:101
Eigen::SparseMatrix< double > F
System matrix F.
Definition SparseSystem.h:109
void update_residual(Eigen::Matrix< double, Eigen::Dynamic, 1 > &y, Eigen::Matrix< double, Eigen::Dynamic, 1 > &ydot)
Update the residual of the system.
Definition SparseSystem.cpp:85
void update_jacobian(double time_coeff_ydot, double time_coeff_y)
Update the jacobian of the system.
Definition SparseSystem.cpp:94
Eigen::Matrix< double, Eigen::Dynamic, 1 > dydot
Solution increment of the system.
Definition SparseSystem.h:119
~SparseSystem()
Destroy the Sparse System object.
Definition SparseSystem.cpp:49
Eigen::SparseMatrix< double > jacobian
Jacobian of the system.
Definition SparseSystem.h:115
std::shared_ptr< Eigen::SparseLU< Eigen::SparseMatrix< double > > > solver
Definition SparseSystem.h:121