1#ifndef MATRIX_MANAGER_H
2#define MATRIX_MANAGER_H
21 std::vector<std::pair<int, int>> m_non_zero_elements;
85 delta_t = m_sim->m_simulation_config.getDoubleParameters(
"time_delta");
89 std::cerr <<
"[MatrixManager]: " <<
e.what() <<
'\n';
90 throw BadInput(
static_cast<std::string
>(
"[MatrixManager]: ")
91 +
static_cast<std::string
>(
e.what()));
93 const std::valarray<T>&
temperature{m_sim->m_field_map.at(
"Temperature")};
129 lhs_matrix->zeroMatrix();
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
void registerElement(T value, int rows, int cols) override
Registers the element and it's initial value within a COO style vector for dynamic creation.
Definition CsrMatrix.h:128
const std::vector< std::pair< int, int > > & getNonZeroElements() override
Definition CsrMatrix.h:75
void updateNonZeroElements() override
Sets the m_non_zero_elememts parameter of the parent class.
Definition CsrMatrix.h:635
std::valarray< T > scalarMultiply(T value) const override
Multiplication of a scalar to the matrix values element-wise.
Definition CsrMatrix.h:510
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:94
std::valarray< T > matrixVectorMultiplication(const std::valarray< T > &value) const override
Matrix-vector-multiplication for sparse matrices.
Definition CsrMatrix.h:577
std::valarray< T > vectorElemAdd(const std::valarray< T > &value) const override
Addition of a vector to the matrix values element-wise.
Definition CsrMatrix.h:531
void buildAtRuntime()
Builds the CSR matrix from the registered elements. It sorts all elements of the COO format vector by...
Definition CsrMatrix.h:147
void overwriteMatrixValues(const std::valarray< T > &value)
Overwrites the matrix values with a new valarray. This is used for optimized overwrite when arithmeti...
Definition GenericMatrix.h:142
std::vector< std::pair< int, int > > m_non_zero_elements
Definition GenericMatrix.h:25
std::pair< int, int > size() const
Function that returns the size of the matrix as a pair in (rows, columns) format.
Definition GenericMatrix.h:120
Class that manages the assembly of the global linear system of equations to be passed to the solver.
Definition MatrixManager.h:19
std::valarray< T > rhs_vector
Definition MatrixManager.h:29
MatrixManager(int size, SimulationClassBase< T > *sim, std::shared_ptr< MatrixFactory< T > > matrix_factory)
Constructor for MatrixManager.
Definition MatrixManager.h:43
void assembleGlobalLse(std::shared_ptr< GenericMatrix< T > > capacitance_matrix, std::shared_ptr< GenericMatrix< T > > stiffness_matrix, std::valarray< T > &forcing_vector)
Function which assembles the global linear system of equations from the global FEM matrices.
Definition MatrixManager.h:64
std::shared_ptr< GenericMatrix< T > > lhs_matrix
Definition MatrixManager.h:28