27#include "neml2/tensors/Tensor.h"
28#include "neml2/base/OptionSet.h"
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:56
Definition of a nonlinear system of equations.
Definition NonlinearSystem.h:37
Tensor _row_scaling
Row scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
Definition NonlinearSystem.h:132
static void disable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:54
virtual void set_solution(const Tensor &x)
Set the solution vector.
Definition NonlinearSystem.cxx:160
Tensor _scaled_Jacobian
Definition NonlinearSystem.h:117
Tensor _residual
View for the residual of this nonlinear system.
Definition NonlinearSystem.h:110
static void enable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:62
virtual bool is_AD_disabled() const final
Whether AD is disabled.
Definition NonlinearSystem.h:92
NonlinearSystem(const OptionSet &options)
Definition NonlinearSystem.cxx:69
virtual bool is_AD_enabled() const
Whether AD is enabled.
Definition NonlinearSystem.h:90
virtual void init_scaling(const bool verbose=false)
Compute algebraic Jacobian-based automatic scaling following https://cs.stanford.edu/people/paulliu/f...
Definition NonlinearSystem.cxx:79
void residual_and_Jacobian()
Convenient shortcut to assemble and return the system residual and Jacobian.
Definition NonlinearSystem.cxx:206
Tensor _scaled_residual
Definition NonlinearSystem.h:115
const Tensor & get_residual() const
Definition NonlinearSystem.h:83
Tensor scale_Jacobian(const Tensor &J) const
Apply scaling to the Jacobian.
Definition NonlinearSystem.cxx:139
void residual()
Convenient shortcut to assemble and return the system residual.
Definition NonlinearSystem.cxx:174
Tensor scale_residual(const Tensor &r) const
Apply scaling to the residual.
Definition NonlinearSystem.cxx:129
Size _ndof
Number of degrees of freedom.
Definition NonlinearSystem.h:104
Tensor _col_scaling
Column scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
Definition NonlinearSystem.h:135
Tensor _solution
View for the solution of this nonlinear system.
Definition NonlinearSystem.h:107
const bool _autoscale
If true, do automatic scaling.
Definition NonlinearSystem.h:120
const unsigned int _autoscale_miter
Maximum number of iterations allowed for the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:126
void Jacobian()
Convenient shortcut to assemble and return the system Jacobian.
Definition NonlinearSystem.cxx:190
static OptionSet expected_options()
Definition NonlinearSystem.cxx:31
Tensor scale_direction(const Tensor &p) const
Remove scaling from the search direction, i.e. .
Definition NonlinearSystem.cxx:150
const Tensor & get_Jacobian() const
Definition NonlinearSystem.h:84
Tensor _Jacobian
View for the Jacobian of this nonlinear system.
Definition NonlinearSystem.h:113
const Real _autoscale_tol
Tolerance for convergence check of the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:123
Tensor residual_norm() const
The residual norm.
Definition NonlinearSystem.cxx:215
bool _scaling_matrices_initialized
Flag to indicate whether scaling matrices have been computed.
Definition NonlinearSystem.h:129
virtual void assemble(bool residual, bool Jacobian)=0
Compute the residual and Jacobian.
virtual Tensor solution() const
Get the solution vector.
Definition NonlinearSystem.h:66
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:100
Definition CrossRef.cxx:30
double Real
Definition types.h:31