9 #include "imstkNonLinearSolver.h" 10 #include "imstkLinearSolver.h" 23 template<
typename SystemMatrix>
46 void solve()
override;
57 const double stopTolerance,
67 m_linearSolver = newLinearSolver;
107 m_relativeTolerance = newRelativeTolerance;
120 void setGamma(
const double newGamma) { m_gamma = newGamma; }
137 m_etaMax = newEtaMax;
150 m_maxIterations = newMaxIterations;
202 std::shared_ptr<LinearSolverType> m_linearSolver;
203 double m_forcingTerm;
204 double m_absoluteTolerance;
205 double m_relativeTolerance;
208 size_t m_maxIterations;
210 std::vector<double> m_fnorms;
auto getLinearSolver() const -> std::shared_ptr< LinearSolverType >
Get LinearSolver.
void solveGivenState(Vectord &x) override
Solve the non linear system of equations G(x)=0 using Newton's method.
bool m_isSemiImplicit
Semi-Implicit solver.
size_t m_armijoMax
Maximum number of step length reductions.
double getRelativeTolerance() const
Get RelativeTolerance. Returns current relative tolerance value.
void setAbsoluteTolerance(const double aTolerance)
Get JacobianMatrix. Returns jacobian matrix.
void setForcingTerm(const double value)
Set the useArmijo flag. If useArmijo is true a line search is performed using the Armijo-Goldstein co...
double getGamma() const
Get Gamma. Returns current gamma value.
bool getUseArmijo() const
Get MaxIterations. Returns current maximum nonlinear iterations.
void setEtaMax(const double newEtaMax)
Set EtaMax. Maximum error tolerance for residual in inner iteration. The inner iteration terminates w...
void setUseArmijo(const bool value)
Set the useArmijo flag. If useArmijo is true a line search is performed using the Armijo-Goldstein co...
double getForcingTerm() const
Get MaxIterations. Returns current maximum nonlinear iterations.
void updateForcingTerm(const double ratio, const double stopTolerance, const double fnorm)
Update forcing term according to Eisenstat-Walker criteria.
void setMaxIterations(const size_t newMaxIterations)
Set MaxIterations. The maximum number of nonlinear iterations.
void setGamma(const double newGamma)
Set Gamma. Sets the gamma parameter used to update the forcing term.
void setToSemiImplicit() override
Set the Newton solver to be fully implicit.
void setLinearSolver(std::shared_ptr< LinearSolverType > newLinearSolver)
Set LinearSolver.
void setRelativeTolerance(const double newRelativeTolerance)
Set RelativeTolerance.
Base class for non-linear solvers.
double updateJacobian(const Vectord &x)
Update jacobians.
Base class for linear solvers.
double getAbsoluteTolerance() const
Get AbsoluteTolerance. Returns current tolerance value.
Newton method. This version of the newton method is based on the work by Tim Kelly and others at NC S...
double getEtaMax() const
Get EtaMax. Returns current etaMax value.
size_t getMaxIterations() const
Get MaxIterations. Returns current maximum nonlinear iterations.
void setToFullyImplicit() override
Set the Newton solver to be fully implicit.