20 #ifndef LIBMESH_PETSC_LINEAR_SOLVER_H 21 #define LIBMESH_PETSC_LINEAR_SOLVER_H 25 #ifdef LIBMESH_HAVE_PETSC 48 #if PETSC_RELEASE_LESS_THAN(3,0,1) 65 #if LIBMESH_ENABLE_DEPRECATED 66 #if PETSC_RELEASE_LESS_THAN(3,0,1) 100 template <
typename T>
117 virtual void clear ()
override;
124 virtual void init (
const char *
name =
nullptr)
override;
130 const char *
name =
nullptr);
156 virtual std::pair<unsigned int, Real>
161 const unsigned int m_its)
override 163 return this->
solve(matrix_in, matrix_in, solution_in, rhs_in, tol, m_its);
171 virtual std::pair<unsigned int, Real>
176 const unsigned int m_its)
override;
194 virtual std::pair<unsigned int, Real>
200 const unsigned int m_its)
override;
205 virtual std::pair<unsigned int, Real>
210 const unsigned int m_its)
override;
217 virtual std::pair<unsigned int, Real>
223 const unsigned int m_its)
override;
329 template <
typename T>
338 template <
typename T>
342 libmesh_assert(_restrict_solve_to_is);
345 int ierr = ISGetLocalSize(_restrict_solve_to_is, &s);
346 LIBMESH_CHKERR(
ierr);
353 template <
typename T>
356 #
if PETSC_VERSION_LESS_THAN(3,0,0)
363 libmesh_assert(_restrict_solve_to_is);
364 #if PETSC_VERSION_LESS_THAN(3,0,0) 366 libmesh_not_implemented();
368 if (_restrict_solve_to_is_complement==
nullptr)
370 int ierr = ISComplement(_restrict_solve_to_is,
371 vec_in.first_local_index(),
372 vec_in.last_local_index(),
373 &_restrict_solve_to_is_complement);
374 LIBMESH_CHKERR(
ierr);
384 #endif // #ifdef LIBMESH_HAVE_PETSC 385 #endif // LIBMESH_PETSC_LINEAR_SOLVER_H std::string name(const ElemQuality q)
void get_residual_history(std::vector< double > &hist)
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &matrix_in, NumericVector< T > &solution_in, NumericVector< T > &rhs_in, const double tol, const unsigned int m_its) override
virtual void init(const char *name=nullptr) override
void _create_complement_is(const NumericVector< T > &vec_in)
static PetscErrorCode _petsc_shell_matrix_mult_add(Mat mat, Vec arg, Vec add, Vec dest)
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
PetscErrorCode __libmesh_petsc_preconditioner_apply(void *ctx, Vec x, Vec y)
PetscLinearSolver(const libMesh::Parallel::Communicator &comm_in)
Manages consistently variables, degrees of freedom, and coefficient vectors.
void set_petsc_solver_type()
PetscErrorCode __libmesh_petsc_preconditioner_setup(void *ctx)
virtual void restrict_solve_to(const std::vector< unsigned int > *const dofs, const SubsetSolveMode subset_solve_mode=SUBSET_ZERO) override
virtual std::pair< unsigned int, Real > adjoint_solve(SparseMatrix< T > &matrix_in, NumericVector< T > &solution_in, NumericVector< T > &rhs_in, const double tol, const unsigned int m_its) override
virtual void init_names(const System &) override
PetscErrorCode libmesh_petsc_preconditioner_apply(void *ctx, Vec x, Vec y)
static PetscErrorCode _petsc_shell_matrix_mult(Mat mat, Vec arg, Vec dest)
IS _restrict_solve_to_is_complement
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real get_initial_residual()
PetscErrorCode libmesh_petsc_preconditioner_setup(void *ctx)
SparseMatrix interface to PETSc Mat.
PetscInt _restrict_solve_to_is_local_size() const
SubsetSolveMode _subset_solve_mode
virtual LinearConvergenceReason get_converged_reason() const override
static PetscErrorCode _petsc_shell_matrix_get_diagonal(Mat mat, Vec dest)
virtual void clear() override