2 #ifndef LOCAL_SYSTEM_HH_ 3 #define LOCAL_SYSTEM_HH_ 51 LocalSystem(
unsigned int nrows,
unsigned int ncols);
57 void reset(arma::uword nrows, arma::uword ncols);
63 void reset(
const DofVec &row_dofs,
const DofVec &col_dofs);
74 void set_solution(
unsigned int loc_dof,
double solution,
double diag=0.0);
107 void add_value(
unsigned int row,
unsigned int col,
108 double mat_val,
double rhs_val);
117 void add_value(
unsigned int row,
unsigned int col,
126 void add_value(
unsigned int row,
double rhs_val);
142 void set_size(
unsigned int nrows,
unsigned int ncols);
164 static constexpr
double almost_zero = std::numeric_limits<double>::min();
185 #endif // LOCAL_SYSTEM_HH_ void set_solution_col(uint loc_col, double solution)
const arma::mat & get_matrix()
const arma::vec & get_rhs()
void set_matrix(arma::mat matrix)
void set_sparsity(const arma::umat &sp)
Sets the sparsity pattern for the local system.
static constexpr double almost_zero
void set_size(unsigned int nrows, unsigned int ncols)
void set_solution(unsigned int loc_dof, double solution, double diag=0.0)
Set the position and value of known solution. E.g. Dirichlet boundary condition.
arma::Col< LongIdx > DofVec
arma::vec rhs
local system RHS
arma::mat sparsity
sparsity pattern
void reset()
Resets the matrix, RHS, dofs to zero and clears solution settings.
LocalSystem()
Default constructor.
arma::mat matrix
local system matrix
void set_solution_row(uint loc_row, double solution, double diag=0.0)
void set_rhs(arma::vec rhs)
void add_value(unsigned int row, unsigned int col, double mat_val, double rhs_val)
Adds a single entry into the local system.
void eliminate_solution()