21#ifdef DEAL_II_WITH_PETSC
30# define AssertPETSc(code) \
33 PetscErrorCode ierr = (code); \
34 AssertThrow(ierr == 0, ExcPETScError(ierr)); \
44 , solver_control(nullptr)
76 SolverBase::operator KSP()
const
161 "You need to create the solver with a SolverControl object if you want to call the function that returns it."));
168 const PetscInt iteration,
169 const PetscReal residual_norm,
170 KSPConvergedReason *reason,
171 void * solver_control_x)
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;
302 this->solver_control->max_steps() + 1));
311 , additional_data(data)
338 , additional_data(data)
365 , additional_data(data)
391 const unsigned int restart_parameter,
392 const bool right_preconditioning)
393 : restart_parameter(restart_parameter)
394 , right_preconditioning(right_preconditioning)
436 , additional_data(data)
463 , additional_data(data)
490 , additional_data(data)
517 , additional_data(data)
544 , additional_data(data)
571 , additional_data(data)
607 , additional_data(data)
645 , additional_data(data)
646 , symmetric_mode(false)
689# ifdef DEAL_II_PETSC_WITH_MUMPS
728# if DEAL_II_PETSC_VERSION_LT(3, 9, 0)
729 AssertPETSc(PCFactorSetMatSolverPackage(pc, MATSOLVERMUMPS));
731 AssertPETSc(PCFactorSetMatSolverType(pc, MATSOLVERMUMPS));
737# if DEAL_II_PETSC_VERSION_LT(3, 9, 0)
800 "Your PETSc installation does not include a copy of "
801 "the MUMPS package necessary for this solver. You will need to configure "
802 "PETSc so that it includes MUMPS, recompile it, and then re-configure "
803 "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
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)
SmartPointer< SolverControl, SolverBase > 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 flag)
SparseDirectMUMPS(SolverControl &cn, const AdditionalData &data=AdditionalData())
@ success
Stop iteration, goal reached.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
#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)