20 #ifndef LIBMESH_NONLINEAR_IMPLICIT_SYSTEM_H 21 #define LIBMESH_NONLINEAR_IMPLICIT_SYSTEM_H 24 #include "libmesh/implicit_system.h" 34 template<
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"; }
341 #endif // LIBMESH_NONLINEAR_IMPLICIT_SYSTEM_H void set_solver_parameters()
Copies system parameters into nonlinear solver parameters.
This is the EquationSystems class.
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
The NonlinearSolver defines the default interface used to solve the nonlinear_implicit system...
virtual ~ComputePostCheck()=default
virtual ~ComputePreCheck()=default
virtual void residual(const NumericVector< Number > &X, NumericVector< Number > &R, sys_type &S)=0
Residual function.
virtual ~ComputeVectorSubspace()=default
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 ~ComputeJacobian()=default
NonlinearImplicitSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
unsigned int n_nonlinear_iterations() const
NonlinearImplicitSystem & operator=(const NonlinearImplicitSystem &)=delete
virtual void clear() override
Clear all the data structures associated with the system.
The libMesh namespace provides an interface to certain functionality in the library.
Abstract base class to be used to calculate the bounds on the degrees of freedom of a nonlinear syste...
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...
Abstract base class to be used to calculate the residual of a nonlinear system.
unsigned int number() const
Real final_nonlinear_residual() const
Abstract base class to be used to calculate the Jacobian of a nonlinear system.
unsigned int _n_nonlinear_iterations
The number of nonlinear iterations required to solve the nonlinear system R(x)=0. ...
virtual ~ComputeBounds()=default
ImplicitSystem Parent
The type of the parent.
virtual ~NonlinearImplicitSystem()
virtual void jacobian(const NumericVector< Number > &X, SparseMatrix< Number > &J, sys_type &S)=0
Jacobian function.
Real _final_nonlinear_residual
The final residual for the nonlinear system R(x)
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
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).
std::unique_ptr< DiffSolver > diff_solver
The DiffSolver defines an optional interface used to solve the nonlinear_implicit system...
NonlinearImplicitSystem sys_type
The type of system.
Abstract base class to be used to calculate the residual and Jacobian simultaneously of a nonlinear s...
unsigned get_current_nonlinear_iteration_number() const
If called during the solve(), for example by the user-specified residual or Jacobian function...
virtual void solve() override
Assembles & solves the nonlinear system R(x) = 0.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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.
virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
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.
virtual std::string system_type() const override
const std::string & name() const
virtual ~ComputeResidualandJacobian()=default
Abstract base class to be used for applying user modifications to the solution vector and/or Newton u...
virtual void residual_and_jacobian(const NumericVector< Number > &X, NumericVector< Number > *R, SparseMatrix< Number > *J, sys_type &S)=0
Residual & Jacobian function, calculated simultaneously.
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
virtual ~ComputeResidual()=default
Abstract base class to be used for applying user modifications to the Newton search direction before...
Callable abstract base class to be used as a callback to provide the solver with a basis for the syst...
virtual std::pair< unsigned int, Real > get_linear_solve_parameters() const override
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...