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

#include <drvj.h>

Inheritance diagram for AngularVelocityJoint:
Collaboration diagram for AngularVelocityJoint:

Public Member Functions

 AngularVelocityJoint (unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &TmpDir, const DriveCaller *pDC, flag fOut)
 
 ~AngularVelocityJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
DofOrder::Order GetDofType (unsigned int i) const
 
void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void Output (OutputHandler &OH) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual 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 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 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 HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
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 SetValue (DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
 
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 DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 

Private Attributes

const StructNodepNode
 
Vec3 Dir
 
doublereal dM
 

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
}
 
- 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 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 DriveOwner
DriveCallerpDriveCaller
 

Detailed Description

Definition at line 133 of file drvj.h.

Constructor & Destructor Documentation

AngularVelocityJoint::AngularVelocityJoint ( unsigned int  uL,
const DofOwner pDO,
const StructNode pN,
const Vec3 TmpDir,
const DriveCaller pDC,
flag  fOut 
)

Definition at line 253 of file drvj.cc.

References NO_OP.

259 : Elem(uL, fOut),
260 Joint(uL, pDO, fOut),
261 DriveOwner(pDC),
262 pNode(pN), Dir(TmpDir), dM(0.)
263 {
264  NO_OP;
265 }
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
#define NO_OP
Definition: myassert.h:74
doublereal dM
Definition: drvj.h:138
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const StructNode * pNode
Definition: drvj.h:136
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
AngularVelocityJoint::~AngularVelocityJoint ( void  )

Definition at line 269 of file drvj.cc.

References NO_OP.

270 {
271  NO_OP;
272 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 312 of file drvj.cc.

References DEBUGCOUT, Vec3::dGet(), Dir, dM, StructNode::GetRRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), pNode, SparseSubMatrixHandler::PutCross(), SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

316 {
317  DEBUGCOUT("Entering AngularVelocityJoint::AssJac()" << std::endl);
318 
319  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
320  WM.ResizeReset(12, 0);
321 
322  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex()+3;
323  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex()+3;
324  integer iFirstReactionIndex = iGetFirstIndex();
325 
326  Vec3 TmpDir(pNode->GetRRef()*Dir);
327 
328  for (int iCnt = 1; iCnt <= 3; iCnt++) {
329  doublereal d = TmpDir.dGet(iCnt);
330  WM.PutItem(iCnt, iFirstMomentumIndex+iCnt,
331  iFirstReactionIndex+1, d);
332  WM.PutItem(3+iCnt, iFirstReactionIndex+1,
333  iFirstPositionIndex+iCnt, d);
334  }
335 
336  WM.PutCross(7, iFirstMomentumIndex,
337  iFirstPositionIndex, TmpDir*(-dM*dCoef));
338 
339  return WorkMat;
340 }
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutCross(integer iSubIt, integer iFirstRow, integer iFirstCol, const Vec3 &v)
Definition: submat.cc:1236
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
doublereal dM
Definition: drvj.h:138
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const StructNode * pNode
Definition: drvj.h:136
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 344 of file drvj.cc.

References VectorHandler::Add(), DEBUGCOUT, DriveOwner::dGet(), Dir, dM, StructNode::GetRCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and WorkSpaceDim().

348 {
349  DEBUGCOUT("Entering AngularVelocityJoint::AssRes()" << std::endl);
350 
351  /* Dimensiona e resetta la matrice di lavoro */
352  integer iNumRows = 0;
353  integer iNumCols = 0;
354  this->WorkSpaceDim(&iNumRows, &iNumCols);
355  WorkVec.ResizeReset(iNumRows);
356 
357  /* Indici */
358  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex()+3;
359  integer iFirstReactionIndex = iGetFirstIndex();
360 
361  /* Indici del nodo */
362  for (int iCnt = 1; iCnt <= 3; iCnt++) {
363  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex+iCnt);
364  }
365 
366  WorkVec.PutRowIndex(4, iFirstReactionIndex+1);
367 
368  /* Aggiorna i dati propri */
369  dM = XCurr(iFirstReactionIndex+1);
370 
371  /* Recupera i dati */
372  Vec3 Omega(pNode->GetWCurr());
373  Vec3 TmpDir(pNode->GetRCurr()*Dir);
374 
375  /* Equazioni di equilibrio, nodo 1 */
376  WorkVec.Add(1, TmpDir*(-dM));
377 
378 
379  /* Equazione di vincolo di velocita' */
380  doublereal dw0 = dGet();
381  WorkVec.PutCoef(4, dw0-TmpDir.Dot(Omega));
382 
383  return WorkVec;
384 }
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal dGet(void) const
Definition: drive.cc:671
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:169
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
doublereal dM
Definition: drvj.h:138
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const StructNode * pNode
Definition: drvj.h:136
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 304 of file drvj.cc.

References ASSERT, and DriveOwner::dGet().

305 {
306  ASSERT(i == 1);
307 
308  return dGet();
309 }
doublereal dGet(void) const
Definition: drive.cc:671
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 213 of file drvj.h.

References pNode.

213  {
214  connectedNodes.resize(1);
215  connectedNodes[0] = pNode;
216  };
const StructNode * pNode
Definition: drvj.h:136
DofOrder::Order AngularVelocityJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 163 of file drvj.h.

References DofOrder::ALGEBRAIC, and ASSERT.

164  {
165  ASSERT(i == 0);
166  return DofOrder::ALGEBRAIC;
167  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual Joint::Type AngularVelocityJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 153 of file drvj.h.

References Joint::ANGULARVELOCITY.

virtual unsigned int AngularVelocityJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 187 of file drvj.h.

187  {
188  return 1;
189  };
virtual unsigned int AngularVelocityJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 159 of file drvj.h.

159  {
160  return 1;
161  };
unsigned int AngularVelocityJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 286 of file drvj.cc.

287 {
288  return 1;
289 }
unsigned int AngularVelocityJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 292 of file drvj.cc.

References ASSERT.

293 {
294  ASSERT(s != NULL);
295 
296  if (strcmp(s, "w") == 0) {
297  return 1;
298  }
299 
300  return 0;
301 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & AngularVelocityJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 401 of file drvj.cc.

References Vec3::Cross(), DEBUGCOUT, Vec3::dGet(), Dir, dM, StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), pNode, SparseSubMatrixHandler::PutCross(), SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

403 {
404  DEBUGCOUT("Entering AngularVelocityJoint::InitialAssJac()" << std::endl);
405 
406  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
407  WM.ResizeReset(15, 0);
408 
409  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex()+3;
410  integer iFirstVelocityIndex = iFirstPositionIndex+6;
411  integer iFirstReactionIndex = iGetFirstIndex();
412 
413  Vec3 Tmp(Dir.Cross(pNode->GetWRef()));
414  for(int iCnt = 1; iCnt <= 3; iCnt++)
415  {
416  doublereal d = Dir.dGet(iCnt);
417  WM.PutItem(iCnt, iFirstVelocityIndex+iCnt,
418  iFirstReactionIndex+1, d);
419  WM.PutItem(3+iCnt, iFirstReactionIndex+1,
420  iFirstVelocityIndex+iCnt, d);
421  WM.PutItem(6+iCnt, iFirstReactionIndex+1,
422  iFirstPositionIndex+iCnt, Tmp.dGet(iCnt));
423  }
424 
425  WM.PutCross(10, iFirstVelocityIndex, iFirstPositionIndex, Dir*(-dM));
426 
427  return WorkMat;
428 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
void PutCross(integer iSubIt, integer iFirstRow, integer iFirstCol, const Vec3 &v)
Definition: submat.cc:1236
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
doublereal dM
Definition: drvj.h:138
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const StructNode * pNode
Definition: drvj.h:136
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 433 of file drvj.cc.

References VectorHandler::Add(), DEBUGCOUT, DriveOwner::dGet(), Dir, dM, Vec3::Dot(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), and VectorHandler::ResizeReset().

435 {
436  DEBUGCOUT("Entering AngularVelocityJoint::InitialAssRes()" << std::endl);
437 
438  /* Dimensiona e resetta la matrice di lavoro */
439  integer iNumRows = 0;
440  integer iNumCols = 0;
441  this->InitialWorkSpaceDim(&iNumRows, &iNumCols);
442  WorkVec.ResizeReset(iNumRows);
443 
444  /* Indici */
445  integer iFirstVelocityIndex = pNode->iGetFirstPositionIndex()+9;
446  integer iFirstReactionIndex = iGetFirstIndex();
447 
448  /* Indici del nodo */
449  for(int iCnt = 1; iCnt <= 3; iCnt++)
450  {
451  WorkVec.PutRowIndex(iCnt, iFirstVelocityIndex+iCnt);
452  }
453 
454  WorkVec.PutRowIndex(4, iFirstReactionIndex+1);
455 
456  /* Aggiorna i dati propri */
457  dM = XCurr(iFirstReactionIndex+1);
458 
459  /* Recupera i dati */
460  Vec3 Omega(pNode->GetWCurr());
461 
462  /* Equazioni di equilibrio, nodo 1 */
463  WorkVec.Add(1, -Dir*dM);
464 
465  /* Equazione di vincolo di velocita' */
466  doublereal dw0 = dGet();
467  WorkVec.PutCoef(4, dw0-Dir.Dot(Omega));
468 
469  return WorkVec;
470 }
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dGet(void) const
Definition: drive.cc:671
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:191
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
doublereal dM
Definition: drvj.h:138
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const StructNode * pNode
Definition: drvj.h:136
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 191 of file drvj.h.

Referenced by InitialAssRes().

192  {
193  *piNumRows = 4;
194  *piNumCols = 7;
195  };
void AngularVelocityJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 387 of file drvj.cc.

References ToBeOutput::bToBeOutput(), DriveOwner::dGet(), Dir, dM, WithLabel::GetLabel(), StructNode::GetRCurr(), OutputHandler::Joints(), Joint::Output(), pNode, and Zero3.

388 {
389  if(bToBeOutput()) {
390  Vec3 Tmp(pNode->GetRCurr()*Dir);
391 
392  Joint::Output(OH.Joints(), "AngularVelocity", GetLabel(),
393  Zero3, Vec3(dM, 0., 0.), Zero3, Tmp*dM)
394  << " " << Tmp << " " << dGet() << std::endl;
395  }
396 }
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
doublereal dGet(void) const
Definition: drive.cc:671
std::ostream & Joints(void) const
Definition: output.h:443
doublereal dM
Definition: drvj.h:138
const StructNode * pNode
Definition: drvj.h:136
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:

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

Implements Elem.

Definition at line 276 of file drvj.cc.

References Dir, WithLabel::GetLabel(), DriveOwner::pGetDriveCaller(), pNode, Joint::Restart(), DriveCaller::Restart(), and Vec3::Write().

277 {
278  Joint::Restart(out) << ", angular velocity, "
279  << pNode->GetLabel() << ", reference, node, ",
280  Dir.Write(out, ", ") << ", ";
281  return pGetDriveCaller()->Restart(out) << ';' << std::endl;
282 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
virtual std::ostream & Restart(std::ostream &out) const =0
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const StructNode * pNode
Definition: drvj.h:136
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void AngularVelocityJoint::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 169 of file drvj.h.

Referenced by AssRes().

170  { *piNumRows = 4; *piNumCols = 4; };

Member Data Documentation

Vec3 AngularVelocityJoint::Dir
private

Definition at line 137 of file drvj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), Output(), and Restart().

doublereal AngularVelocityJoint::dM
private

Definition at line 138 of file drvj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Output().

const StructNode* AngularVelocityJoint::pNode
private

Definition at line 136 of file drvj.h.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), InitialAssJac(), InitialAssRes(), Output(), and Restart().


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