16#ifndef dealii_petsc_snes_h
17#define dealii_petsc_snes_h
21#ifdef DEAL_II_WITH_PETSC
30# include <petscsnes.h>
33# if defined(DEAL_II_HAVE_CXX20)
248 typename AMatrixType = PMatrixType>
251 std::constructible_from<
254 std::constructible_from<
257 std::constructible_from<AMatrixType, Mat>))
272 const MPI_Comm mpi_comm = PETSC_COMM_WORLD);
284 operator SNES()
const;
351 solve(VectorType &x, PMatrixType &P);
364 solve(VectorType &x, AMatrixType &A, PMatrixType &P);
374 std::function<void(
const VectorType &x, VectorType &res)>
residual;
385 std::function<void(
const VectorType &x, AMatrixType &A, PMatrixType &P)>
400 std::function<void(
const VectorType & x,
401 const unsigned int step_number,
431 std::function<void(
const VectorType &src, VectorType &dst)>
std::string options_prefix
int max_n_function_evaluations
void add_parameters(ParameterHandler &prm)
int maximum_non_linear_iterations
real_type absolute_tolerance
std::string snes_linesearch_type
real_type relative_tolerance
std::function< void(const VectorType &src, VectorType &dst)> solve_with_jacobian
void set_matrices(AMatrixType &A, PMatrixType &P)
std::function< void(const VectorType &x, real_type &energy_value)> energy
SmartPointer< PMatrixType, NonlinearSolver > P
unsigned int solve(VectorType &x, AMatrixType &A, PMatrixType &P)
std::function< void(const VectorType &x, VectorType &res)> residual
unsigned int solve(VectorType &x)
std::exception_ptr pending_exception
NonlinearSolver(const NonlinearSolverData &data=NonlinearSolverData(), const MPI_Comm mpi_comm=PETSC_COMM_WORLD)
MPI_Comm get_mpi_communicator() const
void set_matrix(PMatrixType &P)
std::function< void(const VectorType &x, const unsigned int step_number, const real_type f_norm)> monitor
unsigned int solve(VectorType &x, PMatrixType &P)
std::function< void(const VectorType &x, AMatrixType &A, PMatrixType &P)> jacobian
std::function< void(const VectorType &x)> setup_jacobian
SmartPointer< AMatrixType, NonlinearSolver > A
void reinit(const NonlinearSolverData &data)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
NonlinearSolverData(const std::string &options_prefix="", const std::string &snes_type="", const std::string &snes_linesearch_type="", const real_type absolute_tolerance=0, const real_type relative_tolerance=0, const real_type step_tolerance=0, const int maximum_non_linear_iterations=-1, const int max_n_function_evaluations=-1)