mbsim 4.0.0 MBSim Kernel

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MBSim::TimeSteppingSSCIntegrator Class Reference

Half-explicit time-stepping integrator of first or higer order with StepSize Control (SSC) important options / settings : More...

`#include <time_stepping_ssc_integrator.h>`

Inheritance diagram for MBSim::TimeSteppingSSCIntegrator:
[legend]

## Public Types

enum | Method { extrapolation =0, embedded, embeddedHigherOrder, unknownMethod }
enum | GapControl { noGapControl =0, biggestRoot, scoring, gapTolerance, smallestRoot, unknownGapControl }
enum | ErrorTest { all =0, scale =2, exclude =3, unknownErrorTest }

## Public Member Functions

| ~TimeSteppingSSCIntegrator () override
void | setInitialStepSize (double dt_)
void | setMaximumStepSize (double dtMax_)
void | setMinimumStepSize (double dtMin_)
void | setMaximumGain (double maxGain)
void | setSafetyFactor (double sfactor)
void | setSafetyFactorForGapControl (double s)
void | setOutputInterpolation (bool flag)
void | setFlagOutputOnlyAtTPlot (bool flag)
void | setGapControl (GapControl gapControl)
void | setDriftCompensation (bool dc)
void | setMaximumOrder (int maxOrder_)
void | setMethod (Method method_)
void | setStepSizeControl (bool flag)
void | setErrorTest (ErrorTest errorTest)
void | setAlwaysValid (bool alwaysValid)
void | integrate () override
| start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.
void | integrate (MBSim::DynamicSystemSolver &systemT1_, MBSim::DynamicSystemSolver &systemT2_, MBSim::DynamicSystemSolver &systemT3_, int Threads=0)
void | setAbsoluteTolerance (const fmatvec::Vec &aTol_)
void | setAbsoluteTolerance (double aTol_)
void | setRelativeTolerance (const fmatvec::Vec &rTol_)
void | setRelativeTolerance (double rTol_)
void | setgapTolerance (double gTol)
void | preIntegrate () override
void | subIntegrate (double tStop) override
void | postIntegrate () override
void | preIntegrate (MBSim::DynamicSystemSolver &systemT1_, MBSim::DynamicSystemSolver &systemT2_, MBSim::DynamicSystemSolver &systemT3_)
void | getDataForGapControl ()
bool | testTolerances ()
bool | GapControl (double qUnsafe, bool SSCTestOK)
bool | changedLinkStatus (const fmatvec::VecInt &L1, const fmatvec::VecInt &L2, int ex)
double | calculatedtNewRel (const fmatvec::Vec &ErrorLocal, double H)
void | plot ()
virtual void | initializeUsingXML (xercesc::DOMElement *element) override
| initialize integrator More...
void | updatebi ()
void | updatela ()
void | updatezd ()
virtual void | integrate ()=0
void | integrate (MBSim::DynamicSystemSolver &sys)
Public Member Functions inherited from MBSim::Integrator
| Integrator ()
| constructor
| ~Integrator () override=default
| destructor
void | setStartTime (double tStart_)
void | setEndTime (double tEnd_)
void | setPlotStepSize (double dtPlot_)
void | setInitialState (const fmatvec::Vec &z0_)
double | getStartTime () const
double | getEndTime () const
double | getPlotStepSize () const
const fmatvec::Vec & | getInitialState () const override
void | execute () override
| start solving the dynamic system set by setSystem.
void | integrate (MBSim::DynamicSystemSolver &sys)
| Convinent function: call setSystem(&sys) and integrate()
void | debugInit ()
Public Member Functions inherited from MBSim::Solver
| Solver ()
| constructor
| ~Solver () override=default
| destructor
void | throwError (const std::string &msg) const
virtual void | postprocessing ()
void | setSystem (DynamicSystemSolver *s)
MBSim::DynamicSystemSolver * | getSystem ()
const MBXMLUtils::DOMEvalException & | getDOMEvalError () const

## Protected Member Functions

void | resize (MBSim::DynamicSystemSolver *system)

## Protected Attributes

MBSim::DynamicSystemSolver * | sysT1 {NULL}
MBSim::DynamicSystemSolver * | sysT2 {NULL}
MBSim::DynamicSystemSolver * | sysT3 {NULL}
double | dt {1e-6}
double | dtOld {1e-6}
double | dte {1e-6}
double | dtMin {0}
double | dtMax {1e-3}
double | dt_SSC_vorGapControl {0}
bool | driftCompensation {false}
double | t {0}
double | tPlot {0}
int | qSize {0}
int | xSize {0}
int | uSize {0}
int | zSize {0}
fmatvec::Vec | ze
fmatvec::Vec | zi
fmatvec::Vec | z1d
fmatvec::Vec | z2d
fmatvec::Vec | z2dRE
fmatvec::Vec | z3d
fmatvec::Vec | z4d
fmatvec::Vec | z6d
fmatvec::Vec | z2b
fmatvec::Vec | z3b
fmatvec::Vec | z4b
fmatvec::Vec | z6b
fmatvec::Vec | zStern
fmatvec::VecInt | LS
fmatvec::VecInt | LSe
fmatvec::VecInt | LStmp_T1
fmatvec::VecInt | LStmp_T2
fmatvec::VecInt | LStmp_T3
fmatvec::VecInt | LSA
fmatvec::VecInt | LSB1
fmatvec::VecInt | LSB2
fmatvec::VecInt | LSC1
fmatvec::VecInt | LSC2
fmatvec::VecInt | LSC3
fmatvec::VecInt | LSC4
fmatvec::VecInt | LSD1
fmatvec::VecInt | LSD2
fmatvec::VecInt | LSD3
fmatvec::VecInt | LSD4
fmatvec::VecInt | LSD5
fmatvec::VecInt | LSD6
fmatvec::Vec | la
fmatvec::Vec | lae
fmatvec::Vec | la1d
fmatvec::Vec | la2b
fmatvec::VecInt | laSizes
fmatvec::VecInt | laeSizes
fmatvec::VecInt | la1dSizes
fmatvec::VecInt | la2bSizes
fmatvec::Vec | gInActive
fmatvec::Vec | gdInActive
std::vector< MBSim::Link * > | SetValuedLinkListT1
std::vector< MBSim::Link * > | SetValuedLinkListT2
std::vector< MBSim::Link * > | SetValuedLinkListT3
int | StepsWithUnchangedConstraints {-1}
int | FlagErrorTest {2}
bool | FlagErrorTestAlwaysValid {true}
fmatvec::Vec | aTol
fmatvec::Vec | rTol
bool | FlagSSC {true}
int | maxOrder {1}
Method | method {extrapolation}
bool | FlagGapControl {false}
double | gapTol {1e-6}
double | maxGainSSC {2.2}
double | safetyFactorSSC {0.7}
bool | FlagOutputOnlyAtTPlot {false}
bool | FlagPlotEveryStep {false}
bool | outputInterpolation {false}
double | safetyFactorGapControl {-1}
GapControl | GapControlStrategy {biggestRoot}
int | numThreads {1}
double | time {0}
MBSim::StopWatch | Timer
int | iter {0}
int | iterA {0}
int | iterB1 {0}
int | iterB2 {0}
int | iterC1 {0}
int | iterC2 {0}
int | iterC3 {0}
int | iterC4 {0}
int | iterB2RE {0}
int | maxIterUsed {0}
int | maxIter {0}
int | sumIter {0}
int | integrationSteps {0}
int | integrationStepswithChange {0}
int | refusedSteps {0}
int | refusedStepsWithImpact {0}
int | wrongAlertGapControl {0}
int | stepsOkAfterGapControl {0}
int | stepsRefusedAfterGapControl {0}
int | statusGapControl {0}
int | singleStepsT1 {0}
int | singleStepsT2 {0}
int | singleStepsT3 {0}
double | dtRelGapControl {1}
double | qUncertaintyByExtrapolation {0}
int | indexLSException {-1}
fmatvec::Vec | gUniActive
double | Penetration {0}
double | PenetrationCounter {0}
double | PenetrationLog {0}
double | PenetrationMin {0}
double | PenetrationMax {0}
double | maxdtUsed {0}
double | mindtUsed {0}
bool | ChangeByGapControl {false}
bool | calcBlock2 {0}
bool | IterConvergence {0}
bool | ConstraintsChanged {0}
bool | ConstraintsChangedBlock1 {0}
bool | ConstraintsChangedBlock2 {0}
int | integrationStepsOrder1 {0}
int | integrationStepsOrder2 {0}
int | order {1}
int | StepTrials {0}
int | AnzahlAktiverKontakte {0}
double | gNDurchschnittprostep {0}
fmatvec::Vec | bi
Protected Attributes inherited from MBSim::Integrator
double | tStart {0.}
| start, end, plot time
double | tEnd {1.}
double | dtPlot {1e-4}
fmatvec::Vec | z0
| initial state
std::string | name
| name of integrator
Protected Attributes inherited from MBSim::Solver
MBSim::DynamicSystemSolver * | system
| dynamic system
MBXMLUtils::DOMEvalException | domEvalError
| Special XML helper variable.

## Detailed Description

Half-explicit time-stepping integrator of first or higer order with StepSize Control (SSC) important options / settings :

a) setMaxOrder(int order, int method=0) order: maximum order of integration scheme 1 to 3 with SSC by extrapolation (method=0) (order=4 without SSC) 1 to 4 with embedded SSC (1=1(2), ... 4=4(5)) (method=1 or 2) method: method used for error estimation and step size control 0: step size control by extrapolation (steps wit dt and dt/2 are compared) DEFAULT 1: embedded method (compare maxOrder maxOrder+1); proceed with maxOrder (recommended) 2: embedded method with local extrapolation (integration is continued with maxOrder+1)

b) setFlagErrorTest(int Flag, bool alwaysValid= true) Flag: for scaling variables for the purpose of error estimation

0: include velocities u for error test 2: scale velocities u with stepsize for error test 3: exclude velocities u for error test alwaysValid: true : u is scaled resp. exluded during smooth and nonsmooth steps alwaysValid: false : u is scaled resp. exluded only during nonsmooth steps

c) deactivateSSC(bool flag=false) : maximum order: 1 to 4

d) setGapControl(bool FlagGapControl=true, int GapControlStrategy=0)

FlagGapControl activate / deactivate gap control GapControlStrategy choose strategy for Gap Control (1:maximal Stepsize to 4:minimal Penetration) 1: uses biggest root (maximal dt) 2: score for all roots are evaluated 3: gapTol is used 4: uses smallest root (minimal penetration) 0: gap control deactivated

Author
  Robert Huber

Date
  2009-09-07 modifications for mbsim_dev

## Constructor & Destructor Documentation

## ◆ ~TimeSteppingSSCIntegrator()

MBSim::TimeSteppingSSCIntegrator::~TimeSteppingSSCIntegrator | ( |  | ) |

override

Destructor

## Member Function Documentation

## ◆ getDataForGapControl()

void MBSim::TimeSteppingSSCIntegrator::getDataForGapControl | ( |  | ) |

internal subroutines

## ◆ initializeUsingXML()

void MBSim::TimeSteppingSSCIntegrator::initializeUsingXML | ( | xercesc::DOMElement * | element | ) |

override virtual

initialize integrator

Parameters

  XML | description

Reimplemented from MBSim::Integrator.

## ◆ integrate() [1/3]

virtual void MBSim::Integrator::integrate

Start the integration

## ◆ integrate() [2/3]

void MBSim::Integrator::integrate

inline

Start the integration

## ◆ integrate() [3/3]

void MBSim::TimeSteppingSSCIntegrator::integrate | ( | MBSim::DynamicSystemSolver & | systemT1_,
|  | MBSim::DynamicSystemSolver & | systemT2_,
|  | MBSim::DynamicSystemSolver & | systemT3_,
|  | int | Threads = `0`
| ) |  |

Threads: Number of Threads (0,1,2 or 3) 0: auto (number of threads depends on order and SSC)

## ◆ preIntegrate()

void MBSim::TimeSteppingSSCIntegrator::preIntegrate | ( |  | ) |

override virtual

subroutines for integrate function

Reimplemented from MBSim::Integrator.

## ◆ setAlwaysValid()

void MBSim::TimeSteppingSSCIntegrator::setAlwaysValid | ( | bool | alwaysValid | ) |

inline

alwaysValid = true : u is scaled resp. exluded during the smooth and nonsmooth part alwaysValid = false : u is scaled resp. exluded only during nonsmooth steps

## ◆ setDriftCompensation()

void MBSim::TimeSteppingSSCIntegrator::setDriftCompensation | ( | bool | dc | ) |

inline

Set drift compensation

## ◆ setErrorTest()

void MBSim::TimeSteppingSSCIntegrator::setErrorTest | ( | ErrorTest | errorTest | ) |

inline

Set error test (default 0: all variables ae tested; 2: u is scaled with dt; 3: exclude u

## ◆ setFlagOutputOnlyAtTPlot()

void MBSim::TimeSteppingSSCIntegrator::setFlagOutputOnlyAtTPlot | ( | bool | flag | ) |

inline

set Flag for writing output only at tPlot-Time instances or not (default false)

## ◆ setGapControl()

void MBSim::TimeSteppingSSCIntegrator::setGapControl | ( | GapControl | gapControl | ) |

inline

Set Flag to optimise dt for minmal penetration of unilateral links; choose strategy for Gap Control (1:maximal Stepsize to 4:minimal Penetration) 1: uses biggest root (maximal dt) 2: score for all roots are evaluated 3: gapTol is used 4: uses smallest root (minimal penetration) 0: gap control deactivated with statistic calculations -1: gap control deactivated without statistic calculations

## ◆ setInitialStepSize()

void MBSim::TimeSteppingSSCIntegrator::setInitialStepSize | ( | double | dt_ | ) |

inline

Set initial step size

## ◆ setMaximumGain()

void MBSim::TimeSteppingSSCIntegrator::setMaximumGain | ( | double | maxGain | ) |

inline

Set maximal gain for increasing dt by stepsize control

## ◆ setMaximumOrder()

void MBSim::TimeSteppingSSCIntegrator::setMaximumOrder | ( | int | maxOrder_ | ) |

inline

set maximum order (1,2,3 (method=extrapolation) or 1 to 4 (method=embedded,embeddedHigherOrder) and without SSC maximum order from 1 to 4 is possible

## ◆ setMaximumStepSize()

void MBSim::TimeSteppingSSCIntegrator::setMaximumStepSize | ( | double | dtMax_ | ) |

inline

Set maximal step size

## ◆ setMethod()

void MBSim::TimeSteppingSSCIntegrator::setMethod | ( | Method | method_ | ) |

inline

set method extrapolation: SSC by extrapolation (recommended!!); embedded,embeddedHigherOrder: embedded SSC; proceed with maxOrder [1] (recommended if you don't want to use 0) or with maxOrder+1 [2]

## ◆ setMinimumStepSize()

void MBSim::TimeSteppingSSCIntegrator::setMinimumStepSize | ( | double | dtMin_ | ) |

inline

Set minimal step size (default 2*maxOrder*epsroot

## ◆ setOutputInterpolation()

void MBSim::TimeSteppingSSCIntegrator::setOutputInterpolation | ( | bool | flag | ) |

inline

Set Flag for output interpolation

## ◆ setSafetyFactor()

void MBSim::TimeSteppingSSCIntegrator::setSafetyFactor | ( | double | sfactor | ) |

inline

safety factor for stepsize estimation: dt = dt_estimate * safetyFactorSSC (]0;1]; default 0.6)

## Member Data Documentation

## ◆ aTol

fmatvec::Vec MBSim::TimeSteppingSSCIntegrator::aTol

protected

Absolute Toleranz

## ◆ FlagErrorTest

int MBSim::TimeSteppingSSCIntegrator::FlagErrorTest {2}

protected

include (0) or exclude (3) variable u or scale (2) with stepsize for error test

## ◆ FlagErrorTestAlwaysValid

bool MBSim::TimeSteppingSSCIntegrator::FlagErrorTestAlwaysValid {true}

protected

FlagErrorTest is always valid or only during nonsmooth steps

## ◆ FlagOutputOnlyAtTPlot

bool MBSim::TimeSteppingSSCIntegrator::FlagOutputOnlyAtTPlot {false}

protected

Flag: write output info to cout only for plot-time-instances (default false)

## ◆ FlagPlotEveryStep

bool MBSim::TimeSteppingSSCIntegrator::FlagPlotEveryStep {false}

protected

every successful integration step is ploted (set dtPlot=0 to activate FlagPlotEveryStep) (default false)

## ◆ FlagSSC

bool MBSim::TimeSteppingSSCIntegrator::FlagSSC {true}

protected

activate step size control

## ◆ GapControlStrategy

GapControl MBSim::TimeSteppingSSCIntegrator::GapControlStrategy {biggestRoot}

protected

choose strategy for Gap Control (1:maximal Stepsize to 4:minimal Penetration) 1: uses biggest root (maximal dt) 2: score for all roots are evaluated 3: gapTol is used 4: uses smallest root (minimal penetration) 0: gap control deactivated

## ◆ gapTol

double MBSim::TimeSteppingSSCIntegrator::gapTol {1e-6}

protected

Toleranz for closing gaps

## ◆ maxGainSSC

double MBSim::TimeSteppingSSCIntegrator::maxGainSSC {2.2}

protected

maximal gain factor for increasing dt by stepsize control (default 2.5; maxGain * safetyFactor must be GT 1)

## ◆ maxOrder

int MBSim::TimeSteppingSSCIntegrator::maxOrder {1}

protected

maximum order of integration scheme SSC by extrapolation (steps with differnt dt are compared): 1, 2, 3

SSC with embedded methods (differnt orders are compared): 1 to 4 [ 1= 1(2), ... 4= 4(5) ] maxOrder(maxOrder+1)

## ◆ method

Method MBSim::TimeSteppingSSCIntegrator::method {extrapolation}

protected

method for intrgration and step size control method=extrapolation step size control by extrapolation (steps wit dt and dt/2 are compared) DEFAULT method=embedded embedded method for step size control (maxOrder and maxOrder+1 are compared); proceed with maxOrder (recommended) method=embeddedHigherOrder embedded method for SSC with -local extrapolation- (integration is continued with maxOrder+1)

## ◆ numThreads

int MBSim::TimeSteppingSSCIntegrator::numThreads {1}

protected

Number of Threads

## ◆ outputInterpolation

bool MBSim::TimeSteppingSSCIntegrator::outputInterpolation {false}

protected

Flag interpolate z and la for plotting (default false)

## ◆ rTol

fmatvec::Vec MBSim::TimeSteppingSSCIntegrator::rTol

protected

Relative Toleranz

## ◆ safetyFactorGapControl

double MBSim::TimeSteppingSSCIntegrator::safetyFactorGapControl {-1}

protected

Safety factor for GapControl (dtNew = dt_gapcontrol*safetyFactor; default min(1+RTol,1.001)

## ◆ safetyFactorSSC

double MBSim::TimeSteppingSSCIntegrator::safetyFactorSSC {0.7}

protected

safety factor for stepsize estimation: dt = dt_estimate * safetyFactorSSC (]0;1]; default 0.6)

## ◆ time

double MBSim::TimeSteppingSSCIntegrator::time {0}

protected

computaional time

## ◆ Timer

MBSim::StopWatch MBSim::TimeSteppingSSCIntegrator::Timer

protected

for internal use (start clock, integration info ...)

The documentation for this class was generated from the following files:

- /mbsim-env/mbsim/kernel/mbsim/integrators/time_stepping_ssc_integrator.h
- /mbsim-env/mbsim/kernel/mbsim/integrators/time_stepping_ssc_integrator.cc