siconos.kernel.TimeStepping (Python class)

class siconos.kernel.TimeStepping(*args)[source]

Bases: siconos.kernel.Simulation

Constructors

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

Standard constructor.

Parameters:
  • nsds – NonSmoothDynamicalSystem 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(NonSmoothDynamicalSystem nsds, TimeDiscretisation td, int nb=0)

Constructor with the time-discretisation.

Parameters:
  • nsds – NonSmoothDynamicalSystem to be simulated
  • td – pointer to a timeDiscretisation used in the integration
  • nb – number of non smooth problem
DefaultCheckSolverOutput(int info) → None[source]

check returning value from computeOneStepNSProblem and process

Parameters:info – solver-specific error code return by the nonsmooth solver
advanceToEvent() → None[source]

step from current event to next event of EventsManager

computeFreeState() → None[source]

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

computeOneStep() → None[source]

run one time–step of the simulation

computeResiduR() → bool[source]

To known if the input interaction residu must be computed.

Returns:bool _computeResiduR
computeResiduY() → bool[source]

To know if the output interaction residu must be computed.

Returns:bool _computeResiduY
getNewtonCumulativeNbIterations() → int[source]

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

Returns:the cumulative number of steps performed by the Newton algorithm
getNewtonNbIterations() → int[source]

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

Returns:the number of steps performed by the Newton algorithm
initOSNS() → None[source]

initialisation specific to TimeStepping for OneStepNSProblem.

initializeNewtonLoop() → None[source]

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

isNewtonConverge() → bool[source]
newtonCheckConvergence(double criterion) → bool[source]

check the convergence of Newton algorithm according to criterion

Parameters:criterion – convergence criterion
Returns:bool = true if Newton method has converged
newtonMaxIteration() → double[source]

get the maximum number of Newton iteration

Returns:maximum number of Newton solver iterations
newtonOptions() → int[source]

get the NewtonOptions

Returns:
  • Newton solver options - SICONOS_TS_LINEAR 1, SICONOS_TS_LINEAR_IMPLICIT 2,
  • SICONOS_TS_NONLINEAR 3
newtonResiduDSMax() → double[source]

accessor to _newtonResiduDSMax

Returns:_newtonResiduDSMax
newtonResiduRMax() → double[source]

accessor to _newtonResiduRMax

Returns:_newtonResiduRMax
newtonResiduYMax() → double[source]

accessor to _newtonResiduYMax

Returns:_newtonResiduYMax
newtonTolerance() → double[source]

get the Newton tolerance

Returns:default Newton solver tolerance
nextStep() → None[source]

Used by the updateIndexSet function in order to deactivate SP::Interaction.

Used by the updateIndexSet function in order to activate SP::Interaction.increment model current time according to User TimeDiscretisation and call SaveInMemory.

prepareNewtonIteration() → None[source]
resetLambdas() → None[source]

Reset all lambdas of all interactions.

run() → None[source]

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

saveYandLambdaInOldVariables() → None[source]
setCheckSolverFunction(CheckSolverFPtr newF) → None[source]

Set CheckSolverOutput function.

Parameters:newF – pointer to function steering the behavior of simulation when nonsmooth solver failed
setComputeResiduR(bool v) → None[source]

To specify if the input interaction residu must be computed.

Parameters:v – set to true when the input interaction residu must be computed
setComputeResiduY(bool v) → None[source]

To specify if the output interaction residu must be computed.

Parameters:v – set to true when the output interaction residu must be computed
setDisplayNewtonConvergence(bool newval) → None[source]
setNewtonMaxIteration(int maxStep) → None[source]

set the maximum number of Newton iteration

Parameters:maxStep – maximum number of Newton solver iterations
setNewtonOptions(int v) → None[source]

set the NewtonOptions

Parameters:v – Newton solver options
setNewtonTolerance(double tol) → None[source]

set the Default Newton tolerance

Parameters:tol – Newton solver tolerance
setResetAllLambda(bool newval) → None[source]
setWarnOnNonConvergence(bool newval) → None[source]
updateIndexSet(int i) → None[source]

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

Parameters:i – the number of the set to be updated