20 #ifndef LIBMESH_NONLINEAR_SOLVER_H 21 #define LIBMESH_NONLINEAR_SOLVER_H 31 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS 48 template <
typename T>
class SparseMatrix;
49 template <
typename T>
class NumericVector;
50 template <
typename T>
class Preconditioner;
51 class SolverConfiguration;
61 class NonlinearSolver :
public ReferenceCountedObject<NonlinearSolver<T>>,
85 static std::unique_ptr<NonlinearSolver<T>>
build(
sys_type & s,
103 virtual void init (
const char *
name =
nullptr) = 0;
112 const unsigned int) = 0;
266 bool & changed_search_direction,
267 bool & changed_new_soln,
384 template <
typename T>
389 residual_object (nullptr),
390 fd_residual_object (nullptr),
391 mffd_residual_object (nullptr),
393 jacobian_object (nullptr),
395 residual_and_jacobian_object (nullptr),
397 bounds_object (nullptr),
399 nullspace_object (nullptr),
400 transpose_nullspace (nullptr),
401 transpose_nullspace_object (nullptr),
402 nearnullspace (nullptr),
403 nearnullspace_object (nullptr),
404 user_presolve (nullptr),
406 postcheck_object (nullptr),
407 max_nonlinear_iterations(0),
408 max_function_evaluations(0),
409 absolute_residual_tolerance(0),
410 relative_residual_tolerance(0),
411 absolute_step_tolerance(0),
412 relative_step_tolerance(0),
413 max_linear_iterations(0),
414 initial_linear_tolerance(0),
415 minimum_linear_tolerance(0),
419 _preconditioner (nullptr),
420 _solver_configuration(nullptr)
426 template <
typename T>
437 #endif // LIBMESH_NONLINEAR_SOLVER_H std::string name(const ElemQuality q)
virtual void init(const char *name=nullptr)=0
void(* residual)(const NumericVector< Number > &X, NumericVector< Number > &R, sys_type &S)
NonlinearImplicitSystem::ComputeResidualandJacobian * residual_and_jacobian_object
unsigned int max_function_evaluations
Preconditioner< T > * _preconditioner
void(* user_presolve)(sys_type &S)
void attach_preconditioner(Preconditioner< T > *preconditioner)
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
unsigned int max_linear_iterations
SolverConfiguration * _solver_configuration
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &, NumericVector< T > &, NumericVector< T > &, const double, const unsigned int)=0
NonlinearImplicitSystem::ComputeResidual * residual_object
void(* jacobian)(const NumericVector< Number > &X, SparseMatrix< Number > &J, sys_type &S)
Real relative_residual_tolerance
Real absolute_step_tolerance
SolverPackage default_solver_package()
const sys_type & system() const
NonlinearImplicitSystem::ComputeJacobian * jacobian_object
void set_solver_configuration(SolverConfiguration &solver_configuration)
virtual int get_total_linear_iterations()=0
NonlinearImplicitSystem::ComputeBounds * bounds_object
virtual ~NonlinearSolver()
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
void(* transpose_nullspace)(std::vector< NumericVector< Number > *> &sp, sys_type &S)
virtual unsigned get_current_nonlinear_iteration_number() const =0
Real minimum_linear_tolerance
void(* nullspace)(std::vector< NumericVector< Number > *> &sp, sys_type &S)
An object whose state is distributed along a set of processors.
void(* nearnullspace)(std::vector< NumericVector< Number > *> &sp, sys_type &S)
Real absolute_residual_tolerance
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
NonlinearImplicitSystem::ComputePostCheck * postcheck_object
virtual void print_converged_reason()
static std::unique_ptr< NonlinearSolver< T > > build(sys_type &s, const SolverPackage solver_package=libMesh::default_solver_package())
NonlinearSolver(sys_type &s)
void(* bounds)(NumericVector< Number > &XL, NumericVector< Number > &XU, sys_type &S)
NonlinearImplicitSystem::ComputeResidual * mffd_residual_object
Real relative_step_tolerance
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)
NonlinearImplicitSystem::ComputeVectorSubspace * nearnullspace_object
Real initial_linear_tolerance
NonlinearImplicitSystem sys_type
unsigned int max_nonlinear_iterations
NonlinearImplicitSystem::ComputeVectorSubspace * transpose_nullspace_object
void(* matvec)(const NumericVector< Number > &X, NumericVector< Number > *R, SparseMatrix< Number > *J, sys_type &S)
NonlinearImplicitSystem::ComputeResidual * fd_residual_object
NonlinearImplicitSystem::ComputeVectorSubspace * nullspace_object