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

#include <drvhinge.h>

Inheritance diagram for DriveHingeJoint:
Collaboration diagram for DriveHingeJoint:

Public Member Functions

 DriveHingeJoint (unsigned int uL, const DofOwner *pDO, const TplDriveCaller< Vec3 > *pDC, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &R1, const Mat3x3 &R2, flag fOut)
 
virtual ~DriveHingeJoint (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
 
const Mat3x3 R1h
 
const Mat3x3 R2h
 
Mat3x3 R1Ref
 
Mat3x3 RRef
 
Vec3 ThetaRef
 
Vec3 ThetaCurr
 
Vec3 M
 
bool bFirstRes
 
- 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 44 of file drvhinge.h.

Constructor & Destructor Documentation

DriveHingeJoint::DriveHingeJoint ( unsigned int  uL,
const DofOwner pDO,
const TplDriveCaller< Vec3 > *  pDC,
const StructNode pN1,
const StructNode pN2,
const Mat3x3 R1,
const Mat3x3 R2,
flag  fOut 
)

Definition at line 44 of file drvhinge.cc.

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

52 : Elem(uL, fOut),
53 Joint(uL, pDO, fOut),
55 pNode1(pN1), pNode2(pN2), R1h(R1), R2h(R2),
56 R1Ref(Eye3),
57 RRef(Eye3),
60 M(Zero3),
61 bFirstRes(false)
62 {
63  ASSERT(pNode1 != NULL);
64  ASSERT(pNode2 != NULL);
67 }
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 Mat3x3 R1h
Definition: drvhinge.h:51
Mat3x3 RRef
Definition: drvhinge.h:55
const StructNode * pNode2
Definition: drvhinge.h:50
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 R1Ref
Definition: drvhinge.h:54
const StructNode * pNode1
Definition: drvhinge.h:49
Vec3 ThetaCurr
Definition: drvhinge.h:58
const Mat3x3 R2h
Definition: drvhinge.h:52
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
bool bFirstRes
Definition: drvhinge.h:62

Here is the call graph for this function:

DriveHingeJoint::~DriveHingeJoint ( void  )
virtual

Definition at line 71 of file drvhinge.cc.

References NO_OP.

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

Member Function Documentation

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

Reimplemented from SimulationEntity.

Definition at line 391 of file drvhinge.cc.

References bFirstRes, RotManip::DRot_I(), StructNode::GetRRef(), pNode1, pNode2, R1h, R1Ref, R2h, RRef, ThetaCurr, ThetaRef, Mat3x3::Transpose(), and RotManip::VecRot().

393 {
394  /* Recupera i dati */
395  R1Ref = pNode1->GetRRef()*R1h;
396  Mat3x3 R1T = R1Ref.Transpose();
397  Mat3x3 RD(R1T*pNode2->GetRRef()*R2h);
398 
399  /* Calcola la deformazione corrente nel sistema locale (nodo a) */
401 
402  /* Calcola l'inversa di Gamma di ThetaRef */
403  Mat3x3 GammaRefm1 = RotManip::DRot_I(ThetaRef);
404 
405  /* Contributo alla linearizzazione ... */
406  RRef = GammaRefm1*R1T;
407 
408  /* Flag di aggiornamento dopo la predizione */
409  bFirstRes = true;
410 }
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
const Mat3x3 R1h
Definition: drvhinge.h:51
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Mat3x3 RRef
Definition: drvhinge.h:55
const StructNode * pNode2
Definition: drvhinge.h:50
Mat3x3 R1Ref
Definition: drvhinge.h:54
const StructNode * pNode1
Definition: drvhinge.h:49
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Vec3 ThetaCurr
Definition: drvhinge.h:58
const Mat3x3 R2h
Definition: drvhinge.h:52
bool bFirstRes
Definition: drvhinge.h:62
Mat3x3 DRot_I(const Vec3 &phi)
Definition: Rot.cc:111

Here is the call graph for this function:

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

Implements Elem.

Definition at line 352 of file drvhinge.cc.

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

356 {
357  DEBUGCOUT("Entering DriveHingeJoint::AssJac()" << std::endl);
358 
359  FullSubMatrixHandler& WM = WorkMat.SetFull();
360 
361  /* Dimensiona e resetta la matrice di lavoro */
362  integer iNumRows = 0;
363  integer iNumCols = 0;
364  WorkSpaceDim(&iNumRows, &iNumCols);
365  WM.ResizeReset(iNumRows, iNumCols);
366 
367  /* Recupera gli indici */
368  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
369  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
370  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
371  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
372  integer iFirstReactionIndex = iGetFirstIndex();
373 
374  /* Setta gli indici della matrice */
375  for (int iCnt = 1; iCnt <= 3; iCnt++) {
376  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
377  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
378  WM.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
379  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
380  WM.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
381  WM.PutColIndex(6 + iCnt, iFirstReactionIndex + iCnt);
382  }
383 
384  AssMat(WM, dCoef);
385 
386  return WorkMat;
387 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:127
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode2
Definition: drvhinge.h:50
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 * pNode1
Definition: drvhinge.h:49
void AssMat(FullSubMatrixHandler &WM, doublereal dCoef)
Definition: drvhinge.cc:414
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 DriveHingeJoint::AssMat ( FullSubMatrixHandler WM,
doublereal  dCoef 
)
protected

Definition at line 414 of file drvhinge.cc.

References FullSubMatrixHandler::Add(), M, MatCross, R1Ref, RRef, and FullSubMatrixHandler::Sub().

Referenced by AssJac().

415 {
416  Mat3x3 MCross(MatCross, R1Ref*(M*dCoef));
417 
418  WM.Add(1, 1, MCross);
419  WM.Sub(4, 1, MCross);
420 
421  WM.Sub(1, 7, R1Ref);
422  WM.Add(4, 7, R1Ref);
423 
424  WM.Sub(7, 1, RRef);
425  WM.Add(7, 4, RRef);
426 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
Mat3x3 RRef
Definition: drvhinge.h:55
Mat3x3 R1Ref
Definition: drvhinge.h:54
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215

Here is the call graph for this function:

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

Implements Elem.

Definition at line 431 of file drvhinge.cc.

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

435 {
436  DEBUGCOUT("Entering DriveHingeJoint::AssRes()" << std::endl);
437 
438  /* Dimensiona e resetta la matrice di lavoro */
439  integer iNumRows = 0;
440  integer iNumCols = 0;
441  WorkSpaceDim(&iNumRows, &iNumCols);
442  WorkVec.ResizeReset(iNumRows);
443 
444  /* Recupera gli indici */
445  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
446  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
447  integer iFirstReactionIndex = iGetFirstIndex();
448 
449  /* Setta gli indici della matrice */
450  for (int iCnt = 1; iCnt <= 3; iCnt++) {
451  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
452  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
453  WorkVec.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
454  }
455 
456  M = Vec3(XCurr, iFirstReactionIndex+1);
457 
458  AssVec(WorkVec, dCoef);
459 
460  return WorkVec;
461 }
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:127
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode2
Definition: drvhinge.h:50
virtual integer iGetFirstMomentumIndex(void) const =0
const StructNode * pNode1
Definition: drvhinge.h:49
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef)
Definition: drvhinge.cc:465
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 DriveHingeJoint::AssVec ( SubVectorHandler WorkVec,
doublereal  dCoef 
)
protected

Definition at line 465 of file drvhinge.cc.

References VectorHandler::Add(), ASSERT, bFirstRes, TplDriveOwner< Vec3 >::Get(), StructNode::GetRCurr(), M, pNode1, pNode2, R1h, R2h, VectorHandler::Sub(), ThetaCurr, and RotManip::VecRot().

Referenced by AssRes().

466 {
467  Mat3x3 R1(pNode1->GetRCurr()*R1h);
468 
469  if (bFirstRes) {
470  /* La rotazione e' gia' stata aggiornata da AfterPredict */
471  bFirstRes = false;
472 
473  } else {
474  Mat3x3 R2(pNode2->GetRCurr()*R2h);
475  ThetaCurr = RotManip::VecRot(R1.Transpose()*R2);
476  }
477 
478  Vec3 MTmp(R1*M);
479 
480  WorkVec.Add(1, MTmp);
481  WorkVec.Sub(3 + 1, MTmp);
482 
483  ASSERT(dCoef != 0.);
484  WorkVec.Add(6 + 1, (Get() - ThetaCurr)/dCoef);
485 }
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 Mat3x3 R1h
Definition: drvhinge.h:51
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
const StructNode * pNode2
Definition: drvhinge.h:50
#define ASSERT(expression)
Definition: colamd.c:977
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode1
Definition: drvhinge.h:49
Vec3 ThetaCurr
Definition: drvhinge.h:58
const Mat3x3 R2h
Definition: drvhinge.h:52
bool bFirstRes
Definition: drvhinge.h:62
Vec3 Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 174 of file drvhinge.cc.

References DofOwnerOwner::iGetFirstIndex().

176 {
177  integer iIndex = iGetFirstIndex();
178 
179  out
180  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
181  "reaction couples [mx,my,mz]" << std::endl;
182 
183  if (bInitial) {
184  iIndex += 3;
185  out
186  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
187  "reaction couple derivatives [mPx,mPy,mPz]" << std::endl;
188  }
189 
190  return out;
191 }
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 DriveHingeJoint::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 198 of file drvhinge.cc.

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

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

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 232 of file drvhinge.cc.

References DofOwnerOwner::iGetFirstIndex().

234 {
235  integer iIndex = iGetFirstIndex();
236 
237  out
238  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
239  "orientation constraints [gx1=gx2,gy1=gy2,gz1=gz2]" << std::endl;
240 
241  if (bInitial) {
242  iIndex += 3;
243  out
244  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
245  "angular velocity constraints [wx1=wx2,wy1=wy2,wz1=wz2]" << std::endl;
246  }
247 
248  return out;
249 
250 }
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 DriveHingeJoint::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 253 of file drvhinge.cc.

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

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

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 329 of file drvhinge.cc.

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

330 {
331  ASSERT(i >= 1 && i <= 6);
332 
333  switch (i) {
334  case 1:
335  case 2:
336  case 3:
337  return Get().dGet(i);
338 
339  case 4:
340  case 5:
341  case 6:
342  return M(i - 3);
343 
344  default:
345  ASSERT(0);
347  }
348 }
#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 DriveHingeJoint::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 180 of file drvhinge.h.

References pNode1, and pNode2.

180  {
181  connectedNodes.resize(2);
182  connectedNodes[0] = pNode1;
183  connectedNodes[1] = pNode2;
184  };
const StructNode * pNode2
Definition: drvhinge.h:50
const StructNode * pNode1
Definition: drvhinge.h:49
virtual DofOrder::Order DriveHingeJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 122 of file drvhinge.h.

References DofOrder::ALGEBRAIC, and ASSERT.

122  {
123  ASSERT(i >= 0 && i <= 3);
124  return DofOrder::ALGEBRAIC;
125  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual Joint::Type DriveHingeJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 82 of file drvhinge.h.

References Joint::DRIVEHINGE.

82  {
83  return DRIVEHINGE;
84  };
virtual unsigned int DriveHingeJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 150 of file drvhinge.h.

150  {
151  return 6;
152  };
virtual unsigned int DriveHingeJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 98 of file drvhinge.h.

98  {
99  return 3;
100  };
unsigned int DriveHingeJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 288 of file drvhinge.cc.

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

Reimplemented from SimulationEntity.

Definition at line 294 of file drvhinge.cc.

References ASSERT.

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

Implements SubjectToInitialAssembly.

Definition at line 490 of file drvhinge.cc.

References FullSubMatrixHandler::Add(), DEBUGCOUT, StructNode::GetRRef(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, MatCross, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

492 {
493  DEBUGCOUT("Entering DriveHingeJoint::InitialAssJac()" << std::endl);
494 
495  FullSubMatrixHandler& WM = WorkMat.SetFull();
496 
497  /* Dimensiona e resetta la matrice di lavoro */
498  integer iNumRows = 0;
499  integer iNumCols = 0;
500  InitialWorkSpaceDim(&iNumRows, &iNumCols);
501  WM.ResizeReset(iNumRows, iNumCols);
502 
503  /* Recupera gli indici */
504  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
505  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
506  integer iFirstReactionIndex = iGetFirstIndex();
507  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
508  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
509  integer iReactionPrimeIndex = iFirstReactionIndex + 3;
510 
511  /* Setta gli indici della matrice */
512  for (int iCnt = 1; iCnt <= 3; iCnt++) {
513  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
514  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
515  WM.PutRowIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
516  WM.PutColIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
517  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
518  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
519  WM.PutRowIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
520  WM.PutColIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
521  WM.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
522  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
523  WM.PutRowIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
524  WM.PutColIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
525  }
526 
527  Mat3x3 Ra(pNode1->GetRRef()*R1h);
528  Mat3x3 RaT(Ra.Transpose());
529  Vec3 Wa(pNode1->GetWRef());
530  Vec3 Wb(pNode2->GetWRef());
531 
532  Mat3x3 MTmp(MatCross, M);
533  Mat3x3 MPrimeTmp(MatCross, Ra*Vec3(XCurr, iReactionPrimeIndex + 1));
534 
535  WM.Add(1, 1, MTmp);
536  WM.Add(3 + 1, 3 + 1, MTmp);
537  WM.Sub(6 + 1, 1, MTmp);
538  WM.Sub(9 + 1, 3 + 1, MTmp);
539 
540  MTmp = Wa.Cross(MTmp) + MPrimeTmp;
541  WM.Add(3 + 1, 1, MTmp);
542  WM.Sub(9 + 1, 1, MTmp);
543 
544  WM.Add(6 + 1, 12 + 1, Ra);
545  WM.Add(9 + 1, 15 + 1, Ra);
546  WM.Sub(1, 12 + 1, Ra);
547  WM.Sub(3 + 1, 15 + 1, Ra);
548 
549  MTmp = Wa.Cross(Ra);
550  WM.Add(9 + 1, 12 + 1, MTmp);
551  WM.Sub(3 + 1, 12 + 1, MTmp);
552 
553  WM.Add(12 + 1, 6 + 1, RaT);
554  WM.Sub(12 + 1, 1, RaT);
555  WM.Sub(15 + 1, 3 + 1, RaT);
556  WM.Add(15 + 1, 9 + 1, RaT);
557  WM.Add(15 + 1, 1, RaT*Mat3x3(MatCross, Wb - Wa));
558 
559  return WorkMat;
560 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
const Mat3x3 R1h
Definition: drvhinge.h:51
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:154
const StructNode * pNode2
Definition: drvhinge.h:50
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const StructNode * pNode1
Definition: drvhinge.h:49
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 & DriveHingeJoint::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 565 of file drvhinge.cc.

References VectorHandler::Add(), TplDriveOwner< Vec3 >::bIsDifferentiable(), DEBUGCOUT, TplDriveOwner< Vec3 >::Get(), TplDriveOwner< Vec3 >::GetP(), StructNode::GetRCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R2h, VectorHandler::ResizeReset(), VectorHandler::Sub(), ThetaCurr, and RotManip::VecRot().

567 {
568  DEBUGCOUT("Entering DriveHingeJoint::InitialAssRes()" << std::endl);
569 
570  /* Dimensiona e resetta la matrice di lavoro */
571  integer iNumRows = 0;
572  integer iNumCols = 0;
573  InitialWorkSpaceDim(&iNumRows, &iNumCols);
574  WorkVec.ResizeReset(iNumRows);
575 
576  /* Recupera gli indici */
577  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
578  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
579  integer iFirstReactionIndex = iGetFirstIndex();
580  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
581  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
582  integer iReactionPrimeIndex = iFirstReactionIndex + 3;
583 
584  /* Setta gli indici del vettore */
585  for (int iCnt = 1; iCnt <= 3; iCnt++) {
586  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
587  WorkVec.PutRowIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
588  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
589  WorkVec.PutRowIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
590  WorkVec.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
591  WorkVec.PutRowIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
592  }
593 
594  Mat3x3 R1(pNode1->GetRCurr()*R1h);
595  Mat3x3 R1T(R1.Transpose());
596  Vec3 Wa(pNode1->GetWCurr());
597  Vec3 Wb(pNode2->GetWCurr());
598 
599  M = Vec3(XCurr, iFirstReactionIndex+1);
600  Vec3 MPrime = Vec3(XCurr, iReactionPrimeIndex+1);
601 
602  Vec3 MTmp(R1*M);
603  Vec3 MPrimeTmp(Wa.Cross(MTmp) + R1*MPrime);
604 
605  Mat3x3 R2(pNode2->GetRCurr()*R2h);
606  ThetaCurr = RotManip::VecRot(R1T*R2);
607 
608  Vec3 ThetaPrime = R1T*(Wb-Wa);
609 
610  WorkVec.Add(1, MTmp);
611  WorkVec.Add(3 + 1, MPrimeTmp);
612  WorkVec.Sub(6 + 1, MTmp);
613  WorkVec.Sub(9 + 1, MPrimeTmp);
614  WorkVec.Add(12 + 1, Get() - ThetaCurr);
615  if (bIsDifferentiable()) {
616  ThetaPrime -= GetP();
617  }
618  WorkVec.Sub(15 + 1, ThetaPrime);
619 
620  return WorkVec;
621 }
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
const Mat3x3 R1h
Definition: drvhinge.h:51
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual Vec3 GetP(void) const
Definition: tpldrive.h:121
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:154
const StructNode * pNode2
Definition: drvhinge.h:50
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode1
Definition: drvhinge.h:49
Vec3 ThetaCurr
Definition: drvhinge.h:58
const Mat3x3 R2h
Definition: drvhinge.h:52
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 DriveHingeJoint::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 154 of file drvhinge.h.

Referenced by InitialAssJac(), and InitialAssRes().

155  {
156  *piNumRows = 18;
157  *piNumCols = 18;
158  };
void DriveHingeJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 94 of file drvhinge.cc.

References ToBeOutput::bToBeOutput(), dRaDegr, WithLabel::GetLabel(), StructNode::GetRCurr(), OutputHandler::Joints(), M, MatR2EulerAngles(), Joint::Output(), pNode1, pNode2, R1h, R2h, ThetaCurr, and Zero3.

95 {
96  if (bToBeOutput()) {
97  Mat3x3 R1(pNode1->GetRCurr()*R1h);
98  Vec3 d(MatR2EulerAngles(R1.Transpose()*(pNode2->GetRCurr()*R2h)));
99  Joint::Output(OH.Joints(), "DriveHinge", GetLabel(),
100  Zero3, M, Zero3, R1*M)
101  << " " << d*dRaDegr
102  << " " << ThetaCurr << std::endl;
103  }
104 }
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 Mat3x3 R1h
Definition: drvhinge.h:51
const StructNode * pNode2
Definition: drvhinge.h:50
const doublereal dRaDegr
Definition: matvec3.cc:884
std::ostream & Joints(void) const
Definition: output.h:443
Vec3 MatR2EulerAngles(const Mat3x3 &R)
Definition: matvec3.cc:887
const StructNode * pNode1
Definition: drvhinge.h:49
Vec3 ThetaCurr
Definition: drvhinge.h:58
const Mat3x3 R2h
Definition: drvhinge.h:52
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 * DriveHingeJoint::ParseHint ( DataManager pDM,
const char *  s 
) const
virtual

Reimplemented from SimulationEntity.

Definition at line 150 of file drvhinge.cc.

References SimulationEntity::ParseHint(), and STRLENOF.

151 {
152  if (strncasecmp(s, "hinge{" /*}*/ , STRLENOF("hinge{" /*}*/ )) == 0)
153  {
154  s += STRLENOF("hinge{" /*}*/ );
155 
156  if (strcmp(&s[1], /*{*/ "}") != 0) {
157  return 0;
158  }
159 
160  switch (s[0]) {
161  case '1':
162  return new Joint::HingeHint<1>;
163 
164  case '2':
165  return new Joint::HingeHint<2>;
166  }
167  }
168 
169  /* take care of "drive" hint... */
170  return SimulationEntity::ParseHint(pDM, s);
171 }
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 & DriveHingeJoint::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 79 of file drvhinge.cc.

References WithLabel::GetLabel(), Mat3x3::GetVec(), TplDriveOwner< Vec3 >::pGetDriveCaller(), pNode1, pNode2, R1h, R2h, TplDriveCaller< T >::Restart(), Joint::Restart(), and Write().

80 {
81  Joint::Restart(out) << ", drive hinge, "
82  << pNode1->GetLabel() << ", reference, node, 1, ",
83  (R1h.GetVec(1)).Write(out, ", ")
84  << ", 2, ", (R1h.GetVec(2)).Write(out, ", ") << ", "
85  << pNode2->GetLabel() << ", reference, node, 1, ",
86  (R2h.GetVec(1)).Write(out, ", ")
87  << ", 2, ", (R2h.GetVec(2)).Write(out, ", ") << ", ",
88  pGetDriveCaller()->Restart(out) << ';' << std::endl;
89  return out;
90 }
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const Mat3x3 R1h
Definition: drvhinge.h:51
TplDriveCaller< Vec3 > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
const StructNode * pNode2
Definition: drvhinge.h:50
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
virtual std::ostream & Restart(std::ostream &out) const =0
const StructNode * pNode1
Definition: drvhinge.h:49
const Mat3x3 R2h
Definition: drvhinge.h:52
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 107 of file drvhinge.cc.

References StructNode::GetRCurr(), MBDYN_EXCEPT_ARGS, TplDriveHint< T >::pCreateDrive(), pNode1, pNode2, R1h, R2h, TplDriveOwner< T >::Set(), Mat3x3::Transpose(), and WithLabel::uLabel.

110 {
111  if (ph) {
112  for (unsigned i = 0; i < ph->size(); i++) {
113  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
114 
115  if (pjh) {
116  if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
118 
119  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
121 
122  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
123  /* TODO */
124  }
125  continue;
126  }
127 
128  TplDriveHint<Vec3> *pdh = dynamic_cast<TplDriveHint<Vec3> *>((*ph)[i]);
129 
130  if (pdh) {
131  pedantic_cout("DriveHingeJoint(" << uLabel << "): "
132  "creating drive from hint[" << i << "]..." << std::endl);
133 
134  TplDriveCaller<Vec3> *pDC = pdh->pCreateDrive(pDM);
135  if (pDC == 0) {
136  silent_cerr("DriveHingeJoint(" << uLabel << "): "
137  "unable to create drive "
138  "after hint #" << i << std::endl);
140  }
141 
143  continue;
144  }
145  }
146  }
147 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const Mat3x3 R1h
Definition: drvhinge.h:51
void Set(const TplDriveCaller< T > *pDC)
Definition: tpldrive.h:97
const StructNode * pNode2
Definition: drvhinge.h:50
unsigned int uLabel
Definition: withlab.h:44
TplDriveCaller< T > * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.h:124
const StructNode * pNode1
Definition: drvhinge.h:49
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
const Mat3x3 R2h
Definition: drvhinge.h:52

Here is the call graph for this function:

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

Implements Elem.

Definition at line 127 of file drvhinge.h.

Referenced by AssJac(), and AssRes().

128  {
129  *piNumRows = 9;
130  *piNumCols = 9;
131  };

Member Data Documentation

bool DriveHingeJoint::bFirstRes
protected

Definition at line 62 of file drvhinge.h.

Referenced by AfterPredict(), and AssVec().

Vec3 DriveHingeJoint::M
protected

Definition at line 60 of file drvhinge.h.

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

const StructNode* DriveHingeJoint::pNode1
protected
const StructNode* DriveHingeJoint::pNode2
protected
const Mat3x3 DriveHingeJoint::R1h
protected

Definition at line 51 of file drvhinge.h.

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

Mat3x3 DriveHingeJoint::R1Ref
protected

Definition at line 54 of file drvhinge.h.

Referenced by AfterPredict(), and AssMat().

const Mat3x3 DriveHingeJoint::R2h
protected

Definition at line 52 of file drvhinge.h.

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

Mat3x3 DriveHingeJoint::RRef
protected

Definition at line 55 of file drvhinge.h.

Referenced by AfterPredict(), and AssMat().

Vec3 DriveHingeJoint::ThetaCurr
protected

Definition at line 58 of file drvhinge.h.

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

Vec3 DriveHingeJoint::ThetaRef
protected

Definition at line 57 of file drvhinge.h.

Referenced by AfterPredict().


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