20 #ifndef LIBMESH_DIFF_SOLVER_H 21 #define LIBMESH_DIFF_SOLVER_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/reference_counted_object.h" 26 #include "libmesh/parallel_object.h" 37 template <
typename T>
class NumericVector;
46 const Real & norm_delta_u,
50 const Real & norm_res,
51 const unsigned int iteration) = 0;
100 virtual void init ();
113 virtual unsigned int solve () = 0;
361 #endif // LIBMESH_DIFF_SOLVER_H bool continue_after_max_iterations
Defaults to true, telling the DiffSolver to continue rather than exit when a solve has reached its ma...
bool exact_constraint_enforcement()
Real absolute_step_tolerance
The DiffSolver should exit after the full nonlinear step norm is reduced to either less than absolute...
bool quiet
The DiffSolver should not print anything to libMesh::out unless quiet is set to false; default is tru...
unsigned int solve_result()
Functor for use as callback in solve of nonlinear solver.
unsigned int max_nonlinear_iterations
The DiffSolver should exit in failure if max_nonlinear_iterations is exceeded and continue_after_max_...
Real absolute_residual_tolerance
The DiffSolver should exit after the residual is reduced to either less than absolute_residual_tolera...
Real max_solution_norm
The largest solution norm which the DiffSolver has yet seen will be stored here, to be used for stopp...
Real max_residual_norm
The largest nonlinear residual which the DiffSolver has yet seen will be stored here, to be used for stopping criteria based on relative_residual_tolerance.
bool _exact_constraint_enforcement
Whether we should enforce exact constraints globally during a solve.
The DiffSolver achieved the desired absolute step size tolerance.
ImplicitSystem sys_type
The type of system.
virtual void reinit()
The reinitialization function.
virtual void operator()(const NumericVector< Number > &delta_u, const Real &norm_delta_u, const NumericVector< Number > &u, const Real &norm_u, const NumericVector< Number > &res, const Real &norm_res, const unsigned int iteration)=0
The libMesh namespace provides an interface to certain functionality in the library.
static std::unique_ptr< DiffSolver > build(sys_type &s)
Factory method.
The linear solver used by the DiffSolver failed to find a solution.
virtual ~DiffSolver()=default
Destructor.
unsigned int _solve_result
Initialized to zero.
unsigned int _inner_iterations
The number of inner iterations used by the last solve.
unsigned int total_outer_iterations()
virtual void init()
The initialization function.
This is a generic class that defines a solver to handle ImplicitSystem classes, including NonlinearIm...
The DiffSolver reached the maximum allowed number of nonlinear iterations before satisfying any conve...
The DiffSolver achieved the desired relative step size tolerance.
sys_type & _system
A reference to the system we are solving.
unsigned int max_linear_iterations
Each linear solver step should exit after max_linear_iterations is exceeded.
virtual unsigned int solve()=0
This method performs a solve.
The DiffSolver achieved the desired relative residual tolerance.
const sys_type & system() const
virtual void set_exact_constraint_enforcement(bool enable)
Enable (or disable; it is true by default) exact enforcement of constraints at the solver level...
This class implements reference counting.
An object whose state is distributed along a set of processors.
double minimum_linear_tolerance
The tolerance for linear solves is kept above this minimum.
bool verbose
The DiffSolver may print a lot more to libMesh::out if verbose is set to true; default is false...
The solver converged but no particular reason is specified.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool continue_after_backtrack_failure
Defaults to false, telling the DiffSolver to throw an error when the backtracking scheme fails to fin...
The DiffSolver achieved the desired absolute residual tolerance.
SolveResult
Enumeration return type for the solve() function.
unsigned int _outer_iterations
The number of outer iterations used by the last solve.
virtual ~LinearSolutionMonitor()=default
The DiffSolver failed to find a descent direction by backtracking (See newton_solver.C)
The DiffSolver diverged but no particular reason is specified.
A default or invalid solve result.
double initial_linear_tolerance
Any required linear solves will at first be done with this tolerance; the DiffSolver may tighten the ...
DiffSolver(sys_type &s)
Constructor.
unsigned int total_inner_iterations()
Real relative_residual_tolerance
Real relative_step_tolerance
std::unique_ptr< LinearSolutionMonitor > linear_solution_monitor
Pointer to functor which is called right after each linear solve.
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...