27#include "neml2/solvers/NonlinearSolver.h"
28#include "neml2/misc/math.h"
62 virtual bool converged(
size_t itr,
const torch::Tensor &
nR,
const torch::Tensor &
nR0)
const;
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The nonlinear solver solves a nonlinear system of equations.
Definition Newton.h:39
virtual void final_update(NonlinearSystem &system, BatchTensor &x)
Do a final update to track AD function graph.
Definition Newton.cxx:114
virtual std::tuple< bool, size_t > solve(NonlinearSystem &system, BatchTensor &x) override
Solve the given nonlinear system.
Definition Newton.cxx:48
virtual bool converged(size_t itr, const torch::Tensor &nR, const torch::Tensor &nR0) const
Check for convergence. The current iteration is said to be converged if the residual norm is below th...
Definition Newton.cxx:92
virtual void prepare(const NonlinearSystem &, const BatchTensor &)
Prepare solver internal data before the iterative update.
Definition Newton.h:49
static OptionSet expected_options()
Definition Newton.cxx:34
Newton(const OptionSet &options)
Definition Newton.cxx:42
virtual void update(NonlinearSystem &system, BatchTensor &x)
Update trial solution.
Definition Newton.cxx:105
virtual BatchTensor solve_direction(const NonlinearSystem &system)
Find the current update direction.
Definition Newton.cxx:121
The nonlinear solver solves a nonlinear system of equations.
Definition NonlinearSolver.h:37
Definition of a nonlinear system of equations.
Definition NonlinearSystem.h:37
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