32 #ifndef LA_LINSYS_PETSC_HH_
33 #define LA_LINSYS_PETSC_HH_
76 return MatCopy(matrix,
matrix_, str);
82 return VecCopy(rhs,
rhs_);
94 return VecSet(
rhs_, 0);
103 void mat_set_values(
int nrow,
int *rows,
int ncol,
int *cols,
double *vals );
144 if ( array.size() )
return &(array[0]);
153 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.
static Input::Type::Record input_type
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
Vec on_vec_
Vectors for counting non-zero entries in diagonal block.
void preallocate_matrix()
double get_absolute_accuracy()
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.
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)
Mat matrix_
Petsc matrix of the problem.
bool init_guess_nonzero
flag for starting from nonzero guess
double solution_precision_