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
63 #ifdef LIBMESH_ENABLE_DEPRECATED 68 #if PETSC_RELEASE_LESS_THAN(3,5,0) 75 #
if PETSC_VERSION_LESS_THAN(3,3,0)
76 SNES, Vec x, Vec y, Vec w,
void * context,
PetscBool * changed_y,
PetscBool * changed_w
78 SNESLineSearch, Vec x, Vec y, Vec w,
PetscBool * changed_y,
PetscBool * changed_w,
void * context
115 virtual void clear ()
override;
121 virtual void init (
const char *
name =
nullptr)
override;
132 virtual std::pair<unsigned int, Real>
137 const unsigned int)
override;
254 #if !PETSC_VERSION_LESS_THAN(3,3,0) 264 #if PETSC_RELEASE_LESS_THAN(3,5,0) 276 #endif // #ifdef LIBMESH_HAVE_PETSC 277 #endif // LIBMESH_PETSC_NONLINEAR_SOLVER_H unsigned _current_nonlinear_iteration_number
std::string name(const ElemQuality q)
friend PetscErrorCode libmesh_petsc_snes_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)
PetscNonlinearSolver(sys_type &system)
void use_default_monitor(bool state)
PetscErrorCode __libmesh_petsc_snes_residual(SNES snes, Vec x, Vec r, void *ctx)
friend PetscErrorCode libmesh_petsc_snes_jacobian(SNES snes, Vec x, Mat *jac, Mat *pc, MatStructure *msflag, void *ctx)
PetscErrorCode __libmesh_petsc_snes_monitor(SNES, PetscInt its, PetscReal fnorm, void *)
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
virtual void clear() override
virtual int get_total_linear_iterations() override
PetscErrorCode libmesh_petsc_snes_monitor(SNES, PetscInt its, PetscReal fnorm, void *)
PetscErrorCode __libmesh_petsc_snes_mffd_interface(void *ctx, Vec x, Vec r)
PetscErrorCode libmesh_petsc_snes_mffd_residual(SNES snes, Vec x, Vec r, 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)
const sys_type & system() const
PetscErrorCode libmesh_petsc_snes_residual(SNES snes, Vec x, Vec r, void *ctx)
friend PetscErrorCode libmesh_petsc_snes_fd_residual(SNES snes, Vec x, Vec r, void *ctx)
PetscInt _n_linear_iterations
friend PetscErrorCode libmesh_petsc_snes_mffd_residual(SNES snes, Vec x, Vec r, void *ctx)
friend ResidualContext libmesh_petsc_snes_residual_helper(SNES snes, Vec x, void *ctx)
virtual ~ComputeLineSearchObject()
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
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)
virtual unsigned get_current_nonlinear_iteration_number() const override
PetscErrorCode libmesh_petsc_snes_fd_residual(SNES snes, Vec x, Vec r, void *ctx)
void set_residual_zero_out(bool state)
SNESConvergedReason _reason
void set_jacobian_zero_out(bool state)
PetscErrorCode libmesh_petsc_snes_mffd_interface(void *ctx, Vec x, Vec r)
virtual void linesearch(SNESLineSearch linesearch)=0
SNESConvergedReason get_converged_reason()
PetscErrorCode libmesh_petsc_linesearch_shellfunc(SNESLineSearch linesearch, void *ctx)
std::unique_ptr< ComputeLineSearchObject > linesearch_object
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)
virtual void print_converged_reason() override
void set_snesmf_reuse_base(bool state)
void build_mat_null_space(NonlinearImplicitSystem::ComputeVectorSubspace *computeSubspaceObject, void(*)(std::vector< NumericVector< Number > *> &, sys_type &), MatNullSpace *)
virtual void init(const char *name=nullptr) override
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &, NumericVector< T > &, NumericVector< T > &, const double, const unsigned int) override
NonlinearImplicitSystem sys_type
PetscErrorCode __libmesh_petsc_snes_fd_residual(SNES snes, Vec x, Vec r, void *ctx)