20#ifndef LIBMESH_NONLINEAR_IMPLICIT_SYSTEM_H
21#define LIBMESH_NONLINEAR_IMPLICIT_SYSTEM_H
24#include "libmesh/implicit_system.h"
34template<
typename T>
class NonlinearSolver;
62 const std::string &
name,
63 const unsigned int number);
210 bool & changed_search_direction,
211 bool & changed_new_soln,
251 virtual void clear ()
override;
257 virtual void reinit ()
override;
262 virtual void solve ()
override;
269 virtual std::pair<unsigned int, Real>
276 virtual void assembly(
bool get_residual,
278 bool apply_heterogeneous_constraints =
false,
279 bool apply_no_constraints =
false)
override;
285 virtual std::string
system_type ()
const override {
return "NonlinearImplicit"; }
This is the EquationSystems class.
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...
Abstract base class to be used to calculate the bounds on the degrees of freedom of a nonlinear syste...
virtual void bounds(NumericVector< Number > &XL, NumericVector< Number > &XU, sys_type &S)=0
This function will be called to compute the bounds vector and must be implemented by the user in a de...
virtual ~ComputeBounds()=default
Abstract base class to be used to calculate the Jacobian of a nonlinear system.
virtual void jacobian(const NumericVector< Number > &X, SparseMatrix< Number > &J, sys_type &S)=0
Jacobian function.
virtual ~ComputeJacobian()=default
Abstract base class to be used for applying user modifications to the solution vector and/or Newton u...
virtual void postcheck(const NumericVector< Number > &old_soln, NumericVector< Number > &search_direction, NumericVector< Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln, sys_type &S)=0
This interface, which is inspired by PETSc's, passes the user: .) A constant reference to the "old" s...
virtual ~ComputePostCheck()=default
Abstract base class to be used for applying user modifications to the Newton search direction \emph b...
virtual ~ComputePreCheck()=default
virtual void precheck(const NumericVector< Number > &precheck_soln, NumericVector< Number > &search_direction, bool &changed, sys_type &S)=0
Abstract precheck method that users must override.
Abstract base class to be used to calculate the residual of a nonlinear system.
virtual void residual(const NumericVector< Number > &X, NumericVector< Number > &R, sys_type &S)=0
Residual function.
virtual ~ComputeResidual()=default
Abstract base class to be used to calculate the residual and Jacobian simultaneously of a nonlinear s...
virtual ~ComputeResidualandJacobian()=default
virtual void residual_and_jacobian(const NumericVector< Number > &X, NumericVector< Number > *R, SparseMatrix< Number > *J, sys_type &S)=0
Residual & Jacobian function, calculated simultaneously.
Callable abstract base class to be used as a callback to provide the solver with a basis for the syst...
virtual ~ComputeVectorSubspace()=default
virtual void operator()(std::vector< NumericVector< Number > * > &sp, sys_type &s)=0
This function will be called to compute the subspace basis (e.g., nullspace or nearnullspace).
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
NonlinearImplicitSystem(const NonlinearImplicitSystem &)=delete
Special functions.
NonlinearImplicitSystem sys_type
The type of system.
void set_solver_parameters()
Copies system parameters into nonlinear solver parameters.
virtual void solve() override
Assembles & solves the nonlinear system R(x) = 0.
virtual std::pair< unsigned int, Real > get_linear_solve_parameters() const override
virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
unsigned get_current_nonlinear_iteration_number() const
If called during the solve(), for example by the user-specified residual or Jacobian function,...
virtual std::string system_type() const override
unsigned int _n_nonlinear_iterations
The number of nonlinear iterations required to solve the nonlinear system R(x)=0.
virtual void assembly(bool get_residual, bool get_jacobian, bool apply_heterogeneous_constraints=false, bool apply_no_constraints=false) override
Assembles a residual in rhs and/or a jacobian in matrix, as requested.
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
The NonlinearSolver defines the default interface used to solve the nonlinear_implicit system.
virtual ~NonlinearImplicitSystem()
Real final_nonlinear_residual() const
unsigned int n_nonlinear_iterations() const
NonlinearImplicitSystem(NonlinearImplicitSystem &&)=default
std::unique_ptr< DiffSolver > diff_solver
The DiffSolver defines an optional interface used to solve the nonlinear_implicit system.
NonlinearImplicitSystem & operator=(const NonlinearImplicitSystem &)=delete
Real _final_nonlinear_residual
The final residual for the nonlinear system R(x)
ImplicitSystem Parent
The type of the parent.
virtual void create_static_condensation() override
Request that static condensation be performed for this system.
virtual void clear() override
Clear all the data structures associated with the system.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
const std::string & name() const
unsigned int number() const
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real