Flow123d
JS_before_hm-1804-gf2ad740aa
|
Go to the documentation of this file.
19 #ifndef LA_LINSYS_PETSC_HH_
20 #define LA_LINSYS_PETSC_HH_
28 #include "petscmath.h"
59 void set_tolerances(
double r_tol,
double a_tol,
unsigned int max_it)
override;
79 PetscErrorCode
set_matrix(Mat &matrix, MatStructure str)
override
82 return MatCopy(matrix,
matrix_, str);
88 return VecCopy(rhs,
rhs_);
101 return VecSet(
rhs_, 0);
110 void mat_set_values(
int nrow,
int *rows,
int ncol,
int *cols,
double *vals )
override;
112 void rhs_set_values(
int nrow,
int *rows,
double *vals )
override;
135 void view(
string text=
"")
override;
165 return static_cast<double>(
arg );
double get_absolute_accuracy() override
void start_insert_assembly() override
void set_initial_guess_nonzero(bool set_nonzero=true)
double operator()(PetscScalar arg)
std::string params_
command-line-like options for the PETSc solver
PetscErrorCode set_rhs(Vec &rhs) override
bool init_guess_nonzero
flag for starting from nonzero guess
PetscErrorCode rhs_zero_entries() override
LinSys_PETSC(const Distribution *rows_ds, const std::string ¶ms="")
void apply_constrains(double scalar=1.) override
KSPConvergedReason reason
Wrappers for linear systems based on MPIAIJ and MATIS format.
LinSys::SolveInfo solve() override
PetscErrorCode set_matrix(Mat &matrix, MatStructure str) override
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.
void mat_set_values(int nrow, int *rows, int ncol, int *cols, double *vals) override
const Vec * get_rhs() override
const Mat * get_matrix() override
double a_tol_
absolute tolerance of linear solver
double * v_rhs_
local RHS array pointing to Vec rhs_
void finish_assembly() override
double solution_precision_
bool rhs_changed_
true if the right hand side was changed since the last solve
double get_solution_precision() override
void rhs_set_values(int nrow, int *rows, double *vals) override
PetscErrorCode mat_zero_entries() override
Vec on_vec_
Vectors for counting non-zero entries in diagonal block.
void preallocate_matrix()
const Distribution * get_ds()
unsigned int size() const
const Distribution * rows_ds_
final distribution of rows of MH matrix
void preallocate_values(int nrow, int *rows, int ncol, int *cols)
internal::NamedArg< char > arg(StringRef name, const T &arg)
void start_add_assembly() override
void set_from_input(const Input::Record in_rec) override
ConstraintVec_ constraints_
bool matrix_changed_
true if the matrix was changed since the last solve
T * makePetscPointer_(std::vector< T > &array)
void start_allocation() override
Vec off_vec_
Vectors for counting non-zero entries in off-diagonal block.
void view(string text="") override
Vec rhs_
PETSc vector constructed with vx array.
double compute_residual() override
static const Input::Type::Record & get_input_type()