27#include "neml2/tensors/BatchTensor.h"
28#include "neml2/base/OptionSet.h"
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Definition of a nonlinear system of equations.
Definition NonlinearSystem.h:37
static void disable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:54
BatchTensor _scaled_residual
Definition NonlinearSystem.h:110
BatchTensor _Jacobian
View for the Jacobian of this nonlinear system.
Definition NonlinearSystem.h:108
static void enable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:62
NonlinearSystem(const OptionSet &options)
Definition NonlinearSystem.cxx:69
virtual void set_solution(const BatchTensor &x)
Set the solution vector.
Definition NonlinearSystem.cxx:161
BatchTensor _col_scaling
Column scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
Definition NonlinearSystem.h:130
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:78
void residual_and_Jacobian()
Convenient shortcut to assemble and return the system residual and Jacobian.
Definition NonlinearSystem.cxx:209
void residual()
Convenient shortcut to assemble and return the system residual.
Definition NonlinearSystem.cxx:175
const BatchTensor & Jacobian_view() const
Definition NonlinearSystem.h:84
BatchTensor _solution
View for the solution of this nonlinear system.
Definition NonlinearSystem.h:102
BatchTensor scale_direction(const BatchTensor &p) const
Remove scaling from the search direction, i.e. .
Definition NonlinearSystem.cxx:151
TorchSize _ndof
Number of degrees of freedom.
Definition NonlinearSystem.h:99
BatchTensor _residual
View for the residual of this nonlinear system.
Definition NonlinearSystem.h:105
const bool _autoscale
If true, do automatic scaling.
Definition NonlinearSystem.h:115
BatchTensor scale_residual(const BatchTensor &r) const
Apply scaling to the residual.
Definition NonlinearSystem.cxx:130
const BatchTensor & residual_view() const
Definition NonlinearSystem.h:83
BatchTensor _row_scaling
Row scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
Definition NonlinearSystem.h:127
const unsigned int _autoscale_miter
Maximum number of iterations allowed for the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:121
BatchTensor _scaled_Jacobian
Definition NonlinearSystem.h:112
BatchTensor residual_norm() const
The residual norm.
Definition NonlinearSystem.cxx:221
void Jacobian()
Convenient shortcut to assemble and return the system Jacobian.
Definition NonlinearSystem.cxx:192
static OptionSet expected_options()
Definition NonlinearSystem.cxx:31
const Real _autoscale_tol
Tolerance for convergence check of the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:118
BatchTensor scale_Jacobian(const BatchTensor &J) const
Apply scaling to the Jacobian.
Definition NonlinearSystem.cxx:140
virtual BatchTensor solution() const
Get the solution vector.
Definition NonlinearSystem.h:66
bool _scaling_matrices_initialized
Flag to indicate whether scaling matrices have been computed.
Definition NonlinearSystem.h:124
virtual void assemble(bool residual, bool Jacobian)=0
Compute the residual and Jacobian.
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
Definition CrossRef.cxx:32
double Real
Definition types.h:33