16 #ifndef dealii_petsc_solver_h 17 #define dealii_petsc_solver_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_PETSC 24 # include <deal.II/lac/exceptions.h> 25 # include <deal.II/lac/solver_control.h> 27 # include <petscksp.h> 31 #ifdef DEAL_II_WITH_SLEPC 32 #include <deal.II/lac/slepc_spectral_transformation.h> 35 DEAL_II_NAMESPACE_OPEN
37 #ifdef DEAL_II_WITH_SLEPC 50 class PreconditionerBase;
145 virtual void reset();
204 const PetscInt iteration,
205 const PetscReal residual_norm,
206 KSPConvergedReason *reason,
245 #ifdef DEAL_II_WITH_SLEPC 966 const PetscInt iteration,
967 const PetscReal residual_norm,
968 KSPConvergedReason *reason,
987 std::unique_ptr<SolverDataMUMPS> solver_data;
997 DEAL_II_NAMESPACE_CLOSE
999 #endif // DEAL_II_WITH_PETSC void solve(const MatrixBase &A, VectorBase &x, const VectorBase &b, const PreconditionerBase &preconditioner)
virtual void set_solver_type(KSP &ksp) const =0
const AdditionalData additional_data
const AdditionalData additional_data
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const
const AdditionalData additional_data
AdditionalData(const unsigned int restart_parameter=30, const bool right_preconditioning=false)
SolverRichardson(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const
SparseDirectMUMPS(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
void set_prefix(const std::string &prefix)
const MPI_Comm mpi_communicator
std::unique_ptr< SolverData > solver_data
bool right_preconditioning
SolverBase(SolverControl &cn, const MPI_Comm &mpi_communicator)
static PetscErrorCode convergence_test(KSP ksp, const PetscInt iteration, const PetscReal residual_norm, KSPConvergedReason *reason, void *solver_control)
virtual void set_solver_type(KSP &ksp) const
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const
virtual void set_solver_type(KSP &ksp) const
AdditionalData(const double omega=1)
SolverCR(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverControl & solver_control
const AdditionalData additional_data
SolverBiCG(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverLSQR(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverChebychev(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverCGS(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
virtual void set_solver_type(KSP &ksp) const
const AdditionalData additional_data
void initialize(const PreconditionerBase &preconditioner)
virtual ~SolverBase()=default
SolverBicgstab(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
const AdditionalData additional_data
void solve(const MatrixBase &A, VectorBase &x, const VectorBase &b)
virtual void set_solver_type(KSP &ksp) const
virtual void set_solver_type(KSP &ksp) const
SolverTCQMR(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverControl & control() const
virtual void set_solver_type(KSP &ksp) const
const AdditionalData additional_data
SolverTFQMR(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
void set_symmetric_mode(const bool flag)
virtual void set_solver_type(KSP &ksp) const
virtual void set_solver_type(KSP &ksp) const
static PetscErrorCode convergence_test(KSP ksp, const PetscInt iteration, const PetscReal residual_norm, KSPConvergedReason *reason, void *solver_control)
SolverCG(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
SolverPreOnly(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
const AdditionalData additional_data
SolverGMRES(SolverControl &cn, const MPI_Comm &mpi_communicator=PETSC_COMM_SELF, const AdditionalData &data=AdditionalData())
unsigned int restart_parameter
const AdditionalData additional_data
virtual void set_solver_type(KSP &ksp) const