23 #include "mbsim/element.h"
24 #include "mbsim/mbsim_event.h"
65 virtual void updateg(
double t) = 0;
66 virtual void updategd(
double t) = 0;
67 virtual void updatewb(
double t,
int i=0) {};
68 virtual void updateW(
double t,
int i=0) {};
69 virtual void updateV(
double t,
int i=0) {};
70 virtual void updateh(
double t,
int i=0) {};
71 virtual void updateStopVector(
double t) {}
72 virtual void updateLinkStatus(
double t) {}
73 virtual void updateLinkStatusReg(
double t) {}
74 virtual void updateJacobians(
double t,
int j=0) {}
75 virtual void updateb(
double t) {};
79 virtual void updatedx(
double t,
double dt) {}
80 virtual void updatexd(
double t) {}
81 virtual void calcxSize() {
xSize = 0; }
84 virtual void setxInd(
int xInd_) { xInd = xInd_; };
85 virtual int getxSize()
const {
return xSize; }
95 virtual void setbInd(
int bInd_) { bInd = bInd_; };
98 std::string
getType()
const {
return "Link"; }
99 virtual void plot(
double t,
double dt = 1);
167 virtual void updatejsvRef(
const fmatvec::VecInt &jsvParent);
299 virtual void jacobianImpacts() { THROW_MBSIMERROR(
"(Link::jacobianImpacts): Not implemented."); }
304 virtual void updaterFactors() { THROW_MBSIMERROR(
"(Link::updaterFactors): Not implemented."); }
329 virtual void setlaTol(
double tol) { laTol = tol; }
330 virtual void setLaTol(
double tol) { LaTol = tol; }
331 virtual void setgTol(
double tol) {
gTol = tol; }
332 virtual void setgdTol(
double tol) { gdTol = tol; }
333 virtual void setgddTol(
double tol) { gddTol = tol; }
334 virtual void setrMax(
double rMax_) {
rMax = rMax_; }
335 virtual void setLinkStatusInd(
int LinkStatusInd_) { LinkStatusInd = LinkStatusInd_; };
336 virtual void setLinkStatusRegInd(
int LinkStatusRegInd_) { LinkStatusRegInd = LinkStatusRegInd_; };
339 virtual void setgdInd(
int gdInd_) { gdInd = gdInd_; }
340 virtual void setrFactorInd(
int rFactorInd_) { rFactorInd = rFactorInd_; }
355 virtual void updatecorr(
int j) { corr.init(0); }
357 virtual void calccorrSize(
int j) { corrSize = 0; }
358 virtual void setcorrInd(
int corrInd_) { corrInd = corrInd_; }
359 virtual void checkRoot() {};
363 const std::vector<fmatvec::Mat>& getW(
int i=0)
const {
return W[i]; }
364 const std::vector<fmatvec::Mat>& getV(
int i=0)
const {
return V[i]; }
365 const std::vector<fmatvec::Vec>& geth(
int i=0)
const {
return h[i]; }
370 virtual void setsvInd(
int svInd_) { svInd = svInd_; };
371 int getsvSize()
const {
return svSize; }
379 int getlaInd()
const {
return laInd; }
380 int getlaSize()
const {
return laSize; }
381 int getbSize()
const {
return bSize; }
390 int getgdInd()
const {
return gdInd; }
391 int getgSize()
const {
return gSize; }
392 int getgdSize()
const {
return gdSize; }
397 const fmatvec::VecInt& getrFactorUnsure()
const {
return rFactorUnsure; }
402 void savela(
double dt=1.0);
407 void initla(
double dt=1.0);
415 int getcorrSize()
const {
return corrSize; }
513 double gTol, gdTol, gddTol, laTol, LaTol;
548 std::vector<fmatvec::Mat>
W[2];
553 std::vector<fmatvec::Mat>
V[2];
558 std::vector<fmatvec::Vec>
h[2];
563 std::vector<fmatvec::Mat>
dhdq;
564 std::vector<fmatvec::Mat> dhdu;
565 std::vector<fmatvec::Vec> dhdt;
570 std::vector<fmatvec::Vec>
r[2];
582 int corrSize, corrInd;
virtual void updateVRef(const fmatvec::Mat &ref, int i=0)=0
references to condensed contact force direction matrix of dynamic system parent
virtual void updateWRef(const fmatvec::Mat &ref, int i=0)=0
references to contact force direction matrix of dynamic system parent
fmatvec::Vec x
order one parameters
Definition: link.h:421
virtual bool hasSmoothPart() const
Definition: link.h:241
std::vector< fmatvec::Mat > V[2]
reduced force direction matrix for nonsmooth right hand side
Definition: link.h:553
fmatvec::Vec x0
order one initial value
Definition: link.h:431
void decreaserFactors()
decrease rfactor if mass action matrix is not diagonal dominant (cf. Foerg: Dissertation, page 80 et seq.)
Definition: link.cc:194
virtual bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: link.h:227
double rMax
maximum r-factor
Definition: link.h:538
fmatvec::Vec g
relative distance, relative velocity, contact force parameters
Definition: link.h:478
general link to one or more objects
Definition: link.h:51
virtual void updatejsvRef(const fmatvec::VecInt &jsvParent)
references to stopvector evaluation of dynamic system parent (root detection with corresponding bool ...
Definition: link.cc:116
virtual ~Link()
destructor
Definition: link.h:62
fmatvec::VecInt LinkStatusReg
status of link
Definition: link.h:468
fmatvec::Mat b
TODO.
Definition: link.h:580
int laSize
size and local index of contact force parameters
Definition: link.h:498
int gdSize
size and local index of relative velocities
Definition: link.h:493
fmatvec::Vec sv
stop vector for event driven integration (root function)
Definition: link.h:441
virtual void solveConstraintsRootFinding()
Definition: link.h:289
virtual void calcgSize(int j)
calculates size of relative distances
Definition: link.h:187
int xSize
size and local index of order one parameters
Definition: link.h:436
int bSize
size and local index of contact force parameters
Definition: link.h:503
Link(const std::string &name)
constructor
Definition: link.cc:35
virtual void closePlot()
closes plot file
Definition: link.cc:70
virtual void updaterFactorRef(const fmatvec::Vec &ref)
references to rfactors of dynamic system parent
Definition: link.cc:108
std::vector< fmatvec::Vec > h[2]
smooth complete and link right hand side
Definition: link.h:558
fmatvec::VecInt LinkStatus
status of link (default 0) describing which piece of the equation is valid (e.g. stick or slip) ...
Definition: link.h:457
fmatvec::Vec rFactor
vector of rfactors for relaxation of contact equations
Definition: link.h:523
void initla(double dt=1.0)
load contact force parameters for use as starting value
Definition: link.cc:187
virtual bool detectImpact()
Definition: link.h:256
virtual void updatelaRef(const fmatvec::Vec &ref)
references to contact force parameter of dynamic system parent
Definition: link.cc:88
fmatvec::VecInt jsv
evaluation of roots of stop vector with a boolean vector
Definition: link.h:446
virtual void updatesvRef(const fmatvec::Vec &sv)
references to stopvector of dynamic system parent (root function for event driven integration) ...
Definition: link.cc:112
basic class of MBSim mainly for plotting
Definition: element.h:58
int LinkStatusSize
size and local index of link status vector (set-valued)
Definition: link.h:462
virtual void solveImpactsGaussSeidel(double dt)
Definition: link.h:273
virtual void updaterRef(const fmatvec::Vec &ref, int i=0)=0
references to nonsmooth force vector of dynamic system parent
virtual void checkActive(int j)
check if set-valued contacts are active and set corresponding attributes
Definition: link.h:322
virtual void updategdRef(const fmatvec::Vec &ref)
references to contact relative velocities of dynamic system parent
Definition: link.cc:100
fmatvec::Vec la0
attribute to save contact force parameter of previous time step
Definition: link.h:518
virtual bool isActive() const =0
virtual void init(InitStage stage)
plots time series header
Definition: link.cc:134
virtual void solveConstraintsGaussSeidel()
Definition: link.h:278
virtual void deletelaRef()
delete reference to contact force parameter of dynamic system parent
Definition: link.cc:92
virtual void calcbSize()
calculates size of rfactors
Definition: link.h:205
std::vector< fmatvec::Mat > W[2]
force direction matrix for nonsmooth right hand side
Definition: link.h:548
void savela(double dt=1.0)
saves contact force parameters for use as starting value in next time step
Definition: link.cc:183
virtual void jacobianImpacts()
computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level ...
Definition: link.h:299
virtual void updatehRef(const fmatvec::Vec &hRef, int i=0)=0
references to complete and link smooth force vector of dynamic system parent
virtual void checkConstraintsForTermination()
verify underlying force laws concerning given tolerances
Definition: link.h:314
InitStage
The stages of the initialization.
Definition: element.h:97
int svSize
size and local index of stop vector
Definition: link.h:451
virtual void SizeLinearImpactEstimation(int *sizeInActive_, int *sizeActive_)
calculates the number of active and inactive unilateral constraints and increments sizeActive/sizeInA...
Definition: link.h:354
virtual void calcsvSize()
calculates size of stopvector (root function for event driven integration)
Definition: link.h:210
std::vector< fmatvec::Vec > r[2]
nonsmooth right hand side
Definition: link.h:570
fmatvec::Index Ig
local index of relative distances and contact force parameters
Definition: link.h:508
std::string name
name of element
Definition: element.h:290
virtual void updatewbRef(const fmatvec::Vec &ref)
references to TODO of dynamic system parent
Definition: link.cc:76
std::string getType() const
Definition: link.h:98
virtual void solveConstraintsFixpointSingle()
Definition: link.h:267
fmatvec::Vec laS
contact forces of smooth contact laws
Definition: link.h:483
virtual void plot(double t, double dt=1)
plots time dependent data
Definition: link.cc:41
virtual double computePotentialEnergy()
compute potential energy
Definition: link.h:327
virtual void solveImpactsFixpointSingle(double dt)
Definition: link.h:262
virtual void calcLinkStatusSize()
calculates size of vector LinkStatus
Definition: link.h:215
virtual void updateLinkStatusRef(const fmatvec::VecInt &LinkStatusParent)
reference to vector of link status (for set valued links with piecewise link equations) ...
Definition: link.cc:120
fmatvec::Vec res
Definition: link.h:543
virtual void calcrFactorSize(int j)
calculates size of rfactors
Definition: link.h:200
virtual void updaterFactors()
update relaxation factors for contact equations
Definition: link.h:304
double gTol
tolerance for relative velocity, relative acceleration, force and impact
Definition: link.h:513
virtual bool gActiveChanged()=0
std::vector< fmatvec::Mat > dhdq
smooth Jacobians for implicit integration
Definition: link.h:563
virtual void calcLinkStatusRegSize()
calculates size of vector LinkStatusReg
Definition: link.h:220
virtual void updateresRef(const fmatvec::Vec &ref)
references to residuum of nonlinear contact equations of dynamic system parent
Definition: link.cc:104
int gSize
size and local index of relative distances
Definition: link.h:488
virtual void LinearImpactEstimation(fmatvec::Vec &gInActive_, fmatvec::Vec &gdInActive_, int *IndInActive_, fmatvec::Vec &gAct_, int *IndActive_)
get gap distance and calculate gap velocity of unilateral links to estimate impacts within the next s...
Definition: link.h:349
int LinkStatusRegSize
size and local index of single-valued link status vector
Definition: link.h:473
virtual void checkImpactsForTermination(double dt)
verify underlying force laws on velocity level concerning given tolerances
Definition: link.h:309
fmatvec::Vec wb
TODO.
Definition: link.h:575
virtual void jacobianConstraints()
computes JACOBIAN and mass action matrix of nonlinear contact equations
Definition: link.h:294
virtual bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: link.h:234
int rFactorSize
size and local index of rfactors
Definition: link.h:533
fmatvec::VecInt rFactorUnsure
boolean vector defining if rfactor belongs to not diagonal dominant mass action matrix (cf...
Definition: link.h:528
virtual void calcgdSize(int j)
calculates size of gap velocities
Definition: link.h:195
fmatvec::Vec xd
differentiated order one parameters
Definition: link.h:426
virtual void updateLinkStatusRegRef(const fmatvec::VecInt &LinkStatusRegParent)
reference to vector of link status (for single-valued links)
Definition: link.cc:124
virtual void solveImpactsRootFinding(double dt)
Definition: link.h:284
virtual void calclaSize(int j)
calculates size of contact force parameters
Definition: link.h:182
virtual void updategRef(const fmatvec::Vec &ref)
references to contact relative distances of dynamic system parent
Definition: link.cc:96