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

#include <univj.h>

Inheritance diagram for UniversalPinJoint:
Collaboration diagram for UniversalPinJoint:

Public Member Functions

 UniversalPinJoint (unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &X0Tmp, const Mat3x3 &R0Tmp, const Vec3 &dTmp, const Mat3x3 &RhTmp, flag fOut)
 
 ~UniversalPinJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual 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)
 
virtual 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 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 unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
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)
 

Private Attributes

const StructNodepNode
 
Vec3 X0
 
Mat3x3 R0
 
Vec3 d
 
Mat3x3 Rh
 
Vec3 F
 
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
 

Detailed Description

Definition at line 242 of file univj.h.

Constructor & Destructor Documentation

UniversalPinJoint::UniversalPinJoint ( unsigned int  uL,
const DofOwner pDO,
const StructNode pN,
const Vec3 X0Tmp,
const Mat3x3 R0Tmp,
const Vec3 dTmp,
const Mat3x3 RhTmp,
flag  fOut 
)

Definition at line 1116 of file univj.cc.

References NO_OP.

1121 : Elem(uL, fOut),
1122 Joint(uL, pDO, fOut),
1123 pNode(pN),
1124 X0(X0Tmp), R0(R0Tmp), d(dTmp), Rh(RhTmp), F(Zero3), dM(0.)
1125 {
1126  NO_OP;
1127 }
const Vec3 Zero3(0., 0., 0.)
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
#define NO_OP
Definition: myassert.h:74
const StructNode * pNode
Definition: univj.h:244
doublereal dM
Definition: univj.h:250
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
UniversalPinJoint::~UniversalPinJoint ( void  )

Definition at line 1131 of file univj.cc.

References NO_OP.

1132 {
1133  NO_OP;
1134 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 1159 of file univj.cc.

References FullSubMatrixHandler::Add(), d, DEBUGCOUT, dM, F, StructNode::GetRRef(), Mat3x3::GetVec(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), MatCross, MatCrossCross, pNode, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R, R0, FullSubMatrixHandler::ResizeReset(), Rh, VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), and WorkSpaceDim().

1163 {
1164  DEBUGCOUT("Entering UniversalPinJoint::AssJac()" << std::endl);
1165 
1166  FullSubMatrixHandler& WM = WorkMat.SetFull();
1167 
1168  /* Dimensiona e resetta la matrice di lavoro */
1169  integer iNumRows = 0;
1170  integer iNumCols = 0;
1171  WorkSpaceDim(&iNumRows, &iNumCols);
1172  WM.ResizeReset(iNumRows, iNumCols);
1173 
1174  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1175  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
1176  integer iFirstReactionIndex = iGetFirstIndex();
1177 
1178  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1179  WM.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
1180  WM.PutColIndex(iCnt, iFirstPositionIndex + iCnt);
1181  }
1182 
1183  for (int iCnt = 1; iCnt <= 4; iCnt++) {
1184  WM.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
1185  WM.PutColIndex(6 + iCnt, iFirstReactionIndex + iCnt);
1186  }
1187 
1188  const Mat3x3& R(pNode->GetRRef());
1189  Vec3 dTmp(R*d);
1190 
1191  /* termini di reazione sul nodo (forza e momento) */
1192  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1193  WM.PutCoef(iCnt, 6 + iCnt, -1.);
1194  }
1195 
1196  WM.Sub(4, 7, Mat3x3(MatCross, dTmp));
1197 
1198  /* Note: F and dM updated by AssRes */
1199  Vec3 e3(R0.GetVec(3));
1200  Vec3 e2(R*Rh.GetVec(2));
1201  Vec3 MTmp(e2*(dM*dCoef));
1202  Vec3 FTmp(F*dCoef);
1203 
1204  Mat3x3 e3aWedgeMWedge(MatCrossCross, e3, MTmp);
1205 
1206  WM.Sub(4, 4, Mat3x3(MatCrossCross, FTmp, dTmp) + e3aWedgeMWedge);
1207 
1208  Vec3 Tmp(e2.Cross(e3));
1209 
1210  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1211  doublereal d = Tmp(iCnt);
1212  WM.PutCoef(3 + iCnt, 10, -d);
1213  }
1214 
1215  /* Modifica: divido le equazioni di vincolo per dCoef */
1216 
1217  /* termini di vincolo dovuti al nodo 1 */
1218  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1219  // position, delta x
1220  WM.PutCoef(6 + iCnt, iCnt, -1.);
1221 
1222  // orientation, delta g
1223  doublereal d = Tmp(iCnt);
1224  WM.PutCoef(6 + 3 + 1, 3 + iCnt, -d);
1225  }
1226 
1227  // position, delta g
1228  WM.Add(6 + 1, 3 + 1, Mat3x3(MatCross, dTmp));
1229 
1230  return WorkMat;
1231 }
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
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: univj.h:280
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
const StructNode * pNode
Definition: univj.h:244
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
doublereal dM
Definition: univj.h:250
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Mat3x3 R

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1235 of file univj.cc.

References VectorHandler::Add(), ASSERT, d, DEBUGCOUT, dM, F, StructNode::GetRCurr(), Mat3x3::GetVec(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), R, R0, VectorHandler::ResizeReset(), Rh, WorkSpaceDim(), and X0.

1239 {
1240  DEBUGCOUT("Entering UniversalPinJoint::AssRes()" << std::endl);
1241 
1242  /* Dimensiona e resetta la matrice di lavoro */
1243  integer iNumRows = 0;
1244  integer iNumCols = 0;
1245  WorkSpaceDim(&iNumRows, &iNumCols);
1246  WorkVec.ResizeReset(iNumRows);
1247 
1248  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
1249  integer iFirstReactionIndex = iGetFirstIndex();
1250 
1251  /* Indici dei nodi */
1252  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1253  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
1254  }
1255 
1256  /* Indici del vincolo */
1257  for (int iCnt = 1; iCnt <= 4; iCnt++) {
1258  WorkVec.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
1259  }
1260 
1261  F = Vec3(XCurr, iFirstReactionIndex + 1);
1262  dM = XCurr(iFirstReactionIndex + 4);
1263 
1264  const Vec3& x(pNode->GetXCurr());
1265  const Mat3x3& R(pNode->GetRCurr());
1266 
1267  Vec3 dTmp(R*d);
1268 
1269  Vec3 e3(R0.GetVec(3));
1270  Vec3 e2(R*Rh.GetVec(2));
1271 
1272  WorkVec.Add(1, F);
1273  WorkVec.Add(4, dTmp.Cross(F) + e2.Cross(e3)*dM);
1274 
1275  /* Modifica: divido le equazioni di vincolo per dCoef */
1276  ASSERT(dCoef != 0.);
1277  WorkVec.Add(7, (x + dTmp - X0)/dCoef);
1278 
1279  WorkVec.PutCoef(10, e3.Dot(e2)/dCoef);
1280 
1281  return WorkVec;
1282 }
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
#define ASSERT(expression)
Definition: colamd.c:977
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: univj.h:280
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode
Definition: univj.h:244
doublereal dM
Definition: univj.h:250
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
Mat3x3 R

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 323 of file univj.h.

References pNode.

323  {
324  connectedNodes.resize(1);
325  connectedNodes[0] = pNode;
326  };
const StructNode * pNode
Definition: univj.h:244
virtual DofOrder::Order UniversalPinJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 274 of file univj.h.

References DofOrder::ALGEBRAIC, and ASSERT.

274  {
275  ASSERT(i >= 0 && i < 4);
276  return DofOrder::ALGEBRAIC;
277  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual Joint::Type UniversalPinJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 262 of file univj.h.

References Joint::UNIVERSALPIN.

262  {
263  return Joint::UNIVERSALPIN;
264  };
virtual unsigned int UniversalPinJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 300 of file univj.h.

300  {
301  return 8;
302  };
virtual unsigned int UniversalPinJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 269 of file univj.h.

269  {
270  return 4;
271  };
VariableSubMatrixHandler & UniversalPinJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1302 of file univj.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), d, DEBUGCOUT, dM, F, WithLabel::GetLabel(), StructNode::GetRRef(), Mat3x3::GetVec(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), MatCross, MatCrossCross, MBDYN_EXCEPT_ARGS, pNode, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R, R0, FullSubMatrixHandler::ResizeReset(), Rh, and VariableSubMatrixHandler::SetFull().

1304 {
1305  DEBUGCOUT("Entering UniversalPinJoint::InitialAssJac()" << std::endl);
1306 
1307  FullSubMatrixHandler& WM = WorkMat.SetFull();
1308 
1309  /* Dimensiona e resetta la matrice di lavoro */
1310  integer iNumRows = 0;
1311  integer iNumCols = 0;
1312  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1313  WM.ResizeReset(iNumRows, iNumCols);
1314 
1315  /* Equazioni: vedi joints.dvi */
1316 
1317  /* Indici */
1318  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1319  integer iFirstVelocityIndex = iFirstPositionIndex + 6;
1320  integer iFirstReactionIndex = iGetFirstIndex();
1321  integer iReactionPrimeIndex = iFirstReactionIndex + 4;
1322 
1323  /* Setto gli indici */
1324  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1325  WM.PutRowIndex(iCnt, iFirstPositionIndex + iCnt);
1326  WM.PutColIndex(iCnt, iFirstPositionIndex + iCnt);
1327  WM.PutRowIndex(6 + iCnt, iFirstVelocityIndex + iCnt);
1328  WM.PutColIndex(6 + iCnt, iFirstVelocityIndex + iCnt);
1329  }
1330 
1331  for (int iCnt = 1; iCnt <= 8; iCnt++) {
1332  WM.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
1333  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
1334  }
1335 
1336  /* Recupera i dati */
1337  const Mat3x3& R(pNode->GetRRef());
1338  const Vec3& Omega(pNode->GetWRef());
1339  /* F, M sono state aggiornate da InitialAssRes */
1340  Vec3 FPrime(XCurr, iReactionPrimeIndex + 1);
1341  doublereal dMPrime(XCurr(iReactionPrimeIndex + 4));
1342 
1343  /* Matrici identita' */
1344  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1345  /* Contributo di forza all'equazione della forza */
1346  WM.PutCoef(iCnt, 12 + iCnt, 1.);
1347 
1348  /* Contrib. di der. di forza all'eq. della der. della forza */
1349  WM.PutCoef(6 + iCnt, 16 + iCnt, 1.);
1350 
1351  /* Equazione di vincolo */
1352  WM.PutCoef(12 + iCnt, iCnt, -1.);
1353 
1354  /* Derivata dell'equazione di vincolo */
1355  WM.PutCoef(16 + iCnt, 6 + iCnt, -1.);
1356  }
1357 
1358  /* Distanza nel sistema globale */
1359  Vec3 dTmp(R*d);
1360 
1361  Vec3 e3(R0.GetVec(3));
1362  Vec3 e2(R*Rh.GetVec(2));
1363 
1364  /* Vettori temporanei */
1365  Vec3 Tmp(e2.Cross(e3));
1366 
1367  /* Prodotto vettore tra il versore 3 della cerniera secondo il nodo 1
1368  * ed il versore 1 della cerniera secondo il nodo 2. A convergenza
1369  * devono essere ortogonali, quindi il loro prodotto vettore deve essere
1370  * unitario */
1371 
1372  /* Error handling: il programma si ferma, pero' segnala dov'e' l'errore */
1373  if (Tmp.Dot() < std::numeric_limits<doublereal>::epsilon()) {
1374  silent_cerr("CardanoPinJoint(" << GetLabel() << "): "
1375  "node and fixed point hinge axes are (nearly) orthogonal"
1376  << std::endl);
1378  }
1379 
1380  Vec3 TmpPrime(e3.Cross(e2.Cross(Omega)));
1381 
1382  /* Ruota il momento e la sua derivata con le matrici della cerniera
1383  * rispetto ai nodi */
1384  Vec3 MTmp(e2*dM);
1385  Vec3 MPrimeTmp(e2*dMPrime);
1386 
1387  Mat3x3 MDeltag(Mat3x3(MatCrossCross, e3, MPrimeTmp) + e3.Cross(Mat3x3(MatCrossCross, Omega, MTmp)));
1388 
1389  /* Matrici F/\d/\ */
1390  Mat3x3 FWedgedWedge(MatCrossCross, F, dTmp);
1391 
1392  /* Matrici (omega/\d)/\ */
1393  Mat3x3 OWedgedWedge(MatCross, Omega.Cross(dTmp));
1394 
1395  /* Equazione di momento */
1396  WM.Add(4, 4, FWedgedWedge + Mat3x3(MatCrossCross, e3, MTmp));
1397  WM.Add(4, 13, Mat3x3(MatCross, dTmp));
1398 
1399  /* Derivata dell'equazione di momento */
1400  WM.Add(10, 4, (Mat3x3(MatCross, FPrime) + Mat3x3(MatCrossCross, F, Omega))*Mat3x3(MatCross, dTmp) + MDeltag);
1401  WM.Add(10, 10, FWedgedWedge + Mat3x3(MatCrossCross, e3, MTmp));
1402  WM.Add(10, 13, OWedgedWedge);
1403  WM.Add(10, 17, Mat3x3(MatCross, dTmp));
1404 
1405  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1406  doublereal d = Tmp(iCnt);
1407  WM.PutCoef(3 + iCnt, 16, d);
1408  WM.PutCoef(9 + iCnt, 20, d);
1409 
1410  WM.PutCoef(9 + iCnt, 16, TmpPrime(iCnt));
1411  }
1412 
1413  /* Equazione di vincolo */
1414  WM.Add(13, 4, Mat3x3(MatCross, dTmp));
1415 
1416  /* Derivata dell'equazione di vincolo */
1417  WM.Add(17, 4, OWedgedWedge);
1418  WM.Add(17, 10, Mat3x3(MatCross, dTmp));
1419 
1420  /* Equazioni di vincolo di rotazione: e2b~e3a */
1421  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1422  doublereal d = -Tmp(iCnt);
1423  WM.PutCoef(16, 3 + iCnt, d);
1424 
1425  /* Queste sono per la derivata dell'equazione, sono qui solo per
1426  * ottimizzazione */
1427  WM.PutCoef(20, 9 + iCnt, d);
1428  }
1429 
1430  /* Derivate delle equazioni di vincolo di rotazione: e2b~e3a */
1431  TmpPrime = e2.Cross(Omega.Cross(e3));
1432  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1433  WM.PutCoef(20, 3 + iCnt, TmpPrime(iCnt));
1434  }
1435 
1436  return WorkMat;
1437 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
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
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: univj.h:304
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
const StructNode * pNode
Definition: univj.h:244
doublereal dM
Definition: univj.h:250
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Mat3x3 R

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 1442 of file univj.cc.

References VectorHandler::Add(), Vec3::Cross(), d, DEBUGCOUT, dM, F, StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), R, R0, VectorHandler::ResizeReset(), Rh, VectorHandler::Sub(), and X0.

1444 {
1445  DEBUGCOUT("Entering UniversalPinJoint::InitialAssRes()" << std::endl);
1446 
1447  /* Dimensiona e resetta la matrice di lavoro */
1448  integer iNumRows = 0;
1449  integer iNumCols = 0;
1450  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1451  WorkVec.ResizeReset(iNumRows);
1452 
1453  /* Indici */
1454  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1455  integer iFirstVelocityIndex = iFirstPositionIndex + 6;
1456  integer iFirstReactionIndex = iGetFirstIndex();
1457  integer iReactionPrimeIndex = iFirstReactionIndex + 4;
1458 
1459  /* Setta gli indici */
1460  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1461  WorkVec.PutRowIndex(iCnt, iFirstPositionIndex + iCnt);
1462  WorkVec.PutRowIndex(6 + iCnt, iFirstVelocityIndex + iCnt);
1463  }
1464 
1465  for (int iCnt = 1; iCnt <= 8; iCnt++) {
1466  WorkVec.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
1467  }
1468 
1469  /* Recupera i dati */
1470  const Vec3& x(pNode->GetXCurr());
1471  const Vec3& v(pNode->GetVCurr());
1472  const Mat3x3& R(pNode->GetRCurr());
1473  const Vec3& Omega(pNode->GetWCurr());
1474 
1475  F = Vec3(XCurr, iFirstReactionIndex + 1);
1476  dM = XCurr(iFirstReactionIndex + 4);
1477  Vec3 FPrime(XCurr, iReactionPrimeIndex + 1);
1478  doublereal dMPrime(XCurr(iReactionPrimeIndex + 4));
1479 
1480  /* Versori delle cerniere */
1481  Vec3 e3(R0.GetVec(3));
1482  Vec3 e2(R*Rh.GetVec(2));
1483 
1484  /* Vettori temporanei */
1485  Vec3 Tmp(e2.Cross(e3));
1486 
1487  Vec3 TmpPrime(e3.Cross(e2.Cross(Omega)));
1488 
1489  /* Distanza nel sistema globale */
1490  Vec3 dTmp(R*d);
1491 
1492  /* Vettori omega/\d */
1493  Vec3 OWedged(Omega.Cross(dTmp));
1494 
1495  /* Ruota il momento e la sua derivata con le matrici della cerniera
1496  * rispetto ai nodi */
1497  Vec3 MTmp(e2*dM);
1498  Vec3 MPrimeTmp(e3.Cross(MTmp.Cross(Omega)) + e2.Cross(e3)*dMPrime);
1499 
1500  /* Equazioni di equilibrio */
1501  WorkVec.Sub(1, F);
1502  WorkVec.Sub(4, dTmp.Cross(F) - MTmp.Cross(e3));
1503 
1504  /* Derivate delle equazioni di equilibrio, nodo 1 */
1505  WorkVec.Sub(7, FPrime);
1506  WorkVec.Sub(10, dTmp.Cross(FPrime) + OWedged.Cross(F) + MPrimeTmp);
1507 
1508  /* Equazione di vincolo di posizione */
1509  WorkVec.Add(13, x + dTmp - X0);
1510 
1511  /* Equazioni di vincolo di rotazione */
1512  WorkVec.PutCoef(16, e2*e3);
1513 
1514  /* Derivata dell'equazione di vincolo di posizione */
1515  WorkVec.Add(17, v + OWedged);
1516 
1517  /* Derivate delle equazioni di vincolo di rotazione: e2b~e3a */
1518  Tmp = e3.Cross(Omega);
1519  WorkVec.PutCoef(20, e2*Tmp);
1520 
1521  return WorkVec;
1522 }
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
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
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 InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: univj.h:304
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const StructNode * pNode
Definition: univj.h:244
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
doublereal dM
Definition: univj.h:250
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Mat3x3 R

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 304 of file univj.h.

Referenced by InitialAssJac(), and InitialAssRes().

304  {
305  *piNumRows = 20;
306  *piNumCols = 20;
307  };
void UniversalPinJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 1286 of file univj.cc.

References ToBeOutput::bToBeOutput(), dM, dRaDegr, F, WithLabel::GetLabel(), StructNode::GetRCurr(), Mat3x3::GetVec(), OutputHandler::Joints(), MatR2EulerAngles(), Joint::Output(), pNode, R0, Rh, and Mat3x3::Transpose().

1287 {
1288  if (bToBeOutput()) {
1289  Mat3x3 RTmp(pNode->GetRCurr()*Rh);
1290  Vec3 vTmp(RTmp.GetVec(2).Cross(R0.GetVec(3)));
1291 
1292  Joint::Output(OH.Joints(), "CardanoPin", GetLabel(),
1293  RTmp.MulTV(F), Vec3(dM, 0., 0.), F, vTmp*dM)
1294  << " " << MatR2EulerAngles(R0.Transpose()*RTmp)*dRaDegr
1295  << std::endl;
1296  }
1297 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
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
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
const StructNode * pNode
Definition: univj.h:244
doublereal dM
Definition: univj.h:250
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 & UniversalPinJoint::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 1139 of file univj.cc.

References d, WithLabel::GetLabel(), Mat3x3::GetVec(), pNode, R0, Joint::Restart(), Rh, Write(), Vec3::Write(), and X0.

1140 {
1141  Joint::Restart(out) << ", universal pin, "
1142  << pNode->GetLabel() << ", "
1143  "reference, node, ", d.Write(out, ", ") << ", "
1144  "hinge, reference, node, "
1145  "1, ", (Rh.GetVec(1)).Write(out, ", ") << ", "
1146  "2, ", (Rh.GetVec(2)).Write(out, ", ") << ", "
1147  "reference, global, ", X0.Write(out, ", ") << ", "
1148  "reference, global, "
1149  "1, ", (R0.GetVec(1)).Write(out, ", ") << ", "
1150  "2, ", (R0.GetVec(2)).Write(out, ", ") << ';'
1151  << std::endl;
1152 
1153  return out;
1154 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
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
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
const StructNode * pNode
Definition: univj.h:244
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Definition at line 280 of file univj.h.

Referenced by AssJac(), and AssRes().

280  {
281  *piNumRows = 10;
282  *piNumCols = 10;
283  };

Member Data Documentation

Vec3 UniversalPinJoint::d
private

Definition at line 247 of file univj.h.

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

doublereal UniversalPinJoint::dM
private

Definition at line 250 of file univj.h.

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

Vec3 UniversalPinJoint::F
private

Definition at line 249 of file univj.h.

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

const StructNode* UniversalPinJoint::pNode
private

Definition at line 244 of file univj.h.

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

Mat3x3 UniversalPinJoint::R0
private

Definition at line 246 of file univj.h.

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

Mat3x3 UniversalPinJoint::Rh
private

Definition at line 248 of file univj.h.

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

Vec3 UniversalPinJoint::X0
private

Definition at line 245 of file univj.h.

Referenced by AssRes(), InitialAssRes(), and Restart().


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