20 #ifndef LIBMESH_PETSC_NONLINEAR_SOLVER_H 21 #define LIBMESH_PETSC_NONLINEAR_SOLVER_H 26 #ifdef LIBMESH_HAVE_PETSC 33 # include <petscsnes.h> 37 class ResidualContext;
48 #if PETSC_RELEASE_LESS_THAN(3,5,0) 55 #
if PETSC_VERSION_LESS_THAN(3,3,0)
56 SNES, Vec x, Vec y, Vec w,
void * context,
PetscBool * changed_y,
PetscBool * changed_w
58 SNESLineSearch, Vec x, Vec y, Vec w,
PetscBool * changed_y,
PetscBool * changed_w,
void * context
94 virtual void clear () libmesh_override;
111 virtual std::pair<unsigned int, Real>
116 const unsigned int) libmesh_override;
205 #if !PETSC_VERSION_LESS_THAN(3,3,0) 216 #if PETSC_RELEASE_LESS_THAN(3,5,0) 228 #endif // #ifdef LIBMESH_HAVE_PETSC 229 #endif // LIBMESH_PETSC_NONLINEAR_SOLVER_H unsigned _current_nonlinear_iteration_number
std::string name(const ElemQuality q)
virtual void clear() libmesh_override
PetscErrorCode __libmesh_petsc_snes_mffd_residual(SNES snes, Vec x, Vec r, void *ctx)
friend PetscErrorCode __libmesh_petsc_snes_mffd_interface(void *ctx, Vec x, Vec r)
PetscNonlinearSolver(sys_type &system)
void use_default_monitor(bool state)
PetscErrorCode __libmesh_petsc_snes_residual(SNES snes, Vec x, Vec r, void *ctx)
PetscErrorCode __libmesh_petsc_snes_monitor(SNES, PetscInt its, PetscReal fnorm, void *)
const class libmesh_nullptr_t libmesh_nullptr
friend PetscErrorCode __libmesh_petsc_snes_mffd_residual(SNES snes, Vec x, Vec r, void *ctx)
PetscErrorCode __libmesh_petsc_snes_postcheck(#if PETSC_VERSION_LESS_THAN(3, 3, 0) SNES, Vec x, Vec y, Vec w, void *context, PetscBool *changed_y, PetscBool *changed_w#else SNESLineSearch, Vec x, Vec y, Vec w, PetscBool *changed_y, PetscBool *changed_w, void *context#endif)
PetscErrorCode __libmesh_petsc_snes_mffd_interface(void *ctx, Vec x, Vec r)
PetscInt _n_linear_iterations
friend ResidualContext libmesh_petsc_snes_residual_helper(SNES snes, Vec x, void *ctx)
PetscErrorCode __libmesh_petsc_snes_jacobian(#if PETSC_RELEASE_LESS_THAN(3, 5, 0) SNES snes, Vec x, Mat *jac, Mat *pc, MatStructure *msflag, void *ctx#else SNES snes, Vec x, Mat jac, Mat pc, void *ctx#endif)
Used for solving nonlinear implicit systems of equations.
virtual void init(const char *name=libmesh_nullptr) libmesh_override
friend PetscErrorCode __libmesh_petsc_snes_residual(SNES snes, Vec x, Vec r, void *ctx)
void build_mat_null_space(NonlinearImplicitSystem::ComputeVectorSubspace *computeSubspaceObject, void(*)(std::vector< NumericVector< Number > * > &, sys_type &), MatNullSpace *)
void set_residual_zero_out(bool state)
SNESConvergedReason _reason
void set_jacobian_zero_out(bool state)
SNESConvergedReason get_converged_reason()
friend PetscErrorCode __libmesh_petsc_snes_jacobian(SNES snes, Vec x, Mat *jac, Mat *pc, MatStructure *msflag, void *ctx)
const sys_type & system() const
virtual void print_converged_reason() libmesh_override
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &, NumericVector< T > &, NumericVector< T > &, const double, const unsigned int) libmesh_override
friend PetscErrorCode __libmesh_petsc_snes_fd_residual(SNES snes, Vec x, Vec r, void *ctx)
virtual unsigned get_current_nonlinear_iteration_number() const libmesh_override
virtual int get_total_linear_iterations() libmesh_override
NonlinearImplicitSystem sys_type
PetscErrorCode __libmesh_petsc_snes_fd_residual(SNES snes, Vec x, Vec r, void *ctx)