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

#include <genj.h>

Inheritance diagram for ClampJoint:
Collaboration diagram for ClampJoint:

Public Member Functions

 ClampJoint (unsigned int uL, const DofOwner *pD, const StructNode *pN, const Vec3 &X0, const Mat3x3 &R0, flag fOut)
 
virtual ~ClampJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
void ReadInitialState (MBDynParser &HP)
 
virtual std::ostream & Restart (std::ostream &out) 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 DofOrder::Order GetEqType (unsigned int i) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
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 SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) 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)
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
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 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
 
- 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 &)
 
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 XClamp
 
Mat3x3 RClamp
 
Vec3 F
 
Vec3 M
 

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 genj.h.

Constructor & Destructor Documentation

ClampJoint::ClampJoint ( unsigned int  uL,
const DofOwner pD,
const StructNode pN,
const Vec3 X0,
const Mat3x3 R0,
flag  fOut 
)

Definition at line 1212 of file genj.cc.

References NO_OP.

1216 : Elem(uL, fOut),
1217 Joint(uL, pD, fOut),
1218 pNode(pN), XClamp(X0), RClamp(R0), F(Zero3), M(Zero3)
1219 {
1220  NO_OP;
1221 }
Mat3x3 RClamp
Definition: genj.h:246
const Vec3 Zero3(0., 0., 0.)
const StructNode * pNode
Definition: genj.h:244
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
#define NO_OP
Definition: myassert.h:74
Vec3 XClamp
Definition: genj.h:245
Vec3 F
Definition: genj.h:247
Vec3 M
Definition: genj.h:248
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
ClampJoint::~ClampJoint ( void  )
virtual

Definition at line 1224 of file genj.cc.

References NO_OP.

1225 {
1226  NO_OP;
1227 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 1378 of file genj.cc.

References DEBUGCOUT, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), pNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

Referenced by AssMats().

1382 {
1383  DEBUGCOUT("Entering ClampJoint::AssJac()" << std::endl);
1384 
1385  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
1386 
1387  /* Dimensiona e resetta la matrice di lavoro */
1388  WM.ResizeReset(12, 1);
1389 
1390  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1391  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
1392  integer iFirstReactionIndex = iGetFirstIndex();
1393 
1394  /* Attenzione: modifico dividendo le equazioni di vincolo per dCoef */
1395  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
1396  WM.PutItem(iCnt, iFirstReactionIndex + iCnt,
1397  iFirstPositionIndex + iCnt, 1.);
1398  WM.PutItem(6 + iCnt, iFirstMomentumIndex + iCnt,
1399  iFirstReactionIndex + iCnt, 1.);
1400  }
1401 
1402  /* Con l'aggiunta dei nodi statici non occorre piu' evitare la
1403  * singolarita' della matrice */
1404 
1405  return WorkMat;
1406 }
const StructNode * pNode
Definition: genj.h:244
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

VariableSubMatrixHandler & ClampJoint::AssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Reimplemented from Elem.

Definition at line 1410 of file genj.cc.

References DEBUGCOUT, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), pNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

1412 {
1413  DEBUGCOUT("Entering ClampJoint::AssJac()" << std::endl);
1414 
1415  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
1416 
1417  /* Dimensiona e resetta la matrice di lavoro */
1418  WM.ResizeReset(6, 1);
1419 
1420  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1421  integer iFirstReactionIndex = iGetFirstIndex();
1422 
1423  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
1424  WM.PutItem(iCnt, iFirstReactionIndex + iCnt,
1425  iFirstPositionIndex + iCnt, 1.);
1426  }
1427 
1428  return WorkMat;
1429 }
const StructNode * pNode
Definition: genj.h:244
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
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 ClampJoint::AssMats ( VariableSubMatrixHandler WorkMatA,
VariableSubMatrixHandler WorkMatB,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Reimplemented from Elem.

Definition at line 1433 of file genj.cc.

References AssJac(), DEBUGCOUT, and VariableSubMatrixHandler::SetNullMatrix().

1437 {
1438  DEBUGCOUT("Entering ClampJoint::AssMats(); will result in call to AssJac()"
1439  << std::endl);
1440 
1441  WorkMatA.SetNullMatrix();
1442  AssJac(WorkMatB, 1., XCurr, XPrimeCurr);
1443 }
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: genj.cc:1378
void SetNullMatrix(void)
Definition: submat.h:1159
#define DEBUGCOUT(msg)
Definition: myassert.h:232

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1447 of file genj.cc.

References ASSERT, DEBUGCOUT, F, StructNode::GetRCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), M, Mat3x3::MulMT(), pNode, SubVectorHandler::PutRowIndex(), R, RClamp, VectorHandler::ResizeReset(), VectorHandler::Sub(), RotManip::VecRot(), and XClamp.

1451 {
1452  DEBUGCOUT("Entering ClampJoint::AssRes()" << std::endl);
1453 
1454  WorkVec.ResizeReset(12);
1455 
1456  /* Indici delle incognite del nodo e delle reazioni */
1457  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
1458  integer iFirstReactionIndex = iGetFirstIndex();
1459  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
1460  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
1461  WorkVec.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
1462  }
1463 
1464  /* Aggiorna le reazioni vincolari */
1465  F = Vec3(XCurr, iFirstReactionIndex + 1);
1466  M = Vec3(XCurr, iFirstReactionIndex + 3 + 1);
1467 
1468  /* Calcola posizione e parametri di rotazione */
1469  const Vec3& x(pNode->GetXCurr());
1470  const Mat3x3& R(pNode->GetRCurr());
1471 
1472  Vec3 theta_c(RotManip::VecRot(R.MulMT(RClamp)));
1473 
1474  /* Residuo della riga di equilibrio */
1475  WorkVec.Sub(1, F);
1476  WorkVec.Sub(3 + 1, M);
1477 
1478  /* Modifica: divido le equazioni di vincolo per dCoef */
1479  ASSERT(dCoef != 0.);
1480  /* Residuo dell'equazione di vincolo */
1481  WorkVec.Sub(6 + 1, (x - XClamp)/dCoef);
1482  WorkVec.Sub(9 + 1, theta_c/dCoef);
1483 
1484  return WorkVec;
1485 }
Mat3x3 RClamp
Definition: genj.h:246
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode
Definition: genj.h:244
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
Vec3 XClamp
Definition: genj.h:245
Vec3 F
Definition: genj.h:247
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
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
Vec3 M
Definition: genj.h:248
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Mat3x3 MulMT(const Mat3x3 &m) const
Definition: matvec3.cc:444
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:

SubVectorHandler & ClampJoint::AssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr,
const VectorHandler XPrimePrimeCurr,
InverseDynamics::Order  iOrder = InverseDynamics::INVERSE_DYNAMICS 
)
virtual

Reimplemented from Elem.

Definition at line 1496 of file genj.cc.

References DEBUGCOUT, StructNode::GetRCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), Mat3x3::MulMT(), pNode, InverseDynamics::POSITION, SubVectorHandler::PutRowIndex(), R, RClamp, VectorHandler::Resize(), VectorHandler::ResizeReset(), VectorHandler::Sub(), RotManip::VecRot(), and XClamp.

1501 {
1502  DEBUGCOUT("Entering ClampJoint::AssRes()" << std::endl);
1503 
1504  /* The residual is != 0 only for position */
1505  if (iOrder == InverseDynamics::POSITION) {
1506  WorkVec.ResizeReset(6);
1507 
1508  /* FIXME: Indici delle incognite */
1509  integer iFirstReactionIndex = iGetFirstIndex();
1510  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
1511  WorkVec.PutRowIndex(iCnt, iFirstReactionIndex+iCnt);
1512  }
1513 
1514  /* Calcola posizione e parametri di rotazione */
1515  const Vec3& x(pNode->GetXCurr());
1516  const Mat3x3& R(pNode->GetRCurr());
1517 
1518  Vec3 theta_c(RotManip::VecRot(R.MulMT(RClamp)));
1519 
1520  /* Residuo dell'equazione di vincolo */
1521  WorkVec.Sub(1, x - XClamp);
1522  WorkVec.Sub(3 + 1, theta_c);
1523 
1524  } else {
1525  WorkVec.Resize(0);
1526  }
1527 
1528  return WorkVec;
1529 }
Mat3x3 RClamp
Definition: genj.h:246
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode
Definition: genj.h:244
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
Vec3 XClamp
Definition: genj.h:245
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Mat3x3 MulMT(const Mat3x3 &m) const
Definition: matvec3.cc:444
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
virtual void Resize(integer iNewSize)=0
Mat3x3 R

Here is the call graph for this function:

bool ClampJoint::bInverseDynamics ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 1489 of file genj.cc.

1490 {
1491  return true;
1492 }
std::ostream & ClampJoint::DescribeDof ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 1231 of file genj.cc.

References DofOwnerOwner::iGetFirstIndex().

1232 {
1233  integer iIndex = iGetFirstIndex();
1234 
1235  out
1236  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
1237  "reaction forces [Fx,Fy,Fz]" << std::endl
1238  << prefix << iIndex + 4 << "->" << iIndex + 6 << ": "
1239  "reaction couples [mx,my,mz]" << std::endl;
1240 
1241  if (bInitial) {
1242  iIndex += 6;
1243  out
1244  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
1245  "reaction force derivatives [FPx,FPy,FPz]" << std::endl
1246  << prefix << iIndex + 4 << "->" << iIndex + 6 << ": "
1247  "reaction couple derivatives [mPx,mPy,mPz]" << std::endl;
1248  }
1249 
1250  return out;
1251 }
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 ClampJoint::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 1268 of file genj.cc.

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

1270 {
1271  int iend = 1;
1272  if (i == -1) {
1273  if (bInitial) {
1274  iend = 12;
1275 
1276  } else {
1277  iend = 6;
1278  }
1279  }
1280  desc.resize(iend);
1281 
1282  std::ostringstream os;
1283  os << "ClampJoint(" << GetLabel() << ")";
1284 
1285  if (i == -1) {
1286  std::string name = os.str();
1287  for (i = 0; i < iend; i++) {
1288  os.str(name);
1289  os.seekp(0, std::ios_base::end);
1290  os << ": " << dof[i/3] << xyz[i%3];
1291 
1292  desc[i] = os.str();
1293  }
1294 
1295  } else {
1296  os << ": " << dof[i/3] << xyz[i%3];
1297  desc[0] = os.str();
1298  }
1299 }
static const char * dof[]
Definition: genj.cc:1254
static const char xyz[]
Definition: genj.cc:1253
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 1302 of file genj.cc.

References DofOwnerOwner::iGetFirstIndex().

1303 {
1304  integer iIndex = iGetFirstIndex();
1305 
1306  out
1307  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
1308  "position constraints [Px=Px0,Py=Py0,Pz=Pz0]" << std::endl
1309  << prefix << iIndex + 4 << "->" << iIndex + 6 << ": "
1310  "orientation constraints [thetax=thetax0,thetay=thetay0,thetaz=thetaz0]" << std::endl;
1311 
1312  if (bInitial) {
1313  iIndex += 6;
1314  out
1315  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
1316  "velocity constraints [vx=0,vy=0,vz=0]" << std::endl
1317  << prefix << iIndex + 4 << "->" << iIndex + 6 << ": "
1318  "angular velocity constraints [wx=0,wy=0,wz=0]" << std::endl;
1319  }
1320 
1321  return out;
1322 }
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 ClampJoint::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 1325 of file genj.cc.

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

1327 {
1328  int iend = 1;
1329  if (i == -1) {
1330  if (bInitial) {
1331  iend = 12;
1332 
1333  } else {
1334  iend = 6;
1335  }
1336  }
1337  desc.resize(iend);
1338 
1339  std::ostringstream os;
1340  os << "ClampJoint(" << GetLabel() << ")";
1341 
1342  if (i == -1) {
1343  std::string name = os.str();
1344  for (i = 0; i < iend; i++) {
1345  os.str(name);
1346  os.seekp(0, std::ios_base::end);
1347  os << ": " << eq[i/3] << xyz[i%3];
1348 
1349  desc[i] = os.str();
1350  }
1351 
1352  } else {
1353  os << ": " << eq[i/3] << xyz[i%3];
1354  desc[0] = os.str();
1355  }
1356 }
static const char xyz[]
Definition: genj.cc:1253
unsigned int GetLabel(void) const
Definition: withlab.cc:62
static const char * eq[]
Definition: genj.cc:1260

Here is the call graph for this function:

doublereal ClampJoint::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1716 of file genj.cc.

References F, M, and MBDYN_EXCEPT_ARGS.

1717 {
1718  if (i >= 1 && i <= 3) {
1719  return F(i);
1720  }
1721 
1722  if (i >= 4 && i <= 6) {
1723  return M(i - 3);
1724  }
1725 
1727 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Vec3 F
Definition: genj.h:247
Vec3 M
Definition: genj.h:248
virtual void ClampJoint::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 364 of file genj.h.

References pNode.

364  {
365  connectedNodes.resize(1);
366  connectedNodes[0] = pNode;
367  };
const StructNode * pNode
Definition: genj.h:244
virtual DofOrder::Order ClampJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 283 of file genj.h.

References DofOrder::ALGEBRAIC, and ASSERT.

284  {
285  ASSERT(i >= 0 && i < 6);
286  return DofOrder::ALGEBRAIC;
287  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual DofOrder::Order ClampJoint::GetEqType ( unsigned int  i) const
inlinevirtual

Reimplemented from SimulationEntity.

Definition at line 289 of file genj.h.

References DofOrder::ALGEBRAIC, ASSERT, and iGetNumDof().

289  {
290  ASSERT(i >= 0 && i < iGetNumDof());
291  return DofOrder::ALGEBRAIC;
292  }
virtual unsigned int iGetNumDof(void) const
Definition: genj.h:270
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

virtual Joint::Type ClampJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 259 of file genj.h.

References Joint::CLAMP.

259  {
260  return Joint::CLAMP;
261  };
virtual unsigned int ClampJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 338 of file genj.h.

338 { return 12; };
virtual unsigned int ClampJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 270 of file genj.h.

Referenced by GetEqType().

270  {
271  return 6;
272  };
unsigned int ClampJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1667 of file genj.cc.

1668 {
1669  return 6;
1670 }
unsigned int ClampJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1673 of file genj.cc.

References ASSERT.

1674 {
1675  ASSERT(s != NULL);
1676 
1677  unsigned int idx = 0;
1678 
1679  switch (s[0]) {
1680  case 'F':
1681  break;
1682 
1683  case 'M':
1684  idx += 3;
1685  break;
1686 
1687  default:
1688  return 0;
1689  }
1690 
1691  switch (s[1]) {
1692  case 'x':
1693  idx += 1;
1694  break;
1695 
1696  case 'y':
1697  idx += 2;
1698  break;
1699 
1700  case 'z':
1701  idx += 3;
1702  break;
1703 
1704  default:
1705  return 0;
1706  }
1707 
1708  if (s[2] != '\0') {
1709  return 0;
1710  }
1711 
1712  return idx;
1713 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & ClampJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1557 of file genj.cc.

References DEBUGCOUT, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), pNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

1559 {
1560  DEBUGCOUT("Entering ClampJoint::InitialAssJac()" << std::endl);
1561 
1562  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
1563  WM.ResizeReset(24, 1);
1564 
1565  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1566  integer iFirstVelocityIndex = iFirstPositionIndex+6;
1567  integer iFirstReactionIndex = iGetFirstIndex();
1568  integer iReactionPrimeIndex = iFirstReactionIndex+6;
1569 
1570  /*
1571  * x | 0 0 0 0 -I 0 0 0 || Delta_x | | f |
1572  * g | 0 0 0 0 0 -I 0 0 || Delta_g | | m |
1573  * xP | 0 0 0 0 0 0 -I 0 || Delta_xP | | fP |
1574  * w | 0 0 0 0 0 0 0 -I || Delta_w | | mP |
1575  * f | I 0 0 0 0 0 0 0 || Delta_f | = | X0-x |
1576  * m | 0 I 0 0 0 0 0 0 || Delta_m | | -xP |
1577  * fP | 0 0 I 0 0 0 0 0 || Delta_fP | | -g |
1578  * mP | 0 0 0 I 0 0 0 0 || Delta_mP | | -w |
1579  *
1580  *
1581  *
1582  */
1583 
1584  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1585  WM.PutItem(iCnt, iFirstReactionIndex+iCnt,
1586  iFirstPositionIndex+iCnt, 1.);
1587 
1588  WM.PutItem(6+iCnt, iReactionPrimeIndex+iCnt,
1589  iFirstVelocityIndex+iCnt, 1.);
1590 
1591  WM.PutItem(12+iCnt, iFirstPositionIndex+iCnt,
1592  iFirstReactionIndex+iCnt, 1.);
1593 
1594  WM.PutItem(18+iCnt, iFirstVelocityIndex+iCnt,
1595  iReactionPrimeIndex+iCnt, 1.);
1596  }
1597 
1598  return WorkMat;
1599 }
const StructNode * pNode
Definition: genj.h:244
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
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 & ClampJoint::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1604 of file genj.cc.

References DEBUGCOUT, StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), Mat3x3::MulMT(), CGR_Rot::Param, pNode, VectorHandler::Put(), SubVectorHandler::PutRowIndex(), R, RClamp, VectorHandler::ResizeReset(), and XClamp.

1606 {
1607  DEBUGCOUT("Entering ClampJoint::InitialAssRes()" << std::endl);
1608 
1609  /* Dimensiona e resetta la matrice di lavoro */
1610  integer iNumRows = 0;
1611  integer iNumCols = 0;
1612  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1613  WorkVec.ResizeReset(iNumRows);
1614 
1615  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
1616  integer iFirstReactionIndex = iGetFirstIndex();
1617  integer iReactionPrimeIndex = iFirstReactionIndex+6;
1618 
1619  for (int iCnt = 1; iCnt <= 12; iCnt++) {
1620  WorkVec.PutRowIndex(iCnt, iFirstPositionIndex+iCnt);
1621  WorkVec.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
1622  }
1623 
1624 
1625  /* Forza */
1626  WorkVec.Put(1, -Vec3(XCurr, iFirstReactionIndex+1));
1627 
1628  /* Coppia */
1629  WorkVec.Put(4, -Vec3(XCurr, iFirstReactionIndex+4));
1630 
1631  /* Derivata della Forza */
1632  WorkVec.Put(7, -Vec3(XCurr, iReactionPrimeIndex+1));
1633 
1634  /* Derivata della Coppia */
1635  WorkVec.Put(10, -Vec3(XCurr, iReactionPrimeIndex+4));
1636 
1637  /* Posizione */
1638  WorkVec.Put(13, XClamp-pNode->GetXCurr());
1639 
1640  /* Parametri di rotazione */
1641  Mat3x3 R(pNode->GetRCurr());
1642  WorkVec.Put(16, -Vec3(CGR_Rot::Param, R.MulMT(RClamp)));
1643 
1644  /* Velocita' */
1645  WorkVec.Put(19, -pNode->GetVCurr());
1646 
1647  /* Velocita' angolare */
1648  WorkVec.Put(22, -pNode->GetWCurr());
1649 
1650  return WorkVec;
1651 }
Mat3x3 RClamp
Definition: genj.h:246
const Param_Manip Param
Definition: matvec3.cc:644
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode
Definition: genj.h:244
Vec3 XClamp
Definition: genj.h:245
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: genj.h:339
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
Mat3x3 MulMT(const Mat3x3 &m) const
Definition: matvec3.cc:444
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 ClampJoint::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 339 of file genj.h.

Referenced by InitialAssRes().

341  { *piNumRows = 24; *piNumCols = 24; };
void ClampJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 1545 of file genj.cc.

References ToBeOutput::bToBeOutput(), F, WithLabel::GetLabel(), StructNode::GetRCurr(), OutputHandler::Joints(), M, Mat3x3::MulTV(), Joint::Output(), pNode, and R.

1546 {
1547  if (bToBeOutput()) {
1548  const Mat3x3& R(pNode->GetRCurr());
1549 
1550  Joint::Output(OH.Joints(), "Clamp", GetLabel(),
1551  R.MulTV(F), R.MulTV(M), F, M) << std::endl;
1552  }
1553 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode
Definition: genj.h:244
Vec3 F
Definition: genj.h:247
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
std::ostream & Joints(void) const
Definition: output.h:443
Vec3 M
Definition: genj.h:248
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
Mat3x3 R

Here is the call graph for this function:

void ClampJoint::ReadInitialState ( MBDynParser HP)
virtual

Reimplemented from SimulationEntity.

Definition at line 1360 of file genj.cc.

References F, MBDynParser::GetVec3(), and M.

1361 {
1362  F = HP.GetVec3();
1363  M = HP.GetVec3();
1364 }
Vec3 F
Definition: genj.h:247
Vec3 M
Definition: genj.h:248
virtual Vec3 GetVec3(void)
Definition: mbpar.cc:2220

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1368 of file genj.cc.

References F, WithLabel::GetLabel(), M, pNode, Joint::Restart(), and Vec3::Write().

1369 {
1370  return Joint::Restart(out) << ", clamp, "
1371  << pNode->GetLabel() << ", node, node, "
1372  << "initial state, ", F.Write(out, ", ")
1373  << ", ", M.Write(out, ", ") << ';' << std::endl;
1374 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
const StructNode * pNode
Definition: genj.h:244
Vec3 F
Definition: genj.h:247
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
Vec3 M
Definition: genj.h:248
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 1654 of file genj.cc.

References F, DofOwnerOwner::iGetFirstIndex(), M, and VectorHandler::Put().

1657 {
1658  integer iFirstReactionIndex = iGetFirstIndex();
1659  X.Put(iFirstReactionIndex+1,F);
1660  X.Put(iFirstReactionIndex+4,M);
1661 }
Vec3 F
Definition: genj.h:247
Vec3 M
Definition: genj.h:248
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
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 ClampJoint::Update ( const VectorHandler XCurr,
InverseDynamics::Order  iOrder = InverseDynamics::INVERSE_DYNAMICS 
)
virtual

Reimplemented from Joint.

Definition at line 1533 of file genj.cc.

References ASSERT, F, DofOwnerOwner::iGetFirstIndex(), InverseDynamics::INVERSE_DYNAMICS, and M.

1534 {
1536 
1537  integer iFirstReactionIndex = iGetFirstIndex();
1538 
1539  /* Aggiorna le reazioni vincolari */
1540  F = Vec3(XCurr, iFirstReactionIndex + 1);
1541  M = Vec3(XCurr, iFirstReactionIndex + 4);
1542 }
Definition: matvec3.h:98
Vec3 F
Definition: genj.h:247
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 M
Definition: genj.h:248
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 294 of file genj.h.

295  { *piNumRows = 12; *piNumCols = 12; };

Member Data Documentation

Vec3 ClampJoint::F
private

Definition at line 247 of file genj.h.

Referenced by AssRes(), dGetPrivData(), Output(), ReadInitialState(), Restart(), SetValue(), and Update().

Vec3 ClampJoint::M
private

Definition at line 248 of file genj.h.

Referenced by AssRes(), dGetPrivData(), Output(), ReadInitialState(), Restart(), SetValue(), and Update().

const StructNode* ClampJoint::pNode
private

Definition at line 244 of file genj.h.

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

Mat3x3 ClampJoint::RClamp
private

Definition at line 246 of file genj.h.

Referenced by AssRes(), and InitialAssRes().

Vec3 ClampJoint::XClamp
private

Definition at line 245 of file genj.h.

Referenced by AssRes(), and InitialAssRes().


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