chrono::ChTimestepperHHT Class Reference

Description

Implementation of the HHT implicit integrator for II order systems.

This timestepper allows use of an adaptive time-step, as well as optional use of a modified Newton scheme for the solution of the resulting nonlinear problem.

The Newton iteration solves for the accelerations and Lagrange multipliers at the end of the step. At each iteration, it evaluates the following quantities:

  • R: the dynamics residual (generalized forces, inertial forces, and constraint reactions);
  • C: the constraint violation, at the position level. For constraints imposed at the velocity level, C is the velocity violation multiplied by (beta/gamma)*h;
  • Ds: the acceleration update, measured in the WRMS norm with weights 1/(reltol*|a| + abstolS), with a the accelerations at the beginning of the step;
  • Dl: the Lagrange multiplier update, measured in the WRMS norm with weights 1/(reltol*|l| + abstolL), with l the multipliers at the beginning of the step.

Newton is declared converged if either of the following tests passes:

  • residual test: |R| < abstolS and |C| < abstolS (2-norms);
  • update test: |Ds|_WRMS < 1 and |Dl|_WRMS < 1.

The state tolerance abstolS therefore applies to all state-related quantities, while the multiplier tolerance abstolL applies only to the multiplier update. Both tests are limited by round-off: |C| cannot drop below about eps*|q| (with eps the machine precision and q the generalized coordinates), |R| cannot drop below about k*eps*|q| for a force with stiffness k, and the acceleration update cannot drop below about eps*|q|/(beta*h^2). The last limit grows quickly as the step size decreases; with very small steps, abstolS (or reltol) must stay above it for the update test to pass.

When Newton fails to converge, the integrator reports the norms and tolerances of both tests at the last iteration (in the exception message, or in the verbose output if the terminated step is accepted).

#include <ChTimestepperHHT.h>

Inheritance diagram for chrono::ChTimestepperHHT:
Collaboration diagram for chrono::ChTimestepperHHT:

Public Member Functions

 ChTimestepperHHT (ChIntegrableIIorder *intgr=nullptr)
 
virtual ChTimestepper::Type GetType () const override
 Return type of the integration method.
 
virtual ChIntegrable * GetIntegrable () const override
 Return the associated integrable object.
 
void SetAlpha (double val)
 Set the numerical damping parameter (in the [-1/3, 0] range). More...
 
double GetAlpha ()
 Return the current value of the method parameter alpha.
 
virtual void ArchiveOut (ChArchiveOut &archive) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive) override
 Method to allow de-serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChTimestepperIIorder
virtual ChState & GetStatePos ()
 Access the state, position part, at current time.
 
virtual ChStateDelta & GetStateVel ()
 Access the state, speed part, at current time.
 
virtual ChStateDelta & GetStateAcc ()
 Access the acceleration, at current time.
 
virtual void SetIntegrable (ChIntegrableIIorder *intgr)
 Set the integrable object.
 
ChIntegrableIIorder * GetIntegrableIIorder () const
 Get the integrable object.
 
- Public Member Functions inherited from chrono::ChTimestepperImplicit
void SetMaxIters (int iters)
 Set the max number of Newton iterations.
 
void SetRelTolerance (double rel_tol)
 Set the relative tolerance. More...
 
void SetAbsTolerances (double abs_tolS, double abs_tolL)
 Set the absolute tolerances for states and Lagrange multipliers. More...
 
void SetAbsTolerances (double abs_tol)
 Set the same absolute tolerance for states and Lagrange multipliers. More...
 
void SetJacobianUpdateMethod (JacobianUpdate method)
 Set the strategy for Jacobian update (default: EVERY_STEP).
 
double GetMaxIters () const
 Get the max number of iterations using the Newton Raphson procedure.
 
JacobianUpdate GetJacobianUpdateMethod () const
 Get the current Jacobian update strategy.
 
unsigned int GetNumStepIterations () const
 Return the number of Newton iterations over the last step.
 
unsigned int GetNumStepSetupCalls () const
 Return the number of calls to the solver's Setup function made during the last step.
 
unsigned int GetNumStepSolveCalls () const
 Return the number of calls to the solver's Solve function made over the last step.
 
double GetEstimatedConvergenceRate () const
 Get the last estimated convergence rate for the internal Newton solver. More...
 
unsigned int GetNumIterations () const
 Return the cumulative number of Newton iterations.
 
unsigned int GetNumSetupCalls () const
 Return the cumulative number of calls to the solver's Setup function.
 
unsigned int GetNumSolveCalls () const
 Return the cumulative number of calls to the solver's Solve function.
 
void AcceptTerminatedStep (bool accept)
 Accept step after a non-converged Newton solve (default: true). More...
 
unsigned int GetNumTerminated () const
 Return the number of terminated Newton solves. More...
 
void SetStepControl (bool enable)
 Turn on/off the internal step size control. More...
 
void SetMinStepSize (double step)
 Set the minimum step size. More...
 
void SetMaxItersSuccess (int iters)
 Set the maximum allowable number of iterations for counting a step towards a stepsize increase. More...
 
void SetRequiredSuccessfulSteps (int num_steps)
 Set the minimum number of (internal) steps that use at most maxiters_success before considering a stepsize increase. More...
 
void SetStepIncreaseFactor (double factor)
 Set the multiplicative factor for a stepsize increase (must be larger than 1). More...
 
void SetStepDecreaseFactor (double factor)
 Set the multiplicative factor for a stepsize decrease (must be smaller than 1). More...
 
virtual void Advance (double dt) override final
 Perform an integration step. More...
 
virtual void SaveInternalState (ChCheckpointWriter &writer) const override
 Save the step size control state (internal step size and number of successive successful steps).
 
virtual void LoadInternalState (ChCheckpointReader &reader) override
 Load the step size control state.
 
- Public Member Functions inherited from chrono::ChTimestepper
virtual ChVectorDynamic & GetLagrangeMultipliers ()
 Access the Lagrange multipliers, if any.
 
virtual double GetTime () const
 Get the current time.
 
virtual void SetTime (double mt)
 Set the current time.
 
void SetVerbose (bool verb)
 Turn on/off logging of messages.
 
std::string GetTypeAsString () const
 Return this integrator's type as a string.
 

Additional Inherited Members

- Public Types inherited from chrono::ChTimestepperImplicit
enum  JacobianUpdate { JacobianUpdate::EVERY_ITERATION, JacobianUpdate::EVERY_STEP, JacobianUpdate::NEVER, JacobianUpdate::AUTOMATIC }
 Newton Jacobian update strategies. More...
 
- Public Types inherited from chrono::ChTimestepper
enum  Type {
  EULER_EXPLICIT_I, EULER_EXPLICIT_II, EULER_SEMI_IMPLICIT, RUNGE_KUTTA,
  HEUN, LEAPFROG, EULER_IMPLICIT, EULER_IMPLICIT_LINEARIZED,
  EULER_IMPLICIT_PROJECTED, TRAPEZOIDAL, TRAPEZOIDAL_LINEARIZED, NEWMARK,
  HHT, CUSTOM
}
 Methods for time integration.
 
- Static Public Member Functions inherited from chrono::ChTimestepperImplicit
static std::string GetJacobianUpdateMethodAsString (JacobianUpdate jacobian_update)
 Return Jacobian update method as a string.
 
- Static Public Member Functions inherited from chrono::ChTimestepper
static std::string GetTypeAsString (Type type)
 Return the provided integrator type as a string.
 
- Protected Member Functions inherited from chrono::ChTimestepperIIorder
 ChTimestepperIIorder (ChIntegrableIIorder *intgr=nullptr)
 
- Protected Member Functions inherited from chrono::ChTimestepperImplicit
virtual void OnAdvance (double dt)
 Implementation of integrator-specific time advance. More...
 
bool CheckConvergence (int iteration)
 Check convergence of Newton process. More...
 
std::string GetConvergenceReport () const
 Return a description of the last convergence check (norms, tolerances, and failed tests).
 
std::string GetResidualTestReport () const
 Return a description of the residual test at the last convergence check.
 
void ProcessTerminatedSolve (const std::string &report)
 Handle a Newton solve that did not converge within the maximum number of iterations. More...
 
void CalcErrorWeights (const ChVectorDynamic<> &x, double rtol, double atol, ChVectorDynamic<> &ewt)
 Calculate error weights based on the given state and tolerances.
 
- Protected Member Functions inherited from chrono::ChTimestepper
 ChTimestepper (ChIntegrable *intgr=nullptr)
 
- Protected Attributes inherited from chrono::ChTimestepperIIorder
ChIntegrableIIorder * integrable
 
ChState X
 
ChStateDelta V
 
ChStateDelta A
 
- Protected Attributes inherited from chrono::ChTimestepperImplicit
JacobianUpdate jacobian_update_method
 Jacobian update strategy.
 
bool call_setup
 should the solver's Setup function be called?
 
bool call_analyze
 should the solver's Setup analyze phase be called?
 
bool jacobian_is_current
 was the Jacobian evaluated at current Newton iteration?
 
unsigned int max_iters
 maximum number of iterations
 
double reltol
 relative tolerance
 
double abstolS
 absolute tolerance (states)
 
double abstolL
 absolute tolerance (Lagrange multipliers)
 
unsigned int num_step_iters
 number of iterations during last step
 
unsigned int num_step_setups
 number of calls to the solver Setup() function during last step
 
unsigned int num_step_solves
 number of calls to the solver Solve() function during last step
 
unsigned int num_iters
 current cumulative number of Newton iterations
 
unsigned int num_setups
 current cumulative number of Setup() calls
 
unsigned int num_solves
 current cumulative number of Solve() calls
 
unsigned int num_terminated
 number of terminated NEwton iterations
 
double convergence_rate
 estimated Newton rate of convergence
 
ChStateDelta Ds
 state update
 
ChVectorDynamic Dl
 Lagrange multiplier update.
 
ChVectorDynamic R
 residual of nonlinear system (dynamics portion)
 
ChVectorDynamic Qc
 residual of nonlinear system (constraints portion)
 
double Qc_scale
 factor converting the constraint residual Qc to a position-level constraint violation
 
double R_nrm
 norm of the dynamics residual at the last convergence check
 
double C_nrm
 norm of the position-level constraint violation at the last convergence check
 
double Ds_nrm
 WRMS norm of the state update at the last convergence check.
 
double Dl_nrm
 WRMS norm of the Lagrange multiplier update at the last convergence check.
 
std::array< double, 3 > Ds_nrm_hist
 last 3 update norms
 
std::array< double, 3 > Dl_nrm_hist
 last 3 update norms
 
ChVectorDynamic ewtS
 vector of error weights (states)
 
ChVectorDynamic ewtL
 vector of error weights (Lagrange multipliers)
 
bool accept_terminated
 accept or reject steps after a non-converged Newton solve
 
bool step_control
 step size control enabled?
 
unsigned int maxiters_success
 maximum number of NR iterations to declare a step successful
 
unsigned int req_successful_steps
 required number of successive successful steps for a stepsize increase
 
double step_increase_factor
 factor used in increasing stepsize (>1)
 
double step_decrease_factor
 factor used in decreasing stepsize (<1)
 
double h_min
 minimum allowable stepsize
 
double h
 internal stepsize
 
unsigned int num_successful_steps
 number of successful steps
 
- Protected Attributes inherited from chrono::ChTimestepper
bool verbose
 
double T
 
ChVectorDynamic L
 
bool Qc_do_clamp
 
double Qc_clamping
 

Member Function Documentation

◆ SetAlpha()

void chrono::ChTimestepperHHT::SetAlpha ( double  val)

Set the numerical damping parameter (in the [-1/3, 0] range).

The closer to -1/3, the more damping. The closer to 0, the less damping (for 0, it is the trapezoidal method). The method coefficients gamma and beta are set automatically, based on alpha. Default: -0.2.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/timestepper/ChTimestepperHHT.h
  • /builds/uwsbel/chrono/src/chrono/timestepper/ChTimestepperHHT.cpp