23 #include "mbsim/element.h"
24 #include "mbsim/mbsim_event.h"
60 virtual void updateg() { }
61 virtual void updategd() { }
62 virtual void updatewb() { }
63 virtual void updateW(
int i=0) { }
64 virtual void updateV(
int i=0) { }
65 virtual void updateh(
int i=0) { }
66 virtual void updateStopVector() { }
67 virtual void updateLinkStatus() { }
68 virtual void updateLinkStatusReg() { }
69 virtual void updateJacobians(
int j=0) { }
70 virtual void updateb() { }
74 virtual void updatedx() { }
75 virtual void updatexd() { }
76 virtual void calcxSize() {
xSize = 0; }
79 virtual void setxInd(
int xInd_) { xInd = xInd_; };
80 virtual int getxSize()
const {
return xSize; }
91 virtual void setbInd(
int bInd_) { bInd = bInd_; };
94 std::string
getType()
const {
return "Link"; }
168 virtual void updatejsvRef(
const fmatvec::VecInt &jsvParent);
300 virtual void jacobianImpacts() { THROW_MBSIMERROR(
"(Link::jacobianImpacts): Not implemented."); }
305 virtual void updaterFactors() { THROW_MBSIMERROR(
"(Link::updaterFactors): Not implemented."); }
330 virtual void setlaTol(
double tol) { laTol = tol; }
331 virtual void setLaTol(
double tol) { LaTol = tol; }
332 virtual void setgTol(
double tol) {
gTol = tol; }
333 virtual void setgdTol(
double tol) { gdTol = tol; }
334 virtual void setgddTol(
double tol) { gddTol = tol; }
335 virtual void setrMax(
double rMax_) {
rMax = rMax_; }
336 virtual void setLinkStatusInd(
int LinkStatusInd_) { LinkStatusInd = LinkStatusInd_; };
337 virtual void setLinkStatusRegInd(
int LinkStatusRegInd_) { LinkStatusRegInd = LinkStatusRegInd_; };
338 virtual void setlaInd(
int laInd_) { laInd = laInd_;Ila=fmatvec::RangeV(laInd,laInd+
laSize-1); }
339 virtual void setgInd(
int gInd_) { gInd = gInd_;
Ig=fmatvec::RangeV(gInd,gInd+
gSize-1); }
340 virtual void setgdInd(
int gdInd_) { gdInd = gdInd_; }
341 virtual void setrFactorInd(
int rFactorInd_) { rFactorInd = rFactorInd_; }
356 virtual void updatecorr(
int j) { corr.init(0); }
358 virtual void calccorrSize(
int j) { corrSize = 0; }
359 virtual void setcorrInd(
int corrInd_) { corrInd = corrInd_; }
360 virtual void checkRoot() { }
365 virtual void setsvInd(
int svInd_) { svInd = svInd_; };
366 int getsvSize()
const {
return svSize; }
377 int getlaInd()
const {
return laInd; }
378 int getlaSize()
const {
return laSize; }
379 int getbSize()
const {
return bSize; }
388 int getgdInd()
const {
return gdInd; }
389 int getgSize()
const {
return gSize; }
390 int getgdSize()
const {
return gdSize; }
394 const fmatvec::VecInt& getrFactorUnsure()
const {
return rFactorUnsure; }
396 void resetUpToDate() { updrrel =
true; updvrel =
true; updla =
true; }
398 virtual void updateGeneralizedPositions() { }
399 virtual void updateGeneralizedVelocities() { }
400 virtual void updateGeneralizedForces() { }
402 const fmatvec::VecV& evalGeneralizedRelativePosition() {
if(updrrel) updateGeneralizedPositions();
return rrel; }
403 const fmatvec::VecV& evalGeneralizedRelativeVelocity() {
if(updvrel) updateGeneralizedVelocities();
return vrel; }
404 const fmatvec::VecV& evalGeneralizedForce() {
if(updla) updateGeneralizedForces();
return lambda; }
406 fmatvec::VecV& getGeneralizedForce(
bool check=
true) { assert((not check) or (not updla));
return lambda; }
434 int getcorrSize()
const {
return corrSize; }
529 fmatvec::RangeV
Ig, Ila;
534 double gTol, gdTol, gddTol, laTol, LaTol;
569 std::vector<fmatvec::Mat>
W[2];
574 std::vector<fmatvec::Mat>
V[2];
579 std::vector<fmatvec::Vec>
h[2];
584 std::vector<fmatvec::Mat>
dhdq;
585 std::vector<fmatvec::Mat> dhdu;
586 std::vector<fmatvec::Vec> dhdt;
591 std::vector<fmatvec::Vec>
r[2];
603 int corrSize, corrInd;
606 fmatvec::VecV rrel, vrel, lambda;
608 bool updrrel, updvrel, updla;
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:440
virtual bool hasSmoothPart() const
Definition: link.h:242
std::vector< fmatvec::Mat > V[2]
reduced force direction matrix for nonsmooth right hand side
Definition: link.h:574
void savela()
saves contact forces for use as starting value in next time step
Definition: link.cc:191
fmatvec::Vec x0
order one initial value
Definition: link.h:452
void decreaserFactors()
decrease rfactor if mass action matrix is not diagonal dominant (cf. Foerg: Dissertation, page 80 et seq.)
Definition: link.cc:213
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:228
double rMax
maximum r-factor
Definition: link.h:559
virtual void plot()
plots time dependent data
Definition: link.cc:41
fmatvec::Vec g
relative distance, relative velocity, contact force parameters
Definition: link.h:499
general link to one or more objects
Definition: link.h:46
virtual void updatejsvRef(const fmatvec::VecInt &jsvParent)
references to stopvector evaluation of dynamic system parent (root detection with corresponding bool ...
Definition: link.cc:124
virtual ~Link()
destructor
Definition: link.h:57
fmatvec::VecInt LinkStatusReg
status of link
Definition: link.h:489
virtual void checkImpactsForTermination()
verify underlying force laws on velocity level concerning given tolerances
Definition: link.h:310
fmatvec::Mat b
TODO.
Definition: link.h:601
virtual double evalPotentialEnergy()
compute potential energy
Definition: link.h:328
int laSize
size and local index of contact force parameters
Definition: link.h:519
int gdSize
size and local index of relative velocities
Definition: link.h:514
virtual void updateLaRef(const fmatvec::Vec &ref)
references to contact force parameter of dynamic system parent
Definition: link.cc:96
fmatvec::Vec sv
stop vector for event driven integration (root function)
Definition: link.h:462
virtual void solveConstraintsRootFinding()
Definition: link.h:290
virtual void solveImpactsGaussSeidel()
Definition: link.h:274
virtual void calcgSize(int j)
calculates size of relative distances
Definition: link.h:188
int xSize
size and local index of order one parameters
Definition: link.h:457
int bSize
size and local index of contact force parameters
Definition: link.h:524
Link(const std::string &name)
constructor
Definition: link.cc:35
void saveLa()
saves contact impulses for use as starting value in next time step
Definition: link.cc:202
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:116
std::vector< fmatvec::Vec > h[2]
smooth complete and link right hand side
Definition: link.h:579
fmatvec::VecInt LinkStatus
status of link (default 0) describing which piece of the equation is valid (e.g. stick or slip) ...
Definition: link.h:478
fmatvec::Vec rFactor
vector of rfactors for relaxation of contact equations
Definition: link.h:544
virtual bool detectImpact()
Definition: link.h:257
virtual void updatelaRef(const fmatvec::Vec &ref)
references to contact force parameter of dynamic system parent
Definition: link.cc:92
fmatvec::VecInt jsv
evaluation of roots of stop vector with a boolean vector
Definition: link.h:467
virtual void updatesvRef(const fmatvec::Vec &sv)
references to stopvector of dynamic system parent (root function for event driven integration) ...
Definition: link.cc:120
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:483
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:323
virtual void updategdRef(const fmatvec::Vec &ref)
references to contact relative velocities of dynamic system parent
Definition: link.cc:108
fmatvec::Vec la0
attribute to save contact force parameter of previous time step
Definition: link.h:539
virtual bool isActive() const =0
virtual void init(InitStage stage)
plots time series header
Definition: link.cc:142
virtual void solveConstraintsGaussSeidel()
Definition: link.h:279
virtual void deletelaRef()
delete reference to contact force parameter of dynamic system parent
Definition: link.cc:100
virtual void calcbSize()
calculates size of rfactors
Definition: link.h:206
std::vector< fmatvec::Mat > W[2]
force direction matrix for nonsmooth right hand side
Definition: link.h:569
virtual void LinearImpactEstimation(double t, 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:350
virtual void jacobianImpacts()
computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level ...
Definition: link.h:300
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:315
InitStage
The stages of the initialization.
Definition: element.h:97
int svSize
size and local index of stop vector
Definition: link.h:472
virtual void SizeLinearImpactEstimation(int *sizeInActive_, int *sizeActive_)
calculates the number of active and inactive unilateral constraints and increments sizeActive/sizeInA...
Definition: link.h:355
virtual void calcsvSize()
calculates size of stopvector (root function for event driven integration)
Definition: link.h:211
void initla()
load contact forces for use as starting value
Definition: link.cc:195
std::vector< fmatvec::Vec > r[2]
nonsmooth right hand side
Definition: link.h:591
virtual void solveImpactsFixpointSingle()
Definition: link.h:263
fmatvec::RangeV Ig
local index of relative distances and contact force parameters
Definition: link.h:529
std::string name
name of element
Definition: element.h:298
virtual void solveImpactsRootFinding()
Definition: link.h:285
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:94
virtual void solveConstraintsFixpointSingle()
Definition: link.h:268
fmatvec::Vec laS
contact forces of smooth contact laws
Definition: link.h:504
virtual void calcLinkStatusSize()
calculates size of vector LinkStatus
Definition: link.h:216
virtual void updateLinkStatusRef(const fmatvec::VecInt &LinkStatusParent)
reference to vector of link status (for set valued links with piecewise link equations) ...
Definition: link.cc:128
fmatvec::Vec res
Definition: link.h:564
virtual void calcrFactorSize(int j)
calculates size of rfactors
Definition: link.h:201
void initLa()
load contact impulses for use as starting value
Definition: link.cc:206
virtual void updaterFactors()
update relaxation factors for contact equations
Definition: link.h:305
double gTol
tolerance for relative velocity, relative acceleration, force and impact
Definition: link.h:534
virtual bool gActiveChanged()=0
std::vector< fmatvec::Mat > dhdq
smooth Jacobians for implicit integration
Definition: link.h:584
virtual void calcLinkStatusRegSize()
calculates size of vector LinkStatusReg
Definition: link.h:221
virtual void updateresRef(const fmatvec::Vec &ref)
references to residuum of nonlinear contact equations of dynamic system parent
Definition: link.cc:112
int gSize
size and local index of relative distances
Definition: link.h:509
int LinkStatusRegSize
size and local index of single-valued link status vector
Definition: link.h:494
fmatvec::Vec wb
TODO.
Definition: link.h:596
virtual void jacobianConstraints()
computes JACOBIAN and mass action matrix of nonlinear contact equations
Definition: link.h:295
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:235
int rFactorSize
size and local index of rfactors
Definition: link.h:554
fmatvec::VecInt rFactorUnsure
boolean vector defining if rfactor belongs to not diagonal dominant mass action matrix (cf...
Definition: link.h:549
virtual void calcgdSize(int j)
calculates size of gap velocities
Definition: link.h:196
fmatvec::Vec xd
differentiated order one parameters
Definition: link.h:445
virtual void updateLinkStatusRegRef(const fmatvec::VecInt &LinkStatusRegParent)
reference to vector of link status (for single-valued links)
Definition: link.cc:132
virtual void calclaSize(int j)
calculates size of contact force parameters
Definition: link.h:183
virtual void updategRef(const fmatvec::Vec &ref)
references to contact relative distances of dynamic system parent
Definition: link.cc:104