27#include "neml2/tensors/Tensor.h"
28#include "neml2/base/OptionSet.h"
43 template <
bool scaled>
65 template <
bool scaled>
87 template <
bool scaled>
213 void ensure_scaling_matrices_initialized_dbg()
const;
232template <
bool scaled>
240template <
bool scaled>
252template <
bool scaled>
260template <
bool scaled>
273template <
bool scaled>
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:54
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:207
static void disable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:54
Res< false > unscale(const Res< true > &r) const
Remove scaling to the residual.
Definition NonlinearSystem.cxx:148
Res< true > scale(const Res< false > &r) const
Apply scaling to the residual.
Definition NonlinearSystem.cxx:138
virtual void assemble(Res< false > *r, Jac< false > *J)=0
Compute the unscaled residual and Jacobian.
static void enable_automatic_scaling(OptionSet &options)
Definition NonlinearSystem.cxx:62
Jac< scaled > Jacobian()
Assemble and return the Jacobian.
Definition NonlinearSystem.h:242
NonlinearSystem(const NonlinearSystem &)=default
NonlinearSystem(NonlinearSystem &&) noexcept=default
Tensor _col_scaling
Column scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
Definition NonlinearSystem.h:210
const bool _autoscale
If true, do automatic scaling.
Definition NonlinearSystem.h:195
const unsigned int _autoscale_miter
Maximum number of iterations allowed for the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:201
Res< scaled > residual()
Assemble and return the residual.
Definition NonlinearSystem.h:222
static OptionSet expected_options()
Definition NonlinearSystem.cxx:31
virtual void set_guess(const Sol< true > &x) final
Set the current guess.
Definition NonlinearSystem.cxx:200
const Real _autoscale_tol
Tolerance for convergence check of the iterative automatic scaling algorithm.
Definition NonlinearSystem.h:198
virtual void init_scaling(const Sol< false > &x, const bool verbose=false)
Compute algebraic Jacobian-based automatic scaling following https://cs.stanford.edu/people/paulliu/f...
Definition NonlinearSystem.cxx:78
bool _scaling_matrices_initialized
Flag to indicate whether scaling matrices have been computed.
Definition NonlinearSystem.h:204
std::tuple< Res< scaled >, Jac< scaled > > residual_and_Jacobian()
Assemble and return the residual and Jacobian.
Definition NonlinearSystem.h:262
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:85
Definition CrossRef.cxx:31
double Real
Definition types.h:31
Definition NonlinearSystem.h:67
Jac(const Jac<!scaled > &J)
Conversion between scaled and unscaled must be explicit.
Definition NonlinearSystem.h:77
Jac(const Tensor &J)
Conversion from Tensor must be explicit.
Definition NonlinearSystem.h:71
Definition NonlinearSystem.h:45
Res(const Tensor &r)
Conversion from Tensor must be explicit.
Definition NonlinearSystem.h:49
Res(const Res<!scaled > &r)
Conversion between scaled and unscaled must be explicit.
Definition NonlinearSystem.h:55
Definition NonlinearSystem.h:89
Sol(const Tensor &u)
Conversion from Tensor must be explicit.
Definition NonlinearSystem.h:93
Sol(const Sol<!scaled > &u)
Conversion between scaled and unscaled must be explicit.
Definition NonlinearSystem.h:99