mbsim  4.0.0
MBSim Kernel
Classes | Public Member Functions | Protected Attributes | Private Attributes | List of all members
MBSim::MaxwellContact Class Reference

class for maxwell contacts More...

#include <maxwell_contact.h>

Inheritance diagram for MBSim::MaxwellContact:
[legend]

Classes

struct  saved_references
 
struct  xmlInfo
 

Public Member Functions

 MaxwellContact (const std::string &name="")
 constructor More...
 
 ~MaxwellContact () override
 destructor
 
void updatewb () override
 
void updateW (int i=0) override
 
void updateV (int i=0) override
 
void updateh (int i=0) override
 
void updateg () override
 
void updategd () override
 
void updateStopVector () override
 
void updateJacobians (int j=0) override
 
void updateWRef (fmatvec::Mat &ref, int j=0) override
 references to contact force direction matrix of dynamic system parent
 
void updateVRef (fmatvec::Mat &ref, int j=0) override
 references to condensed contact force direction matrix of dynamic system parent
 
void updatehRef (fmatvec::Vec &hRef, int j=0) override
 references to complete and link smooth force vector of dynamic system parent
 
void updaterRef (fmatvec::Vec &hRef, int j=0) override
 references to nonsmooth force vector of dynamic system parent
 
void updatewbRef (fmatvec::Vec &ref) override
 references to TODO of dynamic system parent
 
void updatelaRef (fmatvec::Vec &ref) override
 references to contact force parameter of dynamic system parent
 
void updateLaRef (fmatvec::Vec &ref) override
 references to contact force parameter of dynamic system parent
 
void updategRef (fmatvec::Vec &ref) override
 references to contact relative distances of dynamic system parent
 
void updategdRef (fmatvec::Vec &ref) override
 references to contact relative velocities of dynamic system parent
 
void updateresRef (fmatvec::Vec &ref) override
 references to residuum of nonlinear contact equations of dynamic system parent
 
void updaterFactorRef (fmatvec::Vec &ref) override
 references to rfactors of dynamic system parent
 
void updatesvRef (fmatvec::Vec &ref) override
 references to stopvector of dynamic system parent (root function for event driven integration)
 
void updatejsvRef (fmatvec::VecInt &ref) override
 references to stopvector evaluation of dynamic system parent (root detection with corresponding bool array by event driven integrator)
 
void updateLinkStatusRef (fmatvec::VecInt &LinkStatusParent) override
 reference to vector of link status (for set valued links with piecewise link equations)
 
void updateLinkStatusRegRef (fmatvec::VecInt &LinkStatusRegParent) override
 reference to vector of link status (for single-valued links)
 
void calclaSize (int j) override
 calculates size of contact force parameters
 
void calcgSize (int j) override
 calculates size of relative distances
 
void calcgdSize (int j) override
 calculates size of gap velocities More...
 
void calcrFactorSize (int j) override
 calculates size of rfactors
 
void calcsvSize () override
 calculates size of stopvector (root function for event driven integration)
 
void calcLinkStatusSize () override
 calculates size of vector LinkStatus
 
void calcLinkStatusRegSize () override
 calculates size of vector LinkStatusReg
 
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
 
void jacobianImpacts () override
 computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level
 
void updaterFactors () override
 update relaxation factors for contact equations
 
void checkConstraintsForTermination () override
 verify underlying force laws concerning given tolerances
 
void checkImpactsForTermination () override
 verify underlying force laws on velocity level concerning given tolerances
 
void checkActive (int j) override
 check if set-valued contacts are active and set corresponding attributes More...
 
void setGeneralizedForceTolerance (double tol) override
 
void setGeneralizedImpulseTolerance (double tol) override
 
void setGeneralizedRelativePositionTolerance (double tol) override
 
void setGeneralizedRelativeVelocityTolerance (double tol) override
 
void setGeneralizedRelativeAccelerationTolerance (double tol) override
 
void setrMax (double rMax_) override
 
void setLinkStatusInd (int LinkStatusInd_) override
 
void setLinkStatusRegInd (int LinkStatusRegInd_) override
 
void setsvInd (int svInd_) override
 
void setlaInd (int laInd_) override
 
void setgInd (int gInd_) override
 
void setgdInd (int gdInd_) override
 
void setrFactorInd (int rFactorInd_) override
 
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
 
void updatecorrRef (fmatvec::Vec &ref) override
 
void updatecorr (int j) override
 
void calccorrSize (int j) override
 
void setcorrInd (int corrInd_) override
 
void checkRoot () override
 
void plot () override
 plots time dependent data More...
 
void setDynamicSystemSolver (DynamicSystemSolver *sys) override
 sets the used dynamics system solver to the element More...
 
void resetUpToDate () override
 
void setNormalForceLaw (GeneralizedForceLaw *fcl_)
 
GeneralizedForceLaw * getNormalForceLaw () const
 
void setNormalImpactLaw (GeneralizedImpactLaw *fnil_)
 
void setTangentialForceLaw (FrictionForceLaw *fdf_)
 
void setTangentialImpactLaw (FrictionImpactLaw *ftil_)
 
void setContactKinematics (ContactKinematics *ck, size_t index=0)
 
ContactKinematics * getContactKinematics (size_t index=0) const
 
ContactKinematics * findContactKinematics (const std::string &cKName) const
 
const std::vector< std::vector< SingleContact > > & getSubcontacts () const
 
virtual void setPlotFeatureContactKinematics (std::string cKName, std::size_t pf, bool value)
 
virtual int getFrictionDirections ()
 
void connect (Contour *contour1, Contour *contour2, ContactKinematics *contactKinematics=nullptr, const std::string &name="")
 
Contour * getContour (int i, int j=0)
 
SingleContact & getSingleContact (int i, int j=0)
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
void setSearchAllContactPoints (bool searchAllCP_)
 
void setInitialGuess (const fmatvec::MatV &zeta0_)
 
void setTolerance (double tol_)
 set tolerance for root-finding
 
virtual void initializeContourCouplings ()
 
void addContourCoupling (Contour *contour1, Contour *contour2, InfluenceFunction *fct)
 add a function that represents the coupling between two contours More...
 
void setDampingCoefficient (double d)
 
void setGapLimit (double gLim_)
 
virtual void updatePossibleContactPoints ()
 saves all possible contacts in a vector
 
virtual void updateInfluenceMatrix ()
 updates the influence matrix C More...
 
void updateRigidBodyGap ()
 update the rigid body distances (gaps) for the single contacts
 
virtual double computeInfluenceCoefficient (const std::pair< int, int > &contactIndex)
 computes the coupling factor for the influence matrix on one contact point (two contours) More...
 
virtual double computeInfluenceCoefficient (const std::pair< int, int > &contactIndex, const std::pair< int, int > &couplingContactIndex)
 computes the coupling factor for the influence matrix between two contact points (four contours) More...
 
virtual void computeMaterialConstant ()
 
void updateGeneralizedPositions () override
 
void updateGeneralizedForces () override
 
- 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 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)
 
DynamicSystemSolver * getDynamicSystemSolver ()
 
virtual void createPlotGroup ()
 creates the plotGroup for H5-output
 
H5::GroupBase * getPlotGroup ()
 
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 >
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 Element * getChildByContainerAndName (const std::string &container, const std::string &name) const
 Get the Element named name in the container named container.
 
virtual std::shared_ptr< OpenMBV::Group > getOpenMBVGrp ()
 
virtual Element * getParent ()
 
virtual const Element * getParent () 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)
 
const double & getTime () const
 
double getStepSize () const
 
const MBXMLUtils::DOMEvalException & getDOMEvalError () const
 
- Public Member Functions inherited from fmatvec::Atom
Atom & operator= (const Atom &)
 
void setMessageStreamActive (MsgType type, bool activeFlag)
 
void getMessageStream (MsgType type, std::shared_ptr< bool > &a, std::shared_ptr< std::ostream > &s) const
 
void adoptMessageStreams (const Atom *src=nullptr)
 
std::ostream & msg (MsgType type) const
 
bool msgAct (MsgType type) const
 

Protected Attributes

std::vector< std::vector< SingleContact > > contacts
 list of the single sub-contact(-points)
 
std::vector< ContactKinematics * > contactKinematics
 list of the single contact kinematics
 
std::vector< std::vector< Contour * > > contour
 
std::vector< std::string > ckNames
 names for the contact kinematics More...
 
std::map< std::pair< std::string, std::size_t >, bool > plotFeatureMap
 plotFeatures of sub-contacts More...
 
GeneralizedForceLaw * fcl
 force laws in normal and tangential direction on acceleration and velocity level
 
FrictionForceLaw * fdf
 force law defining relation between tangential velocities and tangential forces
 
GeneralizedImpactLaw * fnil
 force law defining relation between penetration velocity and resulting normal impulses
 
FrictionImpactLaw * ftil
 force law defining relation between tangential velocities and forces impulses
 
bool searchAllCP
 
fmatvec::MatV zeta0
 
double tol
 tolerance for root-finding
 
std::vector< std::pair< int, int > > possibleContactPoints
 saves the indices of all active contacts in pairs More...
 
LinearComplementarityProblem LCP
 variable for the LCP
 
fmatvec::SymMat C
 Influence matrix between contact points.
 
fmatvec::Vec rigidBodyGap
 
std::map< std::pair< Contour *, Contour * >, InfluenceFunction * > influenceFunctions
 saves the influence functions for a pair of contours. The key is the pair of contour names
 
fmatvec::Vec solution0
 Solution of the last time, where contact has to be solved (can be used as starting guess for the next algorithm)
 
double dampingCoefficient
 coefficient for possible contact damping
 
double gLim
 relative contact point distance limit under which damping is active
 
double matConst
 parameter for guessing starting values of contact force (average eigenvalue of influence-matrix)
 
bool matConstSetted
 parameter to save if matConst has been computed already
 
- Protected Attributes inherited from MBSim::Element
Element * parent
 
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.
 
DynamicSystemSolver * ds
 dynamic system
 
H5::VectorSerie< double > * plotVectorSerie
 time series
 
std::vector< double > plotVector
 one entry of time series
 
std::vector< std::string > plotColumns
 columns of time series
 
H5::GroupBase * plotGroup
 associated plot group
 
std::vector< Element * > dependency
 vector containing all dependencies.
 
PlotFeatureMap plotFeature
 plot feature
 
PlotFeatureMap plotFeatureForChildren
 

Private Attributes

std::vector< saved_references > saved_ref
 
std::vector< xmlInfo > referenceXML
 

Additional Inherited Members

- Public Types inherited from MBSim::Element
enum  InitStage {
  resolveStringRef =0, preInit, plotting, unknownStage,
  LASTINITSTAGE
}
 The stages of the initialization. More...
 
- Public Types inherited from fmatvec::Atom
enum  MsgType
 
- Static Public Member Functions inherited from fmatvec::Atom
static void setCurrentMessageStream (MsgType type, const std::shared_ptr< bool > &a=std::make_shared< bool >(true), const std::shared_ptr< std::ostream > &s=std::make_shared< std::ostream >(std::cout.rdbuf()))
 
static std::ostream & msgStatic (MsgType type)
 
static bool msgActStatic (MsgType type)
 
- Protected Member Functions inherited from MBSim::Element
void updatePlotFeatures ()
 
- Protected Member Functions inherited from fmatvec::Atom
 Atom (const Atom &src)
 

Detailed Description

class for maxwell contacts

Author
Martin Foerg

Constructor & Destructor Documentation

◆ MaxwellContact()

MBSim::MaxwellContact::MaxwellContact ( const std::string &  name = "")

constructor

Parameters
nameof contact

Member Function Documentation

◆ addContourCoupling()

void MBSim::MaxwellContact::addContourCoupling ( Contour *  contour1,
Contour *  contour2,
InfluenceFunction *  fct 
)

add a function that represents the coupling between two contours

Parameters
nameof first contour
nameof second contour
Functionto describe coupling between contours

\General Remark: The parameters (LagrangeParameterPositions) of the function have to be in the same order as it was given the add(...)-method

◆ calcgdSize()

void MBSim::MaxwellContact::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.

◆ checkActive()

void MBSim::MaxwellContact::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.

◆ computeInfluenceCoefficient() [1/2]

double MBSim::MaxwellContact::computeInfluenceCoefficient ( const std::pair< int, int > &  contactIndex)
virtual

computes the coupling factor for the influence matrix on one contact point (two contours)

Parameters
contoursvector of contours that are part of the contact
cpDatavector of ContourPointDatas
contactIndexindex pair of contact point

◆ computeInfluenceCoefficient() [2/2]

double MBSim::MaxwellContact::computeInfluenceCoefficient ( const std::pair< int, int > &  contactIndex,
const std::pair< int, int > &  couplingContactIndex 
)
virtual

computes the coupling factor for the influence matrix between two contact points (four contours)

Parameters
contoursvector of contours that are part of the contact
cpDatavector of ContourPointDatas
contactIndexindex pair of contact point
coupledContactIndexindex pair of coupling contact point

◆ connect()

void MBSim::MaxwellContact::connect ( Contour *  contour1,
Contour *  contour2,
ContactKinematics *  contactKinematics = nullptr,
const std::string &  name = "" 
)

connect two contours

Parameters
contour0first contour
contour1second contour
contactKinematicsThe contact kinematics that should be used to compute the contact point.
nameName of the contact in the output

◆ detectImpact()

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

Reimplemented from MBSim::Link.

◆ gActiveChanged()

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

Implements MBSim::Link.

◆ getFrictionDirections()

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

◆ init()

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

plots time series header

Parameters
invocingparent class

Reimplemented from MBSim::Link.

◆ isActive()

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

Implements MBSim::Link.

◆ isSetValued()

bool MBSim::MaxwellContact::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::MaxwellContact::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.

◆ LinearImpactEstimation()

void MBSim::MaxwellContact::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.

◆ plot()

void MBSim::MaxwellContact::plot ( )
overridevirtual

plots time dependent data

Parameters
simulationtime
simulationtime step size for derivative calculation

Reimplemented from MBSim::Link.

◆ setDynamicSystemSolver()

void MBSim::MaxwellContact::setDynamicSystemSolver ( DynamicSystemSolver *  sys)
overridevirtual

sets the used dynamics system solver to the element

Parameters
pointerto the dynamic system solver of which the element is part of

Reimplemented from MBSim::Element.

◆ solveConstraintsFixpointSingle()

void MBSim::MaxwellContact::solveConstraintsFixpointSingle ( )
overridevirtual

solve contact equations of motion with single step fixed point scheme

Reimplemented from MBSim::Link.

◆ solveConstraintsGaussSeidel()

void MBSim::MaxwellContact::solveConstraintsGaussSeidel ( )
overridevirtual

solve contact equations of motion with Gauss-Seidel scheme

Reimplemented from MBSim::Link.

◆ solveConstraintsRootFinding()

void MBSim::MaxwellContact::solveConstraintsRootFinding ( )
overridevirtual

solve contact equations of motion with Newton scheme

Reimplemented from MBSim::Link.

◆ solveImpactsFixpointSingle()

void MBSim::MaxwellContact::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::MaxwellContact::solveImpactsGaussSeidel ( )
overridevirtual

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

Parameters
timestep-size

Reimplemented from MBSim::Link.

◆ solveImpactsRootFinding()

void MBSim::MaxwellContact::solveImpactsRootFinding ( )
overridevirtual

solve impact equations of motion with Newton scheme on velocity level

Parameters
timestep-size

Reimplemented from MBSim::Link.

◆ updateInfluenceMatrix()

void MBSim::MaxwellContact::updateInfluenceMatrix ( )
virtual

updates the influence matrix C

Parameters
contoursvector of contours that are part of the contact
cpDatavector of ContourPointDatas

Member Data Documentation

◆ ckNames

std::vector<std::string> MBSim::MaxwellContact::ckNames
protected

names for the contact kinematics

Todo:
: what really is annoying is the fact, that due to the concept of the compound contour the sub contacts can not be build when the contours are connected. Thus it is not possible before the contact kinematics are assigned (what happens in the preInit-stage) that plot featers (and everything else, like names for the plot and so on) can not be set before. Thus this properties have to be saved in a special list in the multiple contact or the things are set later on...

◆ plotFeatureMap

std::map<std::pair<std::string, std::size_t>, bool> MBSim::MaxwellContact::plotFeatureMap
protected

plotFeatures of sub-contacts

Todo:
: see remark of ckNames

◆ possibleContactPoints

std::vector<std::pair<int, int> > MBSim::MaxwellContact::possibleContactPoints
protected

saves the indices of all active contacts in pairs

pair.first: number of contact kinematics pair.second: number of subcontact point of contact kinematics


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