MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
DriveDisplacementJoint Class Reference

#include <drvdisp.h>

Inheritance diagram for DriveDisplacementJoint:
Collaboration diagram for DriveDisplacementJoint:

Public Member Functions

 DriveDisplacementJoint (unsigned int uL, const DofOwner *pDO, const TplDriveCaller< Vec3 > *pDC, const StructNode *pN1, const StructNode *pN2, const Vec3 &f1, const Vec3 &f2, flag fOut)
 
virtual ~DriveDisplacementJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void Output (OutputHandler &OH) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual unsigned int iGetNumPrivData (void) const
 
unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i=0) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Joint
 Joint (unsigned int uL, const DofOwner *pD, flag fOut)
 
virtual ~Joint (void)
 
virtual Elem::Type GetElemType (void) const
 
std::ostream & Output (std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
bool bIsPrescribedMotion (void) const
 
bool bIsTorque (void) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- Public Member Functions inherited from TplDriveOwner< Vec3 >
 TplDriveOwner (const TplDriveCaller< Vec3 > *pDC=0)
 
virtual ~TplDriveOwner (void)
 
void Set (const TplDriveCaller< Vec3 > *pDC)
 
TplDriveCaller< Vec3 > * pGetDriveCaller (void) const
 
Vec3 Get (const doublereal &dVar) const
 
Vec3 Get (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual Vec3 GetP (void) const
 

Protected Member Functions

void AssMat (FullSubMatrixHandler &WM, doublereal dCoef)
 
void AssVec (SubVectorHandler &WorkVec, doublereal dCoef)
 
- Protected Member Functions inherited from Joint
virtual void OutputPrepare_int (const std::string &type, OutputHandler &OH, std::string &name)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Protected Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Vec3 f1
 
Vec3 f2
 
Mat3x3 R1Ref
 
Mat3x3 RRef
 
Vec3 f2Ref
 
Vec3 dRef
 
Vec3 F
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 
- Protected Attributes inherited from TplDriveOwner< Vec3 >
TplDriveCaller< Vec3 > * pTplDriveCaller
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Joint
enum  Type {
  UNKNOWN = -1, DISTANCE = 0, DISTANCEWITHOFFSET, CLAMP,
  SPHERICALHINGE, PIN, UNIVERSALHINGE, UNIVERSALROTATION,
  UNIVERSALPIN, PLANEHINGE, PLANEROTATION, PLANEPIN,
  AXIALROTATION, PLANEDISP, PLANEDISPPIN, INPLANE,
  INPLANECONTACT, J_INLINE, ROD, RODBEZIER,
  DEFORMABLEHINGE, DEFORMABLEDISPJOINT, DEFORMABLEJOINT, DEFORMABLEAXIALJOINT,
  VISCOUSBODY, LINEARVELOCITY, ANGULARVELOCITY, LINEARACCELERATION,
  ANGULARACCELERATION, PRISMATIC, DRIVEHINGE, DRIVEDISP,
  DRIVEDISPPIN, IMPOSEDORIENTATION, IMPOSEDDISP, IMPOSEDDISPPIN,
  IMPOSEDKINEMATICS, BEAMSLIDER, BRAKE, GIMBAL,
  POINT_SURFACE_CONTACT, TOTALJOINT, TOTALPINJOINT, TOTALEQUATION,
  TOTALREACTION, MODAL, SCREWJOINT, LASTJOINTTYPE
}
 

Detailed Description

Definition at line 42 of file drvdisp.h.

Constructor & Destructor Documentation

DriveDisplacementJoint::DriveDisplacementJoint ( unsigned int  uL,
const DofOwner pDO,
const TplDriveCaller< Vec3 > *  pDC,
const StructNode pN1,
const StructNode pN2,
const Vec3 f1,
const Vec3 f2,
flag  fOut 
)

Definition at line 43 of file drvdisp.cc.

References ASSERT, StructDispNode::GetNodeType(), pNode1, pNode2, and Node::STRUCTURAL.

51 : Elem(uL, fOut),
52 Joint(uL, pDO, fOut),
54 pNode1(pN1), pNode2(pN2), f1(f1), f2(f2),
55 R1Ref(Eye3),
56 RRef(Eye3),
57 f2Ref(Zero3),
58 dRef(Zero3),
59 F(Zero3)
60 {
61  ASSERT(pNode1 != NULL);
62  ASSERT(pNode2 != NULL);
65 }
const Vec3 Zero3(0., 0., 0.)
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
const StructNode * pNode1
Definition: drvdisp.h:47
#define ASSERT(expression)
Definition: colamd.c:977
const StructNode * pNode2
Definition: drvdisp.h:48
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

DriveDisplacementJoint::~DriveDisplacementJoint ( void  )
virtual

Definition at line 69 of file drvdisp.cc.

References NO_OP.

70 {
71  NO_OP;
72 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void DriveDisplacementJoint::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 392 of file drvdisp.cc.

References dRef, f1, f2, f2Ref, TplDriveOwner< Vec3 >::Get(), StructNode::GetRRef(), pNode1, and pNode2.

394 {
395  /* Recupera i dati */
396  f2Ref = pNode2->GetRRef()*f2;
397  dRef = pNode1->GetRRef()*(f1 + Get());
398 }
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
const StructNode * pNode1
Definition: drvdisp.h:47
const StructNode * pNode2
Definition: drvdisp.h:48
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

VariableSubMatrixHandler & DriveDisplacementJoint::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 351 of file drvdisp.cc.

References AssMat(), DEBUGCOUT, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and WorkSpaceDim().

355 {
356  DEBUGCOUT("Entering DriveDisplacementJoint::AssJac()" << std::endl);
357 
358  FullSubMatrixHandler& WM = WorkMat.SetFull();
359 
360  /* Dimensiona e resetta la matrice di lavoro */
361  integer iNumRows = 0;
362  integer iNumCols = 0;
363  WorkSpaceDim(&iNumRows, &iNumCols);
364  WM.ResizeReset(iNumRows, iNumCols);
365 
366  /* Recupera gli indici */
367  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
368  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
369  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
370  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
371  integer iFirstReactionIndex = iGetFirstIndex();
372 
373  /* Setta gli indici della matrice */
374  for (int iCnt = 1; iCnt <= 6; iCnt++) {
375  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
376  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
377  WM.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
378  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
379  }
380  for (int iCnt = 1; iCnt <= 3; iCnt++) {
381  WM.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
382  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
383  }
384 
385  AssMat(WM, dCoef);
386 
387  return WorkMat;
388 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void AssMat(FullSubMatrixHandler &WM, doublereal dCoef)
Definition: drvdisp.cc:402
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvdisp.h:123
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode1
Definition: drvdisp.h:47
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const StructNode * pNode2
Definition: drvdisp.h:48
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void DriveDisplacementJoint::AssMat ( FullSubMatrixHandler WM,
doublereal  dCoef 
)
protected

Definition at line 402 of file drvdisp.cc.

References FullSubMatrixHandler::Add(), FullSubMatrixHandler::DecCoef(), dRef, F, f2Ref, FullSubMatrixHandler::IncCoef(), MatCross, MatCrossCross, and FullSubMatrixHandler::Sub().

Referenced by AssJac().

403 {
404  for (int iCnt = 1; iCnt <= 3; iCnt++) {
405  /* node 1 force */
406  WM.DecCoef(iCnt, 12 + iCnt, 1.);
407  /* node 2 force */
408  WM.IncCoef(6 + iCnt, 12 + iCnt, 1.);
409 
410  /* node 1 constraint */
411  WM.DecCoef(12 + iCnt, iCnt, 1.);
412  /* node 2 constraint */
413  WM.IncCoef(12 + iCnt, 6 + iCnt, 1.);
414  }
415 
416  Mat3x3 MTmp(MatCross, dRef);
417 
418  /* node 1 moment */
419  WM.Sub(3 + 1, 12 + 1, MTmp);
420  /* node 1 constraint */
421  WM.Add(12 + 1, 3 + 1, MTmp);
422 
423  MTmp = Mat3x3(MatCross, f2Ref);
424  /* node 2 moment */
425  WM.Add(9 + 1, 12 + 1, MTmp);
426  /* node 2 constraint */
427  WM.Sub(12 + 1, 9 + 1, MTmp);
428 
429  MTmp = Mat3x3(MatCrossCross, F, dRef*dCoef);
430  /* node 1 moment */
431  WM.Sub(3 + 1, 3 + 1, MTmp);
432 
433  MTmp = Mat3x3(MatCrossCross, F, f2Ref*dCoef);
434  /* node 2 moment */
435  WM.Add(9 + 1, 9 + 1, MTmp);
436 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:694
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215

Here is the call graph for this function:

SubVectorHandler & DriveDisplacementJoint::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 441 of file drvdisp.cc.

References AssVec(), DEBUGCOUT, F, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), pNode1, pNode2, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and WorkSpaceDim().

445 {
446  DEBUGCOUT("Entering DriveDisplacementJoint::AssRes()" << std::endl);
447 
448  /* Dimensiona e resetta la matrice di lavoro */
449  integer iNumRows = 0;
450  integer iNumCols = 0;
451  WorkSpaceDim(&iNumRows, &iNumCols);
452  WorkVec.ResizeReset(iNumRows);
453 
454  /* Recupera gli indici */
455  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
456  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
457  integer iFirstReactionIndex = iGetFirstIndex();
458 
459  /* Setta gli indici della matrice */
460  for (int iCnt = 1; iCnt <= 6; iCnt++) {
461  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
462  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
463  }
464 
465  for (int iCnt = 1; iCnt <= 3; iCnt++) {
466  WorkVec.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
467  }
468 
469  F = Vec3(XCurr, iFirstReactionIndex + 1);
470 
471  AssVec(WorkVec, dCoef);
472 
473  return WorkVec;
474 }
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvdisp.h:123
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode1
Definition: drvdisp.h:47
virtual integer iGetFirstMomentumIndex(void) const =0
const StructNode * pNode2
Definition: drvdisp.h:48
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef)
Definition: drvdisp.cc:478

Here is the call graph for this function:

void DriveDisplacementJoint::AssVec ( SubVectorHandler WorkVec,
doublereal  dCoef 
)
protected

Definition at line 478 of file drvdisp.cc.

References VectorHandler::Add(), ASSERT, Vec3::Cross(), F, f1, f2, TplDriveOwner< Vec3 >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), pNode1, pNode2, and VectorHandler::Sub().

Referenced by AssRes().

479 {
480  Mat3x3 R1(pNode1->GetRCurr());
481 
482  Vec3 f2Tmp = pNode2->GetRCurr()*f2;
483  Vec3 d = pNode1->GetRCurr()*(f1 + Get());
484 
485  WorkVec.Add(1, F);
486  WorkVec.Add(3 + 1, d.Cross(F));
487  WorkVec.Sub(6 + 1, F);
488  WorkVec.Sub(9 + 1, f2Tmp.Cross(F));
489 
490  ASSERT(dCoef != 0.);
491  WorkVec.Sub(12 + 1, (pNode2->GetXCurr() + f2Tmp - pNode1->GetXCurr() - d)/dCoef);
492 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
const StructNode * pNode1
Definition: drvdisp.h:47
#define ASSERT(expression)
Definition: colamd.c:977
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode2
Definition: drvdisp.h:48
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

std::ostream & DriveDisplacementJoint::DescribeDof ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 175 of file drvdisp.cc.

References DofOwnerOwner::iGetFirstIndex().

177 {
178  integer iIndex = iGetFirstIndex();
179 
180  out
181  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
182  "reaction forces [fx,fy,fz]" << std::endl;
183 
184  if (bInitial) {
185  iIndex += 3;
186  out
187  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
188  "reaction force derivatives [fPx,fPy,fPz]" << std::endl;
189  }
190 
191  return out;
192 }
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void DriveDisplacementJoint::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 199 of file drvdisp.cc.

References dof, WithLabel::GetLabel(), and xyz.

201 {
202  int iend = 1;
203  if (i == -1) {
204  if (bInitial) {
205  iend = 6;
206 
207  } else {
208  iend = 3;
209  }
210  }
211  desc.resize(iend);
212 
213  std::ostringstream os;
214  os << "DriveDisplacementJoint(" << GetLabel() << ")";
215 
216  if (i == -1) {
217  std::string name = os.str();
218  for (i = 0; i < iend; i++) {
219  os.str(name);
220  os.seekp(0, std::ios_base::end);
221  os << ": " << dof[i/3] << xyz[i%3];
222 
223  desc[i] = os.str();
224  }
225 
226  } else {
227  os << ": " << dof[i/3] << xyz[i%3];
228  desc[0] = os.str();
229  }
230 }
static const char xyz[]
Definition: drvdisp.cc:194
static const char * dof[]
Definition: drvdisp.cc:195
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & DriveDisplacementJoint::DescribeEq ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 233 of file drvdisp.cc.

References DofOwnerOwner::iGetFirstIndex().

235 {
236  integer iIndex = iGetFirstIndex();
237 
238  out
239  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
240  "position constraints [px1=px2,py1=py2,pz1=pz2]" << std::endl;
241 
242  if (bInitial) {
243  iIndex += 3;
244  out
245  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
246  "velocity constraints [vx1=vx2,vy1=vy2,vz1=vz2]" << std::endl;
247  }
248 
249  return out;
250 
251 }
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void DriveDisplacementJoint::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 254 of file drvdisp.cc.

References eq, WithLabel::GetLabel(), and xyz.

256 {
257  int iend = 1;
258  if (i == -1) {
259  if (bInitial) {
260  iend = 6;
261 
262  } else {
263  iend = 3;
264  }
265  }
266  desc.resize(iend);
267 
268  std::ostringstream os;
269  os << "DriveDisplacementJoint(" << GetLabel() << ")";
270 
271  if (i == -1) {
272  std::string name = os.str();
273  for (i = 0; i < iend; i++) {
274  os.str(name);
275  os.seekp(0, std::ios_base::end);
276  os << ": " << eq[i/3] << xyz[i%3];
277 
278  desc[i] = os.str();
279  }
280 
281  } else {
282  os << ": " << eq[i/3] << xyz[i%3];
283  desc[0] = os.str();
284  }
285 }
static const char xyz[]
Definition: drvdisp.cc:194
static const char * eq[]
Definition: drvdisp.cc:196
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

doublereal DriveDisplacementJoint::dGetPrivData ( unsigned int  i = 0) const
virtual

Reimplemented from SimulationEntity.

Definition at line 330 of file drvdisp.cc.

References ASSERT, Vec3::dGet(), F, TplDriveOwner< Vec3 >::Get(), and MBDYN_EXCEPT_ARGS.

331 {
332  ASSERT(i >= 1 && i <= 6);
333 
334  switch (i) {
335  case 1:
336  case 2:
337  case 3:
338  return Get().dGet(i);
339 
340  case 4:
341  case 5:
342  case 6:
343  return F(i - 3);
344  }
345 
347 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

virtual void DriveDisplacementJoint::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 177 of file drvdisp.h.

References pNode1, and pNode2.

177  {
178  connectedNodes.resize(2);
179  connectedNodes[0] = pNode1;
180  connectedNodes[1] = pNode2;
181  };
const StructNode * pNode1
Definition: drvdisp.h:47
const StructNode * pNode2
Definition: drvdisp.h:48
virtual DofOrder::Order DriveDisplacementJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 118 of file drvdisp.h.

References DofOrder::ALGEBRAIC, and ASSERT.

118  {
119  ASSERT(i >= 0 && i <= 3);
120  return DofOrder::ALGEBRAIC;
121  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual Joint::Type DriveDisplacementJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 78 of file drvdisp.h.

References Joint::DRIVEDISP.

78  {
79  return DRIVEDISP;
80  };
virtual unsigned int DriveDisplacementJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 146 of file drvdisp.h.

146  {
147  return 6;
148  };
virtual unsigned int DriveDisplacementJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 94 of file drvdisp.h.

94  {
95  return 3;
96  };
unsigned int DriveDisplacementJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 289 of file drvdisp.cc.

290 {
291  return 6;
292 };
unsigned int DriveDisplacementJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 295 of file drvdisp.cc.

References ASSERT.

296 {
297  ASSERT(s != NULL);
298  ASSERT(s[0] != '\0');
299 
300  if (s[2] != '\0') {
301  return 0;
302  }
303 
304  unsigned int idx = 0;
305 
306  switch (s[0]) {
307  case 'f':
308  idx += 3;
309  /* fallthru */
310  case 'd':
311  break;
312 
313  default:
314  return 0;
315  }
316 
317  switch (s[1]) {
318  case 'x':
319  return idx + 1;
320  case 'y':
321  return idx + 2;
322  case 'z':
323  return idx + 3;
324  }
325 
326  return 0;
327 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & DriveDisplacementJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 497 of file drvdisp.cc.

References FullSubMatrixHandler::Add(), TplDriveOwner< Vec3 >::bIsDifferentiable(), DEBUGCOUT, FullSubMatrixHandler::DecCoef(), dRef, F, f2Ref, TplDriveOwner< Vec3 >::GetP(), StructNode::GetRCurr(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), FullSubMatrixHandler::IncCoef(), InitialWorkSpaceDim(), MatCross, MatCrossCross, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

499 {
500  DEBUGCOUT("Entering DriveDisplacementJoint::InitialAssJac()" << std::endl);
501 
502  FullSubMatrixHandler& WM = WorkMat.SetFull();
503 
504  /* Dimensiona e resetta la matrice di lavoro */
505  integer iNumRows = 0;
506  integer iNumCols = 0;
507  InitialWorkSpaceDim(&iNumRows, &iNumCols);
508  WM.ResizeReset(iNumRows, iNumCols);
509 
510  /* Recupera gli indici */
511  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
512  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
513  integer iFirstReactionIndex = iGetFirstIndex();
514  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
515  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
516  integer iFirstReactionPrimeIndex = iFirstReactionIndex + 3;
517 
518  /* Setta gli indici della matrice */
519  for (int iCnt = 1; iCnt <= 6; iCnt++) {
520  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
521  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
522  WM.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
523  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
524  WM.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
525  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
526  WM.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
527  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
528  WM.PutRowIndex(24 + iCnt, iFirstReactionIndex + iCnt);
529  WM.PutColIndex(24 + iCnt, iFirstReactionIndex + iCnt);
530  }
531 
532  Vec3 FPrime = Vec3(XCurr, iFirstReactionPrimeIndex + 1);
533 
534  for (int iCnt = 1; iCnt <= 3; iCnt++) {
535  /* node 1 force */
536  WM.DecCoef(iCnt, 24 + iCnt, 1.);
537  /* node 2 force */
538  WM.IncCoef(12 + iCnt, 24 + iCnt, 1.);
539 
540  /* node 1 force derivative */
541  WM.DecCoef(6 + iCnt, 27 + iCnt, 1.);
542  /* node 2 force derivative */
543  WM.IncCoef(18 + iCnt, 27 + iCnt, 1.);
544 
545  /* node 1 constraint */
546  WM.DecCoef(24 + iCnt, iCnt, 1.);
547  /* node 2 constraint */
548  WM.IncCoef(24 + iCnt, 12 + iCnt, 1.);
549 
550  /* node 1 constraint derivative */
551  WM.DecCoef(27 + iCnt, 6 + iCnt, 1.);
552  /* node 2 constraint derivative */
553  WM.IncCoef(27 + iCnt, 18 + iCnt, 1.);
554  }
555 
556  Mat3x3 MTmp(MatCross, dRef);
557 
558  /* node 1 moment */
559  WM.Sub(3 + 1, 24 + 1, MTmp);
560  /* node 1 moment derivative */
561  WM.Sub(9 + 1, 27 + 1, MTmp);
562  /* node 1 constraint */
563  WM.Add(24 + 1, 3 + 1, MTmp);
564  /* node 1 constraint derivative */
565  WM.Add(27 + 1, 9 + 1, MTmp);
566 
567  /* in case the drive is differentiable... */
568  if (bIsDifferentiable()) {
569  WM.Add(27 + 1, 3 + 1, Mat3x3(MatCross, pNode1->GetRCurr()*GetP()));
570  }
571 
572  MTmp = Mat3x3(MatCross, f2Ref);
573  /* node 2 moment */
574  WM.Add(15 + 1, 24 + 1, MTmp);
575  /* node 2 moment derivatives */
576  WM.Add(21 + 1, 27 + 1, MTmp);
577  /* node 2 constraint */
578  WM.Sub(24 + 1, 15 + 1, MTmp);
579  /* node 2 constraint derivative */
580  WM.Sub(27 + 1, 21 + 1, MTmp);
581 
582  MTmp = Mat3x3(MatCrossCross, F, dRef);
583  /* node 1 moment */
584  WM.Sub(3 + 1, 3 + 1, MTmp);
585 
586  MTmp = Mat3x3(MatCrossCross, FPrime, dRef);
587  /* node 1 moment derivative */
588  WM.Sub(9 + 1, 9 + 1, MTmp);
589 
590  MTmp = Mat3x3(MatCrossCross, F, f2Ref);
591  /* node 2 moment */
592  WM.Add(15 + 1, 15 + 1, MTmp);
593 
594  MTmp = Mat3x3(MatCrossCross, FPrime, f2Ref);
595  /* node 2 moment derivative */
596  WM.Add(21 + 1, 21 + 1, MTmp);
597 
598  MTmp = Mat3x3(MatCrossCross, pNode1->GetWRef(), dRef);
599  /* node 2 constraint derivative */
600  WM.Sub(27 + 1, 3 + 1, MTmp);
601 
602  MTmp = Mat3x3(MatCrossCross, pNode2->GetWRef(), f2Ref);
603  /* node 2 constraint derivative */
604  WM.Add(27 + 1, 15 + 1, MTmp);
605 
606  return WorkMat;
607 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual bool bIsDifferentiable(void) const
Definition: tpldrive.h:118
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:694
virtual Vec3 GetP(void) const
Definition: tpldrive.h:121
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvdisp.h:150
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode1
Definition: drvdisp.h:47
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const StructNode * pNode2
Definition: drvdisp.h:48
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

SubVectorHandler & DriveDisplacementJoint::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 612 of file drvdisp.cc.

References VectorHandler::Add(), TplDriveOwner< Vec3 >::bIsDifferentiable(), Vec3::Cross(), DEBUGCOUT, dRef, F, f1, f2, f2Ref, TplDriveOwner< Vec3 >::Get(), TplDriveOwner< Vec3 >::GetP(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), pNode1, pNode2, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and VectorHandler::Sub().

614 {
615  DEBUGCOUT("Entering DriveDisplacementJoint::InitialAssRes()" << std::endl);
616 
617  /* Dimensiona e resetta la matrice di lavoro */
618  integer iNumRows = 0;
619  integer iNumCols = 0;
620  InitialWorkSpaceDim(&iNumRows, &iNumCols);
621  WorkVec.ResizeReset(iNumRows);
622 
623  /* Recupera gli indici */
624  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
625  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
626  integer iFirstReactionIndex = iGetFirstIndex();
627  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
628  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
629  integer iReactionPrimeIndex = iFirstReactionIndex + 3;
630 
631  /* Setta gli indici del vettore */
632  for (int iCnt = 1; iCnt <= 6; iCnt++) {
633  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
634  WorkVec.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
635  WorkVec.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
636  WorkVec.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
637  WorkVec.PutRowIndex(24 + iCnt, iFirstReactionIndex + iCnt);
638  }
639 
640  F = Vec3(XCurr, iFirstReactionIndex + 1);
641  Vec3 FPrime = Vec3(XCurr, iReactionPrimeIndex + 1);
642 
643  dRef = pNode1->GetRCurr()*(f1 + Get());
644  f2Ref = pNode2->GetRCurr()*f2;
645 
646  WorkVec.Add(1, F);
647  WorkVec.Add(3 + 1, dRef.Cross(F));
648  WorkVec.Add(6 + 1, FPrime);
649  WorkVec.Add(9 + 1, dRef.Cross(FPrime));
650 
651  WorkVec.Sub(12 + 1, F);
652  WorkVec.Sub(15 + 1, f2Ref.Cross(F));
653  WorkVec.Sub(18 + 1, FPrime);
654  WorkVec.Sub(21 + 1, f2Ref.Cross(FPrime));
655 
656  WorkVec.Add(24 + 1, pNode1->GetXCurr() + dRef - pNode2->GetXCurr() - f2Ref);
657 
658  /* in case the drive is differentiable... */
659  Vec3 PhiPrime = pNode1->GetVCurr() + pNode1->GetWCurr().Cross(dRef)
661  if (bIsDifferentiable()) {
662  PhiPrime += pNode1->GetRCurr()*GetP();
663  }
664  WorkVec.Add(27 + 1, PhiPrime);
665 
666  return WorkVec;
667 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual bool bIsDifferentiable(void) const
Definition: tpldrive.h:118
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual Vec3 GetP(void) const
Definition: tpldrive.h:121
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvdisp.h:150
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode1
Definition: drvdisp.h:47
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode2
Definition: drvdisp.h:48
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

virtual void DriveDisplacementJoint::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 150 of file drvdisp.h.

Referenced by InitialAssJac(), and InitialAssRes().

152  {
153  *piNumRows = 30;
154  *piNumCols = 30;
155  };
void DriveDisplacementJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 90 of file drvdisp.cc.

References ToBeOutput::bToBeOutput(), F, f1, f2, WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), OutputHandler::Joints(), Joint::Output(), pNode1, pNode2, Mat3x3::Transpose(), and Zero3.

91 {
92  if (bToBeOutput()) {
94  - pNode1->GetXCurr() - pNode1->GetRCurr()*f1);
95  Joint::Output(OH.Joints(), "DriveDisplacementJoint", GetLabel(),
97  << " " << d << std::endl;
98  }
99 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: drvdisp.h:47
std::ostream & Joints(void) const
Definition: output.h:443
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pNode2
Definition: drvdisp.h:48
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
std::ostream & Output(std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
Definition: joint.cc:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Hint * DriveDisplacementJoint::ParseHint ( DataManager pDM,
const char *  s 
) const
virtual

Reimplemented from SimulationEntity.

Definition at line 151 of file drvdisp.cc.

References SimulationEntity::ParseHint(), and STRLENOF.

152 {
153  if (strncasecmp(s, "offset{" /*}*/ , STRLENOF("offset{" /*}*/ )) == 0)
154  {
155  s += STRLENOF("offset{" /*}*/ );
156 
157  if (strcmp(&s[1], /*{*/ "}") != 0) {
158  return 0;
159  }
160 
161  switch (s[0]) {
162  case '1':
163  return new Joint::OffsetHint<1>;
164 
165  case '2':
166  return new Joint::OffsetHint<2>;
167  }
168  }
169 
170  /* take care of "drive" hint... */
171  return SimulationEntity::ParseHint(pDM, s);
172 }
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: simentity.cc:76
#define STRLENOF(s)
Definition: mbdyn.h:166

Here is the call graph for this function:

std::ostream & DriveDisplacementJoint::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 77 of file drvdisp.cc.

References f1, f2, WithLabel::GetLabel(), TplDriveOwner< Vec3 >::pGetDriveCaller(), pNode1, pNode2, TplDriveCaller< T >::Restart(), Joint::Restart(), and Vec3::Write().

78 {
79  Joint::Restart(out) << ", drive displacement, "
80  << pNode1->GetLabel() << ", reference, node, ",
81  f1.Write(out, ", ") << ", "
82  << pNode2->GetLabel() << ", reference, node, ",
83  f2.Write(out, ", ") << ", ",
84  pGetDriveCaller()->Restart(out) << ';' << std::endl;
85  return out;
86 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
TplDriveCaller< Vec3 > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
const StructNode * pNode1
Definition: drvdisp.h:47
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
virtual std::ostream & Restart(std::ostream &out) const =0
const StructNode * pNode2
Definition: drvdisp.h:48
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void DriveDisplacementJoint::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from Joint.

Definition at line 102 of file drvdisp.cc.

References f1, f2, TplDriveOwner< Vec3 >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), MBDYN_EXCEPT_ARGS, TplDriveHint< T >::pCreateDrive(), pNode1, pNode2, TplDriveOwner< T >::Set(), Mat3x3::Transpose(), and WithLabel::uLabel.

105 {
106  if (ph) {
107  for (unsigned i = 0; i < ph->size(); i++) {
108  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
109 
110  if (pjh) {
111  if (dynamic_cast<Joint::OffsetHint<1> *>(pjh)) {
112  Mat3x3 R1t(pNode1->GetRCurr().Transpose());
113  Vec3 fTmp2(pNode2->GetRCurr()*f2);
114 
115  f1 = R1t*(pNode2->GetXCurr() + fTmp2 - pNode1->GetXCurr() - Get());
116 
117  } else if (dynamic_cast<Joint::OffsetHint<2> *>(pjh)) {
118  Mat3x3 R2t(pNode2->GetRCurr().Transpose());
119  Vec3 fTmp1(pNode1->GetRCurr()*f1);
120 
121  f2 = R2t*(pNode1->GetXCurr() + fTmp1 - pNode2->GetXCurr() + Get());
122 
123  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
124  /* TODO */
125  }
126  continue;
127  }
128 
129  TplDriveHint<Vec3> *pdh = dynamic_cast<TplDriveHint<Vec3> *>((*ph)[i]);
130 
131  if (pdh) {
132  pedantic_cout("DriveDisplacementJoint(" << uLabel << "): "
133  "creating drive from hint[" << i << "]..." << std::endl);
134 
135  TplDriveCaller<Vec3> *pDC = pdh->pCreateDrive(pDM);
136  if (pDC == 0) {
137  silent_cerr("DriveDisplacementJoint(" << uLabel << "): "
138  "unable to create drive "
139  "after hint #" << i << std::endl);
141  }
142 
144  continue;
145  }
146  }
147  }
148 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
void Set(const TplDriveCaller< T > *pDC)
Definition: tpldrive.h:97
const StructNode * pNode1
Definition: drvdisp.h:47
unsigned int uLabel
Definition: withlab.h:44
TplDriveCaller< T > * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.h:124
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pNode2
Definition: drvdisp.h:48
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

virtual void DriveDisplacementJoint::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 123 of file drvdisp.h.

Referenced by AssJac(), and AssRes().

124  {
125  *piNumRows = 15;
126  *piNumCols = 15;
127  };

Member Data Documentation

Vec3 DriveDisplacementJoint::dRef
protected

Definition at line 56 of file drvdisp.h.

Referenced by AfterPredict(), AssMat(), InitialAssJac(), and InitialAssRes().

Vec3 DriveDisplacementJoint::F
protected

Definition at line 58 of file drvdisp.h.

Referenced by AssMat(), AssRes(), AssVec(), dGetPrivData(), InitialAssJac(), InitialAssRes(), and Output().

Vec3 DriveDisplacementJoint::f1
mutableprotected

Definition at line 49 of file drvdisp.h.

Referenced by AfterPredict(), AssVec(), InitialAssRes(), Output(), Restart(), and SetValue().

Vec3 DriveDisplacementJoint::f2
mutableprotected

Definition at line 50 of file drvdisp.h.

Referenced by AfterPredict(), AssVec(), InitialAssRes(), Output(), Restart(), and SetValue().

Vec3 DriveDisplacementJoint::f2Ref
protected

Definition at line 55 of file drvdisp.h.

Referenced by AfterPredict(), AssMat(), InitialAssJac(), and InitialAssRes().

const StructNode* DriveDisplacementJoint::pNode1
protected
const StructNode* DriveDisplacementJoint::pNode2
protected
Mat3x3 DriveDisplacementJoint::R1Ref
protected

Definition at line 52 of file drvdisp.h.

Mat3x3 DriveDisplacementJoint::RRef
protected

Definition at line 53 of file drvdisp.h.


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