Class TimeStepping#

Defined in Program listing for file kernel/src/simulationTools/TimeStepping.hpp

class TimeStepping : public Simulation#

Subclassed by TimeSteppingCombinedProjection, TimeSteppingDirectProjection

Public Functions

virtual void initOSNS() override#

initialisation specific to TimeStepping for OneStepNSProblem.

TimeStepping(SP::NonSmoothDynamicalSystem nsds, SP::TimeDiscretisation td, SP::OneStepIntegrator osi, SP::OneStepNSProblem osnspb)#

Standard constructor.

Parameters:
  • nsdsNonSmoothDynamicalSystem to be simulated

  • td – pointer to a timeDiscretisation used in the integration

  • osi – one step integrator (default none)

  • osnspb – one step non smooth problem (default none)

TimeStepping(SP::NonSmoothDynamicalSystem nsds, SP::TimeDiscretisation td, int nb = 0)#

Constructor with the time-discretisation.

Parameters:
  • nsdsNonSmoothDynamicalSystem to be simulated

  • td – pointer to a timeDiscretisation used in the integration

  • nb – number of non smooth problem

virtual void insertIntegrator(SP::OneStepIntegrator osi) override#

insert an Integrator into the simulation list of integrators

Parameters:

osi – the OneStepIntegrator to add

virtual ~TimeStepping() noexcept = default#

Destructor.

virtual void updateIndexSet(unsigned int i) override#

update indexSets[i] of the topology, using current y and lambda values of Interactions

Parameters:

i – the number of the set to be updated

virtual void nextStep()#

increment model current time according to User TimeDiscretisation and call SaveInMemory.

void computeFreeState()#

integrates all the DynamicalSystems taking not into account nslaw, reactions (ie non-smooth part) …

void resetLambdas()#

Reset all lambdas of all interactions.

virtual void advanceToEvent() override#

step from current event to next event of EventsManager

void computeOneStep()#

run one time—step of the simulation

inline unsigned int getNewtonNbIterations()#

To known the number of steps performed by the Newton algorithm.

Returns:

the number of steps performed by the Newton algorithm

inline unsigned int getNewtonCumulativeNbIterations()#

To known the number of steps performed by the Newton algorithm.

Returns:

the cumulative number of steps performed by the Newton algorithm

void initializeNewtonSolve()#

initialize the Newton It computes the initial residu and set the, if needed to Newton variable to start the newton algorithm.

bool newtonCheckConvergence(double criterion)#

check the convergence of Newton algorithm according to criterion

Parameters:

criterion – convergence criterion

Returns:

bool = true if Newton method has converged

virtual void run() override#

run the simulation, from t0 to T with default parameters if any setting has been done

void DefaultCheckSolverOutput(int info)#

check returning value from computeOneStepNSProblem and process

Parameters:

info – solver-specific error code return by the nonsmooth solver

void setCheckSolverFunction(CheckSolverFPtr newF)#

Set CheckSolverOutput function.

Parameters:

newF – pointer to function steering the behavior of simulation when nonsmooth solver failed

inline void setComputeResiduY(bool v)#

To specify if the output interaction residu must be computed.

Parameters:

v – set to true when the output interaction residu must be computed

inline virtual bool computeResiduY() override#

To know if the output interaction residu must be computed.

Returns:

bool _computeResiduY

inline void setComputeResiduR(bool v)#

To specify if the input interaction residu must be computed.

Parameters:

v – set to true when the input interaction residu must be computed

inline virtual bool computeResiduR() override#

To known if the input interaction residu must be computed.

Returns:

bool _computeResiduR

inline void setNewtonTolerance(double tol)#

set the Default Newton tolerance

Parameters:

tol – Newton solver tolerance

inline double newtonTolerance()#

get the Newton tolerance

Returns:

default Newton solver tolerance

inline void setNewtonMaxIteration(unsigned int maxStep)#

set the maximum number of Newton iteration

Parameters:

maxStep – maximum number of Newton solver iterations

inline unsigned int newtonMaxIteration()#

get the maximum number of Newton iteration

Returns:

maximum number of Newton solver iterations

inline void setNewtonOptions(unsigned int v)#

set the NewtonOptions

Parameters:

v – Newton solver options

inline unsigned int newtonOptions()#

get the NewtonOptions

Returns:

Newton solver options - SICONOS_TS_LINEAR 1, SICONOS_TS_LINEAR_IMPLICIT 2, SICONOS_TS_NONLINEAR 3

inline double newtonResiduDSMax()#

accessor to _newtonResiduDSMax

Returns:

_newtonResiduDSMax

inline double newtonResiduYMax()#

accessor to _newtonResiduYMax

Returns:

_newtonResiduYMax

inline double newtonResiduRMax()#

accessor to _newtonResiduRMax

Returns:

_newtonResiduRMax