2 #ifndef LOCAL_SYSTEM_HH_
3 #define LOCAL_SYSTEM_HH_
129 double mat_val,
double rhs_val);
191 static constexpr
double almost_zero = std::numeric_limits<double>::min();
void set_sparsity(const arma::umat &sp)
Sets the sparsity pattern for the local system.
LocDofVec elim_cols
Rows indices of rows to be eliminated.
void set_solution_col(uint loc_col, double solution)
LocalSystem()
Default constructor.
void set_solution(uint loc_dof, double solution, double diag=0.0)
Set the position and value of known solution. E.g. Dirichlet boundary condition.
void set_size(uint nrows, uint ncols)
uint n_elim_rows
Number of rows/cols to be eliminated due to known solution.
void eliminate_solution()
const arma::mat & get_matrix()
void reconstruct_solution_schur(uint offset, const arma::vec &schur_solution, arma::vec &reconstructed_solution) const
Reconstructs the solution from the Schur complement solution: x = invA*b - invA * Bt * schur_solution...
arma::mat sparsity
sparsity pattern
void set_rhs(arma::vec rhs)
const arma::vec & get_rhs()
arma::vec rhs
local system RHS
void add_value(uint row, uint col, double mat_val, double rhs_val)
Adds a single entry into the local system.
void set_matrix(arma::mat matrix)
arma::vec solution_rows
Cols indices of cols to be eliminated.
arma::vec solution_cols
Values of the known solution (for row dofs).
arma::vec diag_rows
Values of the known solution (for col dofs).
static constexpr double almost_zero
void compute_schur_complement(uint offset, LocalSystem &schur, bool negative=false) const
Computes Schur complement of the local system: S = C - B * invA * Bt Applicable for square matrices....
arma::mat matrix
local system matrix
void reset()
Resets the matrix, RHS, dofs to zero and clears solution settings.
void set_solution_row(uint loc_row, double solution, double diag=0.0)
arma::Col< IntIdx > LocDofVec
ArmaMat< double, N, M > mat