20#ifdef DEAL_II_WITH_PETSC
29# define AssertPETSc(code) \
32 PetscErrorCode ierr = (code); \
33 AssertThrow(ierr == 0, ExcPETScError(ierr)); \
43 , solver_control(nullptr)
75 SolverBase::operator KSP()
const
160 "You need to create the solver with a SolverControl object if you want to call the function that returns it."));
167 const PetscInt iteration,
168 const PetscReal residual_norm,
169 KSPConvergedReason *reason,
170 void *solver_control_x)
172 PetscFunctionBeginUser;
181 case ::SolverControl::iterate:
182 *reason = KSP_CONVERGED_ITERATING;
185 case ::SolverControl::success:
186 *reason = KSP_CONVERGED_RTOL;
189 case ::SolverControl::failure:
191 *reason = KSP_DIVERGED_ITS;
193 *reason = KSP_DIVERGED_DTOL;
200 PetscFunctionReturn(PETSC_SUCCESS);
301 this->solver_control->max_steps() + 1));
310 , additional_data(
data)
337 , additional_data(
data)
364 , additional_data(
data)
390 const unsigned int restart_parameter,
391 const bool right_preconditioning)
392 : restart_parameter(restart_parameter)
393 , right_preconditioning(right_preconditioning)
435 , additional_data(
data)
462 , additional_data(
data)
489 , additional_data(
data)
516 , additional_data(
data)
543 , additional_data(
data)
570 , additional_data(
data)
606 , additional_data(
data)
644 , additional_data(
data)
645 , symmetric_mode(false)
688# ifdef DEAL_II_PETSC_WITH_MUMPS
727# if DEAL_II_PETSC_VERSION_LT(3, 9, 0)
728 AssertPETSc(PCFactorSetMatSolverPackage(pc, MATSOLVERMUMPS));
730 AssertPETSc(PCFactorSetMatSolverType(pc, MATSOLVERMUMPS));
736# if DEAL_II_PETSC_VERSION_LT(3, 9, 0)
799 "Your PETSc installation does not include a copy of "
800 "the MUMPS package necessary for this solver. You will need to configure "
801 "PETSc so that it includes MUMPS, recompile it, and then re-configure "
802 "and recompile deal.II as well."));
MPI_Comm get_mpi_communicator() const
MPI_Comm get_mpi_communicator() const
const PC & get_pc() const
SolverControl & control() const
ObserverPointer< SolverControl, SolverBase > solver_control
void initialize(const PreconditionBase &preconditioner)
void perhaps_set_convergence_test() const
static PetscErrorCode convergence_test(KSP ksp, const PetscInt iteration, const PetscReal residual_norm, KSPConvergedReason *reason, void *solver_control)
void set_prefix(const std::string &prefix)
void initialize_ksp_with_comm(const MPI_Comm comm)
void solve(const MatrixBase &A, VectorBase &x, const VectorBase &b, const PreconditionBase &preconditioner)
virtual void set_solver_type(KSP &ksp) const
SolverBiCG(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
virtual void set_solver_type(KSP &ksp) const override
SolverBicgstab(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
SolverCGS(SolverControl &cn, const AdditionalData &data=AdditionalData())
SolverCG(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
virtual void set_solver_type(KSP &ksp) const override
SolverCR(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
SolverChebychev(SolverControl &cn, const AdditionalData &data=AdditionalData())
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const override
SolverGMRES(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
SolverLSQR(SolverControl &cn, const AdditionalData &data=AdditionalData())
SolverPreOnly(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
virtual void set_solver_type(KSP &ksp) const override
const AdditionalData additional_data
SolverRichardson(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
SolverTCQMR(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const override
SolverTFQMR(SolverControl &cn, const AdditionalData &data=AdditionalData())
void solve(const MatrixBase &A, VectorBase &x, const VectorBase &b)
virtual void set_solver_type(KSP &ksp) const override
void set_symmetric_mode(const bool matrix_is_symmetric)
SparseDirectMUMPS(SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual State check(const unsigned int step, const double check_value)
@ success
Stop iteration, goal reached.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
#define DEAL_II_NOT_IMPLEMENTED()
std::vector< index_type > data
#define AssertPETSc(code)
AdditionalData(const unsigned int restart_parameter=30, const bool right_preconditioning=false)
bool right_preconditioning
unsigned int restart_parameter
AdditionalData(const double omega=1)