mbsim  4.0.0
MBSim Kernel
MBSim::SingleContact Class Reference

class for contacts More...

#include <single_contact.h>

Inheritance diagram for MBSim::SingleContact:
[legend]

Public Member Functions

 SingleContact (const std::string &name="")
 constructor More...
 
void resetUpToDate () override
 
bool isSticking () const
 
const double & evalGeneralizedNormalForce ()
 
const fmatvec::VecV & evalGeneralizedTangentialForce ()
 
double & getGeneralizedNormalForce (bool check=true)
 
const double & evallaN ()
 
const fmatvec::Vec & evallaT ()
 
const double & evalLaN ()
 
const fmatvec::Vec & evalLaT ()
 
const double & evalgdnN ()
 
const fmatvec::Vec & evalgdnT ()
 
const double & evalgddN ()
 
const fmatvec::Vec & evalgddT ()
 
void updateGeneralizedNormalForce ()
 
void updateGeneralizedTangentialForce ()
 
void updateGeneralizedNormalForceS ()
 
void updateGeneralizedNormalForceM ()
 
void updateGeneralizedNormalForceP ()
 
void updateGeneralizedTangentialForceS ()
 
void updateGeneralizedTangentialForceM ()
 
void updateGeneralizedTangentialForce0 ()
 
void updateGeneralizedForces () override
 
void updateGeneralizedPositions () override
 
void updateGeneralizedVelocities () override
 
void updatePositions (Frame *frame) override
 
void updateg () override
 
void updategd () override
 
void updateh (int i=0) override
 
void updateW (int i=0) override
 
void updateV (int i=0) override
 
void updatewb () override
 
void updateStopVector () override
 
void updateStopVectorParameters () override
 
void updatelaRef (fmatvec::Vec &ref) override
 references to contact force parameter of dynamic system parent More...
 
void updateLaRef (fmatvec::Vec &ref) override
 references to contact force parameter of dynamic system parent More...
 
void updategdRef (fmatvec::Vec &ref) override
 references to contact relative velocities of dynamic system parent More...
 
void calcSize () override
 
void calclaSize (int j) override
 calculates size of contact force parameters More...
 
void calcgSize (int j) override
 calculates size of relative distances More...
 
void calcgdSize (int j) override
 calculates size of gap velocities More...
 
void calcrFactorSize (int j) override
 calculates size of rfactors More...
 
void calcsvSize () override
 calculates size of stopvector (root function for event driven integration) More...
 
void calcLinkStatusSize () override
 calculates size of vector LinkStatus More...
 
void calcLinkStatusRegSize () override
 calculates size of vector LinkStatusReg More...
 
void init (InitStage stage, const InitConfigSet &config) override
 plots time series header More...
 
bool isSetValued () const override
 asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore set valued More...
 
bool isSingleValued () const override
 asks the link if it contains single valued force laws that contribute to the right-hand side vector h More...
 
void updateLinkStatus () override
 
void updateLinkStatusReg () override
 
bool isActive () const override
 
bool gActiveChanged () override
 
bool detectImpact () override
 
void solveImpactsFixpointSingle () override
 
void solveConstraintsFixpointSingle () override
 
void solveImpactsGaussSeidel () override
 
void solveConstraintsGaussSeidel () override
 
void solveImpactsRootFinding () override
 
void solveConstraintsRootFinding () override
 
void jacobianConstraints () override
 computes JACOBIAN and mass action matrix of nonlinear contact equations More...
 
void jacobianImpacts () override
 computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level More...
 
void updaterFactors () override
 update relaxation factors for contact equations More...
 
void checkConstraintsForTermination () override
 verify underlying force laws concerning given tolerances More...
 
void checkImpactsForTermination () override
 verify underlying force laws on velocity level concerning given tolerances More...
 
void checkActive (int j) override
 check if set-valued contacts are active and set corresponding attributes More...
 
void LinearImpactEstimation (double t, fmatvec::Vec &gInActive_, fmatvec::Vec &gdInActive_, int *IndInActive_, fmatvec::Vec &gAct_, int *IndActive_) override
 get gap distance and calculate gap velocity of unilateral links to estimate impacts within the next step More...
 
void SizeLinearImpactEstimation (int *sizeInActive_, int *sizeActive_) override
 calculates the number of active and inactive unilateral constraints and increments sizeActive/sizeInActive More...
 
void setNormalForceLaw (GeneralizedForceLaw *fcl_)
 
GeneralizedForceLawgetNormalForceLaw () const
 
void setNormalImpactLaw (GeneralizedImpactLaw *fnil_)
 
void setTangentialForceLaw (FrictionForceLaw *fdf_)
 
FrictionForceLawgetTangentialForceLaw () const
 
void setTangentialImpactLaw (FrictionImpactLaw *ftil_)
 
virtual int getFrictionDirections () const
 
void calccorrSize (int j) override
 
void updatecorr (int j) override
 
void checkRoot () override
 
bool isNormalForceLawSetValued () const
 
bool isTangentialForceLawSetValued () const
 
bool isNormalForceLawSetValuedAndActive () const
 
bool isTangentialForceLawSetValuedAndActive () const
 
- Public Member Functions inherited from MBSim::Element
 Element (const std::string &name)
 constructor
 
 ~Element () override=default
 destructor
 
void throwError (const std::string &msg) const
 
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
 sets the used dynamics system solver to the element More...
 
virtual void plot ()
 plots time dependent data More...
 
virtual void plotAtSpecialEvent ()
 plots time dependent data at special events More...
 
const std::string & getName () const
 
void setName (const std::string &str)
 
void setPath (const std::string &str)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
virtual void init (InitStage stage, const InitConfigSet &config=InitConfigSet())
 plots time series header More...
 
virtual void createPlotGroup ()
 creates the plotGroup for H5-output More...
 
H5::GroupBasegetPlotGroup ()
 
virtual H5::GroupBasegetFramesPlotGroup ()
 
virtual H5::GroupBasegetContoursPlotGroup ()
 
virtual H5::GroupBasegetGroupsPlotGroup ()
 
virtual H5::GroupBasegetObjectsPlotGroup ()
 
virtual H5::GroupBasegetLinksPlotGroup ()
 
virtual H5::GroupBasegetConstraintsPlotGroup ()
 
virtual H5::GroupBasegetObserversPlotGroup ()
 
bool getPlotFeature (const PlotFeatureEnum &pf)
 
virtual void setPlotFeature (const PlotFeatureEnum &pf, bool value)
 Set a plot feature. More...
 
void setPlotFeatureForChildren (const PlotFeatureEnum &pf, bool value)
 Set a plot feature for the children of this object. More...
 
void setPlotFeatureRecursive (const PlotFeatureEnum &pf, bool value)
 Set a plot feature for this object and the children of this object. More...
 
template<class T >
void setPlotAttribute (const std::string &name, const T &value)
 Set a plot attribute: static data attached as key/value pairs to the plot datasets/groups.
 
void setPlotAttribute (const std::string &name)
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
template<class T >
T * getByPath (const std::string &path, bool initialCaller=true) const
 Get the object of type T represented by the path path. Do not set any argurment other than path!
 
std::string getPath (const Element *relTo=nullptr, std::string sep="/") const
 Return the path of this object. If relativeTo is not NULL return a relative path to relativeTo. Do not set any argurment other than relTo and sep!
 
virtual ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const
 Get the Element named name in the container named container. More...
 
virtual std::shared_ptr< OpenMBV::GroupgetOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetFramesOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetContoursOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetGroupsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetObjectsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetLinksOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetConstraintsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetObserversOpenMBVGrp ()
 
virtual ElementgetParent ()
 
virtual const ElementgetParent () const
 
virtual void setParent (Element *parent_)
 
std::vector< Element * > getDependencies () const
 checks dependency on other elements. More...
 
void addDependency (Element *ele)
 
int computeLevel ()
 computes the length of the pathes in the graph that represents the dependencies between all elements. More...
 
virtual void updatePositions (Frame *frame)
 
virtual void updateVelocities (Frame *frame)
 
virtual void updateAccelerations (Frame *frame)
 
virtual void updateJacobians (Frame *frame, int j=0)
 
virtual void updateGyroscopicAccelerations (Frame *frame)
 
virtual void resetUpToDate ()
 
const double & getTime () const
 
double getStepSize () const
 
const MBXMLUtils::DOMEvalExceptiongetDOMEvalError () const
 

Public Attributes

void(SingleContact::* updateGeneralizedNormalForce_ )()
 
void(SingleContact::* updateGeneralizedTangentialForce_ )()
 

Protected Types

enum  Direction { normal , tangential , DirectionDIM }
 

Protected Attributes

GeneralizedForceLawfcl {nullptr}
 force laws in normal and tangential direction on acceleration and velocity level
 
FrictionForceLawfdf {nullptr}
 force law defining relation between tangential velocities and tangential forces
 
GeneralizedImpactLawfnil {nullptr}
 force law defining relation between penetration velocity and resulting normal impulses
 
FrictionImpactLawftil {nullptr}
 force law defining relation between tangential velocities and forces impulses
 
fmatvec::Vec laN
 force in normal direction More...
 
fmatvec::Vec LaN
 
fmatvec::Vec laT
 force in tangential direction More...
 
fmatvec::Vec LaT
 
fmatvec::Vec gdN
 relative velocity in normal direction
 
fmatvec::Vec gdT
 relative velocity in tangential direction More...
 
unsigned int gActive {0}
 boolean flag symbolising activity of contact on position level with possibility to save previous time step
 
unsigned int gActive0 {0}
 
std::array< unsigned int, DirectionDIM > gdActive
 boolean flag symbolising activity of contact on velocity level More...
 
std::array< unsigned int, DirectionDIM > gddActive
 boolean flag symbolising activity of contact on acceleration level More...
 
fmatvec::Vec gdnN
 new gap velocity after an impact for event driven scheme
 
fmatvec::Vec gdnT
 
fmatvec::Vec gddN
 gap acceleration for event driven scheme on acceleration level
 
fmatvec::Vec gddT
 
double lambdaN
 
fmatvec::VecV lambdaT
 
bool updlaN {true}
 
bool updlaT {true}
 
fmatvec::Vec gdTDir
 
int rootID {0}
 type of detected root More...
 
- Protected Attributes inherited from MBSim::Element
Elementparent { nullptr }
 
std::string name
 name of element
 
std::string path
 The path of this object. Is set during the init stage reorganizeHierarchy. Before this the path is calculated dynamically using getPath() after this stage getPath just returns this value.
 
MBXMLUtils::DOMEvalException domEvalError
 Special XML helper variable.
 
DynamicSystemSolverds { nullptr }
 dynamic system
 
H5::VectorSerie< double > * plotVectorSerie { nullptr }
 time series
 
std::vector< double > plotVector
 one entry of time series
 
std::vector< std::string > plotColumns
 columns of time series
 
H5::GroupBaseplotGroup { nullptr }
 associated plot group
 
std::vector< Element * > dependency
 vector containing all dependencies.
 
PlotFeatureMap plotFeature
 plot feature
 
PlotFeatureMap plotFeatureForChildren
 
std::map< std::string, std::variant< std::monostate, int, double, std::string, std::vector< int >, std::vector< double >, std::vector< std::vector< double > > > > plotAttribute
 

Friends

class Contact
 
class MaxwellContact
 

Additional Inherited Members

- Public Types inherited from MBSim::Element
enum  InitStage {
  resolveStringRef =0 , preInit , plotting , unknownStage ,
  LASTINITSTAGE
}
 The stages of the initialization. More...
 
- Protected Member Functions inherited from MBSim::Element
void updatePlotFeatures ()
 
void addToPlot (const std::string &name)
 
void addToPlot (const std::string &name, int size)
 
void addToPlot (const std::string &name, const std::vector< std::string > &iname)
 
template<class AT >
void plot (const AT &x)
 
template<class Type , class AT >
void plot (const fmatvec::Vector< Type, AT > &x)
 

Detailed Description

class for contacts

Author
Martin Foerg
Date
2009-04-02 some comments (Thorsten Schindler)
2009-07-16 splitted link / object right hand side (Thorsten Schindler)
2009-08-03 contacts can now visualize their ContactPointFrames (Markus Schneider)
2010-07-06 added LinkStatus and LinearImpactEstimation for timestepper ssc (Robert Huber)
2012-05-08 added LinkStatusReg for AutoTimeSteppingSSCIntegrator (Jan Clauberg)
2014-09-16 contact forces are calculated on acceleration level (Thorsten Schindler)

basic class for contacts between contours, mainly implementing geometrical informations of contact-pairings

Remarks:

  • constitutive laws on acceleration and velocity level have to be set pairwise

Constructor & Destructor Documentation

◆ SingleContact()

MBSim::SingleContact::SingleContact ( const std::string &  name = "")
inline

constructor

Parameters
nameof contact

Member Function Documentation

◆ calccorrSize()

void MBSim::SingleContact::calccorrSize ( int  j)
overridevirtual

Reimplemented from MBSim::Link.

◆ calcgdSize()

void MBSim::SingleContact::calcgdSize ( int  j)
overridevirtual

calculates size of gap velocities

Parameters
flagto decide which contacts are included in the calculation

see SingleContact for the implementation and DynamicSystem for explanation

Reimplemented from MBSim::Link.

◆ calcgSize()

void MBSim::SingleContact::calcgSize ( int  j)
overridevirtual

calculates size of relative distances

Reimplemented from MBSim::Link.

◆ calclaSize()

void MBSim::SingleContact::calclaSize ( int  j)
overridevirtual

calculates size of contact force parameters

Reimplemented from MBSim::Link.

◆ calcLinkStatusRegSize()

void MBSim::SingleContact::calcLinkStatusRegSize ( )
overridevirtual

calculates size of vector LinkStatusReg

Reimplemented from MBSim::Link.

◆ calcLinkStatusSize()

void MBSim::SingleContact::calcLinkStatusSize ( )
overridevirtual

calculates size of vector LinkStatus

Reimplemented from MBSim::Link.

◆ calcrFactorSize()

void MBSim::SingleContact::calcrFactorSize ( int  j)
overridevirtual

calculates size of rfactors

Reimplemented from MBSim::Link.

◆ calcSize()

void MBSim::SingleContact::calcSize ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ calcsvSize()

void MBSim::SingleContact::calcsvSize ( )
overridevirtual

calculates size of stopvector (root function for event driven integration)

Reimplemented from MBSim::Link.

◆ checkActive()

void MBSim::SingleContact::checkActive ( int  j)
overridevirtual

check if set-valued contacts are active and set corresponding attributes

Parameters
flagto decide which criteria are used to define 'activity'

see SingleContact for the implementation and DynamicSystem for explanation

Reimplemented from MBSim::Link.

◆ checkConstraintsForTermination()

void MBSim::SingleContact::checkConstraintsForTermination ( )
overridevirtual

verify underlying force laws concerning given tolerances

Reimplemented from MBSim::Link.

◆ checkImpactsForTermination()

void MBSim::SingleContact::checkImpactsForTermination ( )
overridevirtual

verify underlying force laws on velocity level concerning given tolerances

Reimplemented from MBSim::Link.

◆ checkRoot()

void MBSim::SingleContact::checkRoot ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ detectImpact()

bool MBSim::SingleContact::detectImpact ( )
overridevirtual
Returns
has an impact occured?

Reimplemented from MBSim::Link.

◆ gActiveChanged()

bool MBSim::SingleContact::gActiveChanged ( )
overridevirtual
Returns
has the relative distance vector changed?

Implements MBSim::Link.

◆ getFrictionDirections()

int MBSim::SingleContact::getFrictionDirections ( ) const
virtual
Returns
number of considered friction directions

◆ init()

void MBSim::SingleContact::init ( InitStage  stage,
const InitConfigSet &  config 
)
overridevirtual

plots time series header

Parameters
invocingparent class

Reimplemented from MBSim::ContourLink.

◆ isActive()

bool MBSim::SingleContact::isActive ( ) const
overridevirtual
Returns
are link equations active?

Implements MBSim::Link.

◆ isSetValued()

bool MBSim::SingleContact::isSetValued ( ) const
overridevirtual

asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore set valued

Returns
set valued force laws used within the link?

Reimplemented from MBSim::Link.

◆ isSingleValued()

bool MBSim::SingleContact::isSingleValued ( ) const
overridevirtual

asks the link if it contains single valued force laws that contribute to the right-hand side vector h

Returns
single valued force laws used within link?

Reimplemented from MBSim::Link.

◆ jacobianConstraints()

void MBSim::SingleContact::jacobianConstraints ( )
overridevirtual

computes JACOBIAN and mass action matrix of nonlinear contact equations

Reimplemented from MBSim::Link.

◆ jacobianImpacts()

void MBSim::SingleContact::jacobianImpacts ( )
overridevirtual

computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level

Reimplemented from MBSim::Link.

◆ LinearImpactEstimation()

void MBSim::SingleContact::LinearImpactEstimation ( double  t,
fmatvec::Vec &  gInActive_,
fmatvec::Vec &  gdInActive_,
int *  IndInActive_,
fmatvec::Vec &  gAct_,
int *  IndActive_ 
)
overridevirtual

get gap distance and calculate gap velocity of unilateral links to estimate impacts within the next step

Parameters
gInActivegap distance of inactive links (return)
gdInActivegap velocities of inactive links (return)
IndInActiveindex for gInActive/gdInActive; incremented with size after storage (return and input)
gActgap distance of active links (return)
IndActiveindex for gActive; incremented with size after storage (return and input)

Reimplemented from MBSim::Link.

◆ resetUpToDate()

void MBSim::SingleContact::resetUpToDate ( )
overridevirtual

Reimplemented from MBSim::ContourLink.

◆ SizeLinearImpactEstimation()

void MBSim::SingleContact::SizeLinearImpactEstimation ( int *  sizeInActive_,
int *  sizeActive_ 
)
overridevirtual

calculates the number of active and inactive unilateral constraints and increments sizeActive/sizeInActive

Reimplemented from MBSim::Link.

◆ solveConstraintsFixpointSingle()

void MBSim::SingleContact::solveConstraintsFixpointSingle ( )
overridevirtual

solve contact equations of motion with single step fixed point scheme

Reimplemented from MBSim::Link.

◆ solveConstraintsGaussSeidel()

void MBSim::SingleContact::solveConstraintsGaussSeidel ( )
overridevirtual

solve contact equations of motion with Gauss-Seidel scheme

Reimplemented from MBSim::Link.

◆ solveConstraintsRootFinding()

void MBSim::SingleContact::solveConstraintsRootFinding ( )
overridevirtual

solve contact equations of motion with Newton scheme

Reimplemented from MBSim::Link.

◆ solveImpactsFixpointSingle()

void MBSim::SingleContact::solveImpactsFixpointSingle ( )
overridevirtual

solve impact equations of motion with single step fixed point scheme on velocity level

Parameters
timestep-size

Reimplemented from MBSim::Link.

◆ solveImpactsGaussSeidel()

void MBSim::SingleContact::solveImpactsGaussSeidel ( )
overridevirtual

solve impact equations of motion with Gauss-Seidel scheme on velocity level

Parameters
timestep-size

Reimplemented from MBSim::Link.

◆ solveImpactsRootFinding()

void MBSim::SingleContact::solveImpactsRootFinding ( )
overridevirtual

solve impact equations of motion with Newton scheme on velocity level

Parameters
timestep-size

Reimplemented from MBSim::Link.

◆ updatecorr()

void MBSim::SingleContact::updatecorr ( int  j)
overridevirtual

Reimplemented from MBSim::Link.

◆ updateg()

void MBSim::SingleContact::updateg ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updategd()

void MBSim::SingleContact::updategd ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updategdRef()

void MBSim::SingleContact::updategdRef ( fmatvec::Vec &  ref)
overridevirtual

references to contact relative velocities of dynamic system parent

Reimplemented from MBSim::Link.

◆ updateGeneralizedForces()

void MBSim::SingleContact::updateGeneralizedForces ( )
overridevirtual

Reimplemented from MBSim::MechanicalLink.

◆ updateGeneralizedPositions()

void MBSim::SingleContact::updateGeneralizedPositions ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updateGeneralizedVelocities()

void MBSim::SingleContact::updateGeneralizedVelocities ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updateh()

void MBSim::SingleContact::updateh ( int  i = 0)
overridevirtual

Reimplemented from MBSim::Link.

◆ updatelaRef()

void MBSim::SingleContact::updatelaRef ( fmatvec::Vec &  ref)
overridevirtual

references to contact force parameter of dynamic system parent

Reimplemented from MBSim::Link.

◆ updateLaRef()

void MBSim::SingleContact::updateLaRef ( fmatvec::Vec &  ref)
overridevirtual

references to contact force parameter of dynamic system parent

Reimplemented from MBSim::Link.

◆ updateLinkStatus()

void MBSim::SingleContact::updateLinkStatus ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updateLinkStatusReg()

void MBSim::SingleContact::updateLinkStatusReg ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updatePositions()

void MBSim::SingleContact::updatePositions ( Frame frame)
overridevirtual

Reimplemented from MBSim::Element.

◆ updaterFactors()

void MBSim::SingleContact::updaterFactors ( )
overridevirtual

update relaxation factors for contact equations

Reimplemented from MBSim::Link.

◆ updateStopVector()

void MBSim::SingleContact::updateStopVector ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updateStopVectorParameters()

void MBSim::SingleContact::updateStopVectorParameters ( )
overridevirtual

Reimplemented from MBSim::Link.

◆ updateV()

void MBSim::SingleContact::updateV ( int  i = 0)
overridevirtual

Reimplemented from MBSim::Link.

◆ updateW()

void MBSim::SingleContact::updateW ( int  i = 0)
overridevirtual

Reimplemented from MBSim::Link.

◆ updatewb()

void MBSim::SingleContact::updatewb ( )
overridevirtual

Reimplemented from MBSim::Link.

Member Data Documentation

◆ gdActive

std::array<unsigned int, DirectionDIM> MBSim::SingleContact::gdActive
protected

boolean flag symbolising activity of contact on velocity level

gdActive[normal] = normal direction; gdActive[tangential] = tangential direction

◆ gddActive

std::array<unsigned int, DirectionDIM> MBSim::SingleContact::gddActive
protected

boolean flag symbolising activity of contact on acceleration level

gddActive[normal] = normal direction; gddActive[tangential] = tangential direction

◆ gdT

fmatvec::Vec MBSim::SingleContact::gdT
protected

relative velocity in tangential direction

Todo:
: use fixed size?

◆ laN

fmatvec::Vec MBSim::SingleContact::laN
protected

force in normal direction

Todo:
: only double needed here

◆ laT

fmatvec::Vec MBSim::SingleContact::laT
protected

force in tangential direction

Todo:
: use fixed size?

◆ rootID

int MBSim::SingleContact::rootID {0}
protected

type of detected root

1 = close-open transition / stick-slip transition 2 = slip-stick transition 3 = open-close transition, i.e., impact


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