19 #ifndef LA_LINSYS_PETSC_HH_ 20 #define LA_LINSYS_PETSC_HH_ 47 void set_tolerances(
double r_tol,
double a_tol,
unsigned int max_it)
override;
70 return MatCopy(matrix,
matrix_, str);
76 return VecCopy(rhs,
rhs_);
88 return VecSet(
rhs_, 0);
97 void mat_set_values(
int nrow,
int *rows,
int ncol,
int *cols,
double *vals );
143 if ( array.size() )
return &(array[0]);
152 return static_cast<double>(
arg );
const Distribution * get_ds()
PetscErrorCode set_rhs(Vec &rhs)
void start_insert_assembly()
void apply_constrains(double scalar=1.)
PetscErrorCode rhs_zero_entries()
bool matrix_changed_
true if the matrix was changed since the last solve
double * v_rhs_
local RHS array pointing to Vec rhs_
Wrappers for linear systems based on MPIAIJ and MATIS format.
LinSys_PETSC(const Distribution *rows_ds)
PetscErrorCode set_matrix(Mat &matrix, MatStructure str)
Vec rhs_
PETSc vector constructed with vx array.
void set_from_input(const Input::Record in_rec)
double operator()(PetscScalar arg)
void preallocate_values(int nrow, int *rows, int ncol, int *cols)
void rhs_set_values(int nrow, int *rows, double *vals)
bool rhs_changed_
true if the right hand side was changed since the last solve
PetscErrorCode mat_zero_entries()
T * makePetscPointer_(std::vector< T > &array)
const Distribution * rows_ds_
final distribution of rows of MH matrix
double a_tol_
absolute tolerance of linear solver
Vec on_vec_
Vectors for counting non-zero entries in diagonal block.
void preallocate_matrix()
double get_absolute_accuracy()
double compute_residual() override
std::string params_
command-line-like options for the PETSc solver
void mat_set_values(int nrow, int *rows, int ncol, int *cols, double *vals)
void start_add_assembly()
Support classes for parallel programing.
KSPConvergedReason reason
internal::NamedArg< char > arg(StringRef name, const T &arg)
Vec off_vec_
Vectors for counting non-zero entries in off-diagonal block.
double get_solution_precision()
Abstract linear system class.
void set_initial_guess_nonzero(bool set_nonzero=true)
static const Input::Type::Record & get_input_type()
void set_tolerances(double r_tol, double a_tol, unsigned int max_it) override
Mat matrix_
Petsc matrix of the problem.
static const int registrar
Registrar of class to factory.
bool init_guess_nonzero
flag for starting from nonzero guess
double solution_precision_