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

#include <totalequation.h>

Inheritance diagram for TotalReaction:
Collaboration diagram for TotalReaction:

Public Member Functions

 TotalReaction (unsigned int uL, const DofOwner *pDO, bool bPos[3], bool bRot[3], const StructNode *pN1, const Vec3 &f1Tmp, const Mat3x3 &R1hTmp, const Mat3x3 &R1hrTmp, const StructNode *pN2, const Vec3 &f2Tmp, const Mat3x3 &R2hTmp, const Mat3x3 &R2hrTmp, TotalEquation *t_elm, flag fOut)
 
 ~TotalReaction (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual Joint::Type GetJointType (void) 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
 
DofOrder::Order GetDofType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
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)
 
DofOrder::Order GetEqType (unsigned int i) const
 
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) 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 & 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 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 std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Joint
 Joint (unsigned int uL, const DofOwner *pD, flag fOut)
 
virtual ~Joint (void)
 
virtual Elem::Type GetElemType (void) const
 
std::ostream & Output (std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
bool bIsPrescribedMotion (void) const
 
bool bIsTorque (void) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 

Private Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Vec3 f1
 
Mat3x3 R1h
 
Mat3x3 R1hr
 
Vec3 f2
 
Mat3x3 R2h
 
Mat3x3 R2hr
 
bool bPosActive [3]
 
bool bRotActive [3]
 
unsigned int nConstraints
 
unsigned int nPosConstraints
 
unsigned int nRotConstraints
 
unsigned int iPosIncid [3]
 
unsigned int iRotIncid [3]
 
Vec3 tilde_f1
 
Vec3 M
 
Vec3 F
 
Vec3 ThetaDelta
 
Vec3 ThetaDeltaPrev
 
TotalEquationtotal_equation_element
 

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 249 of file totalequation.h.

Constructor & Destructor Documentation

TotalReaction::TotalReaction ( unsigned int  uL,
const DofOwner pDO,
bool  bPos[3],
bool  bRot[3],
const StructNode pN1,
const Vec3 f1Tmp,
const Mat3x3 R1hTmp,
const Mat3x3 R1hrTmp,
const StructNode pN2,
const Vec3 f2Tmp,
const Mat3x3 R2hTmp,
const Mat3x3 R2hrTmp,
TotalEquation t_elm,
flag  fOut 
)

Definition at line 1232 of file totalequation.cc.

References bPosActive, bRotActive, WithLabel::GetLabel(), iPosIncid, iRotIncid, MBDYN_EXCEPT_ARGS, TotalEquation::nConstraints, nConstraints, nPosConstraints, nRotConstraints, and total_equation_element.

1241 : Elem(uL, fOut),
1242 Joint(uL, pDO, fOut),
1243 pNode1(pN1), pNode2(pN2),
1244 f1(f1Tmp), R1h(R1hTmp), R1hr(R1hrTmp),
1245 f2(f2Tmp), R2h(R2hTmp), R2hr(R2hrTmp),
1247 tilde_f1(R1h.MulTV(f1)),
1250 {
1251  /* Equations 1->3: Positions
1252  * Equations 4->6: Rotations */
1253 
1254  for (unsigned int i = 0; i < 3; i++) {
1255  bPosActive[i] = bPos[i];
1256  bRotActive[i] = bRot[i];
1257  if (bPosActive[i]) {
1258  iPosIncid[nPosConstraints] = i + 1;
1259  nPosConstraints++;
1260  }
1261  if (bRotActive[i]) {
1262  iRotIncid[nRotConstraints] = i + 1;
1263  nRotConstraints++;
1264  }
1265  }
1268  silent_cerr("Error: TotalReaction element " <<
1269  GetLabel() << " has " << nConstraints <<
1270  " reactions, while the corresponding TotalEquation joint "
1272  " defines only " << total_equation_element->nConstraints <<
1273  " contraints" << std::endl);
1275  }
1276 }
bool bRotActive[3]
const StructNode * pNode1
unsigned int iPosIncid[3]
unsigned int nRotConstraints
const Vec3 Zero3(0., 0., 0.)
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
unsigned int nPosConstraints
unsigned int nConstraints
Definition: totalequation.h:71
unsigned int iRotIncid[3]
bool bPosActive[3]
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
TotalEquation * total_equation_element
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
const StructNode * pNode2
unsigned int nConstraints
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

TotalReaction::~TotalReaction ( void  )

Definition at line 1278 of file totalequation.cc.

References NO_OP.

1279 {
1280  NO_OP;
1281 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void TotalReaction::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1553 of file totalequation.cc.

References ThetaDelta, ThetaDeltaPrev, and Unwrap().

1555 {
1557 }
Vec3 Unwrap(const Vec3 &vPrev, const Vec3 &v)
Definition: matvec3.cc:1089

Here is the call graph for this function:

void TotalReaction::AfterConvergence ( const VectorHandler X,
const VectorHandler XP,
const VectorHandler XPP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1560 of file totalequation.cc.

References ThetaDelta, ThetaDeltaPrev, and Unwrap().

1562 {
1564 }
Vec3 Unwrap(const Vec3 &vPrev, const Vec3 &v)
Definition: matvec3.cc:1089

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1625 of file totalequation.cc.

References FullSubMatrixHandler::Add(), DEBUGCOUT, F, f2, StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), iPosIncid, iRotIncid, M, MatCross, MatCrossCross, nConstraints, nPosConstraints, nRotConstraints, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R1hr, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), total_equation_element, and WorkSpaceDim().

1629 {
1630  /*
1631  * Constraint Equations:
1632  * Position: R1^T(x2 + R2*f2 -x1 - R1*f1) - d = x^delta
1633  * ==> d(Vec3) = imposed displacement in node 1 local R.F.
1634  * ==> x^delta is used to activate/deactivate the constraint
1635  * equation along the corresponding direction. If each
1636  * component is set to 0, all relative displacement
1637  * are forbidden (or imposed by the drive). If a component
1638  * of x^delta is left free, the corrsponding equation is
1639  * dropped
1640  *
1641  * Orientation: Theta - Theta0 = ax(exp^-1(R1^T * R2 * R0^T)) = Theta^delta
1642  * ==> Theta = ax(exp^-1(R1^T * R2)) = Relative orientation in node1 R.F.
1643  * ==> Theta0 = Imposed relative orientation = ax(exp^-1(R0))
1644  * ==> Theta^delta is used to activate/deactivate the constraint
1645  * equation along the corresponding direction. If each
1646  * component is set to 0, all relative rotation
1647  * are forbidden (or imposed by the drive). If a component
1648  * of Theta^delta is left free, the corrsponding equation is
1649  * dropped
1650  *Jacobian Matrix:
1651  * x1 g1 x2 g2 F M
1652  * Q1 | 0 F1X 0 0 -R1 0 | | x1 |
1653  * G1 |-(F1)X (b1)X(F1)X+(M1)X (F1)X -(F1)X(b2)X (b1)X(R1) -R1r | | g1 |
1654  * Q2 | 0 -F1X 0 0 R1 0 | | x2 |
1655  * G2 | 0 -(b2)X(F1)X-(M1)X 0 (F1)X(b2)X (b2)X(R1) R1r | | g2 |
1656  * F |-c*R1^T c*R1^T*[(b1)X] c*R1^T -c*R1^T*[(b2)X] 0 0 | | F |if(bPos)
1657  * M | 0 -c*R1r^T 0 c* R1r^T 0 0 | | M |if(bRot)
1658  * if(bPos) if(bRot)
1659  *with: _ b1 = (x2 + R2*f2 - x1)
1660  * _ b2 = (R2*f2)
1661  * _ R1 = R1*R1h
1662  * _ R2 = R2*R2h
1663  * _ R1r = R1*R1hr
1664  * _ F1 = R1*F
1665  * _ M1 = R1*M
1666  * _ X = "Cross" operator
1667  *
1668  * */
1669 
1670  DEBUGCOUT("Entering TotalReaction::AssJac()" << std::endl);
1671 
1672  FullSubMatrixHandler& WM = WorkMat.SetFull();
1673 
1674  /* Ridimensiona la sottomatrice in base alle esigenze */
1675  integer iNumRows = 0;
1676  integer iNumCols = 0;
1677  WorkSpaceDim(&iNumRows, &iNumCols);
1678  WM.ResizeReset(iNumRows, iNumCols);
1679 
1680  /* Recupera gli indici delle varie incognite */
1681  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1682  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
1683  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1684  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
1685  integer iFirstReactionIndex = total_equation_element->iGetFirstIndex();
1686 
1687  /* Setta gli indici delle equazioni */
1688  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1689  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1690  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1691  WM.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1692  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1693  }
1694 
1695  for (unsigned int iCnt = 1; iCnt <= nConstraints; iCnt++) {
1696  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
1697  }
1698 
1699  /* Recupera i dati che servono */
1700  Mat3x3 R1(pNode1->GetRRef()*R1h);
1701  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
1702  Vec3 b2(pNode2->GetRCurr()*f2);
1703  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
1704 
1705  /* Moltiplica il momento e la forza per il coefficiente del metodo */
1706  Vec3 FTmp(R1*(F*dCoef));
1707  Vec3 MTmp(R1r*(M*dCoef));
1708 
1709  /* Equilibrium: ((Phi/q)^T*Lambda)/q */
1710 
1711  Mat3x3 Tmp;
1712 
1713  /* [ F x ] */
1714  Tmp = Mat3x3(MatCross, FTmp);
1715 
1716  /* Lines 1->3: */
1717  WM.Add(1, 3 + 1, Tmp);
1718 
1719  /* Lines 4->6: */
1720  WM.Sub(3 + 1, 1, Tmp);
1721 
1722  WM.Add(3 + 1, 6 + 1, Tmp);
1723 
1724  /* Lines 7->9: */
1725  WM.Sub(6 + 1, 3 + 1, Tmp);
1726 
1727  /* [ F x ] [ b2 x ] */
1728  Tmp = Mat3x3(MatCrossCross, FTmp, b2);
1729 
1730  /* Lines 4->6: */
1731  WM.Sub(3 + 1, 9 + 1, Tmp);
1732 
1733  /* Lines 10->12: */
1734  WM.Add(9 + 1, 9 + 1, Tmp);
1735 
1736  /* [ b1 x ] [ F x ] + [ M x ] */
1737 
1738  /* Lines 4->6: */
1739  WM.Add(3 + 1, 3 + 1, Mat3x3(MatCrossCross, b1, FTmp) + Mat3x3(MatCross, MTmp));
1740 
1741  /* [ b2 x ] [ F x ] + [ M x ] */
1742 
1743  /* Lines 10->12: */
1744  WM.Sub(9 + 1, 3 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp));
1745 
1746 /* Phi/q and (Phi/q)^T */
1747 
1748  Mat3x3 b1Cross_R1(b1.Cross(R1)); // = [ b1 x ] * R1
1749  Mat3x3 b2Cross_R1(b2.Cross(R1)); // = [ b2 x ] * R1
1750 
1751  for (unsigned iCnt = 0 ; iCnt < nPosConstraints; iCnt++) {
1752  Vec3 vR1(R1.GetVec(iPosIncid[iCnt]));
1753  Vec3 vb1Cross_R1(b1Cross_R1.GetVec(iPosIncid[iCnt]));
1754  Vec3 vb2Cross_R1(b2Cross_R1.GetVec(iPosIncid[iCnt]));
1755 
1756  /* Equilibrium, node 1 */
1757  WM.Sub(1, 12 + 1 + iCnt, vR1);
1758  WM.Sub(3 + 1, 12 + 1 + iCnt, vb1Cross_R1);
1759 
1760  /* Equilibrium, node 2 */
1761  WM.Add(6 + 1, 12 + 1 + iCnt, vR1);
1762  WM.Add(9 + 1, 12 + 1 + iCnt, vb2Cross_R1);
1763  }
1764 
1765  for (unsigned iCnt = 0 ; iCnt < nRotConstraints; iCnt++) {
1766  Vec3 vR1(R1r.GetVec(iRotIncid[iCnt]));
1767 
1768  /* Equilibrium, node 1 */
1769  WM.Sub(3 + 1, 12 + 1 + nPosConstraints + iCnt, vR1);
1770 
1771  /* Equilibrium, node 2 */
1772  WM.Add(9 + 1, 12 + 1 + nPosConstraints + iCnt, vR1);
1773  }
1774 
1775  return WorkMat;
1776 }
const StructNode * pNode1
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
unsigned int iPosIncid[3]
unsigned int nRotConstraints
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
unsigned int nPosConstraints
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
unsigned int iRotIncid[3]
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
TotalEquation * total_equation_element
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const StructNode * pNode2
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
unsigned int nConstraints
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1780 of file totalequation.cc.

References VectorHandler::Add(), Vec3::Cross(), DEBUGCOUT, F, f2, StructNode::GetRCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), iPosIncid, iRotIncid, M, nPosConstraints, nRotConstraints, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R1hr, R2hr, VectorHandler::ResizeReset(), VectorHandler::Sub(), total_equation_element, and WorkSpaceDim().

1784 {
1785  DEBUGCOUT("Entering TotalReaction::AssRes()" << std::endl);
1786 
1787  /* Dimensiona e resetta la matrice di lavoro */
1788  integer iNumRows = 0;
1789  integer iNumCols = 0;
1790  WorkSpaceDim(&iNumRows, &iNumCols);
1791  WorkVec.ResizeReset(iNumRows);
1792 
1793  /* Indici */
1794  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
1795  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
1796  integer iFirstReactionIndex = total_equation_element->iGetFirstIndex();
1797 
1798  /* Indici dei nodi */
1799  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1800  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1801  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex + iCnt);
1802  }
1803 
1804  /* Get constraint reactions */
1805 
1806  for (unsigned iCnt = 0; iCnt < nPosConstraints; iCnt++) {
1807  F(iPosIncid[iCnt]) = XCurr(iFirstReactionIndex + 1 + iCnt);
1808  }
1809 
1810  for (unsigned iCnt = 0; iCnt < nRotConstraints; iCnt++) {
1811  M(iRotIncid[iCnt]) = XCurr(iFirstReactionIndex + 1 + nPosConstraints + iCnt);
1812  }
1813 
1814 
1815  Vec3 b2(pNode2->GetRCurr()*f2);
1816  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
1817 
1818  Mat3x3 R1 = pNode1->GetRCurr()*R1h;
1819  Mat3x3 R1r = pNode1->GetRCurr()*R1hr;
1820  Mat3x3 R2r = pNode2->GetRCurr()*R2hr;
1821 
1822  Vec3 FTmp(R1*F);
1823  Vec3 MTmp(R1r*M);
1824 
1825  /* Equilibrium, node 1 */
1826  WorkVec.Add(1, FTmp);
1827  WorkVec.Add(3 + 1, MTmp + b1.Cross(FTmp));
1828 
1829  /* Equilibrium, node 2 */
1830  WorkVec.Sub(6 + 1, FTmp);
1831  WorkVec.Sub(9 + 1, MTmp + b2.Cross(FTmp));
1832 
1833  return WorkVec;
1834 }
const StructNode * pNode1
unsigned int iPosIncid[3]
unsigned int nRotConstraints
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
unsigned int nPosConstraints
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
unsigned int iRotIncid[3]
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
TotalEquation * total_equation_element
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
const StructNode * pNode2
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 1284 of file totalequation.cc.

References bPosActive, bRotActive, idx2xyz, DofOwnerOwner::iGetFirstIndex(), nConstraints, nPosConstraints, nRotConstraints, and total_equation_element.

1286 {
1288 
1289  if (nPosConstraints > 0) {
1290  out << prefix << iIndex + 1;
1291  if (nPosConstraints > 1) {
1292  out << "->" << iIndex + nPosConstraints;
1293  }
1294  out << ": ";
1295  out << "reaction force(s) [";
1296 
1297  for (unsigned int i = 0, cnt = 0; i < 3; i++) {
1298  if (bPosActive[i]) {
1299  cnt++;
1300  if (cnt > 1) {
1301  out << ",";
1302  }
1303  out << "F" << idx2xyz[i];
1304  }
1305  }
1306  out << "]" << std::endl;
1307  }
1308 
1309  if (nRotConstraints > 0) {
1310  out << prefix << iIndex + nPosConstraints + 1;
1311  if (nRotConstraints > 1) {
1312  out << "->" << iIndex + nConstraints ;
1313  }
1314  out << ": ";
1315  out << "reaction couple(s) [";
1316 
1317  for (unsigned int i = 0, cnt = 0; i < 3; i++) {
1318  if (bRotActive[i]) {
1319  cnt++;
1320  if (cnt > 1) {
1321  out << ",";
1322  }
1323  out << "m" << idx2xyz[i];
1324  }
1325  }
1326  out << "]" << std::endl;
1327  }
1328 
1329  if (bInitial) {
1330  iIndex += nConstraints;
1331 
1332  if (nPosConstraints > 0) {
1333  out << prefix << iIndex + 1;
1334  if (nPosConstraints > 1) {
1335  out << "->" << iIndex + nPosConstraints;
1336  }
1337  out << ": ";
1338  out << "reaction force(s) derivative(s) [";
1339 
1340  for (unsigned int i = 0, cnt = 0; i < 3; i++) {
1341  if (bPosActive[i]) {
1342  cnt++;
1343  if (cnt > 1) {
1344  out << ",";
1345  }
1346  out << "FP" << idx2xyz[i];
1347  }
1348  }
1349  out << "]" << std::endl;
1350  }
1351 
1352  if (nRotConstraints > 0) {
1353  out << prefix << iIndex + nPosConstraints + 1;
1354  if (nRotConstraints > 1) {
1355  out << "->" << iIndex + nConstraints;
1356  }
1357  out << ": ";
1358  out << "reaction couple(s) derivative(s) [";
1359 
1360  for (unsigned int i = 0, cnt = 0; i < 3; i++) {
1361  if (bRotActive[i]) {
1362  cnt++;
1363  if (cnt > 1) {
1364  out << ",";
1365  }
1366  out << "mP" << idx2xyz[i];
1367  }
1368  }
1369  out << "]" << std::endl;
1370  }
1371  }
1372  return out;
1373 }
bool bRotActive[3]
unsigned int nRotConstraints
unsigned int nPosConstraints
bool bPosActive[3]
TotalEquation * total_equation_element
unsigned int nConstraints
static const char idx2xyz[]
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 TotalReaction::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 1376 of file totalequation.cc.

1378 {
1379  desc.resize(0);
1380 }
doublereal TotalReaction::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2267 of file totalequation.cc.

References ASSERT, bPosActive, bRotActive, Vec3::Cross(), F, f1, f2, StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), M, Mat3x3::MulTV(), pNode1, pNode2, R1h, ThetaDelta, ThetaDeltaPrev, and Unwrap().

2268 {
2269  switch (i) {
2270  case 1:
2271  case 2:
2272  case 3: {
2274  return R1h.GetVec(i)*x;
2275  }
2276 
2277  case 4:
2278  case 5:
2279  case 6: {
2280 #if 0
2281  Vec3 Theta(Unwrap(ThetaDeltaPrev, ThetaDelta) + ThetaDrv.Get());
2282  return Theta(i - 3);
2283 #endif
2284  return 0.;
2285  }
2286 
2287  case 7:
2288  case 8:
2289  case 9:
2290  return F(i - 6);
2291 
2292  case 10:
2293  case 11:
2294  case 12:
2295  return M(i - 9);
2296 
2297  case 13:
2298  case 14:
2299  case 15:
2300  if (!bPosActive[i - 13]) {
2301  return 0.;
2302  }
2303 // return XDrv.Get()(i - 12);
2304  return 0.;
2305 
2306  case 16:
2307  case 17:
2308  case 18:
2309  if (!bRotActive[i - 16]) {
2310  return 0.;
2311  }
2312 // return ThetaDrv.Get()(i - 15);
2313  return 0.;
2314  case 19:
2315  case 20:
2316  case 21:
2317  {
2318  // FIXME: blind fix
2319  Vec3 v(pNode1->GetRCurr().MulTV(
2321  - pNode1->GetVCurr()) -
2322  pNode1->GetWCurr().Cross( pNode2->GetXCurr() +
2323  pNode2->GetRCurr()*f2
2324  - pNode1->GetXCurr() -f1)
2325  )
2326  );
2327 
2328  return R1h.GetVec(i-18)*v;
2329  }
2330 
2331 
2332  default:
2333  ASSERT(0);
2334  }
2335 
2336  return 0.;
2337 }
bool bRotActive[3]
const StructNode * pNode1
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
bool bPosActive[3]
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const StructNode * pNode2
#define ASSERT(expression)
Definition: colamd.c:977
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Vec3 Unwrap(const Vec3 &vPrev, const Vec3 &v)
Definition: matvec3.cc:1089
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 405 of file totalequation.h.

References pNode1, and pNode2.

405  {
406  connectedNodes.resize(2);
407  connectedNodes[0] = pNode1;
408  connectedNodes[1] = pNode2;
409  };
const StructNode * pNode1
const StructNode * pNode2
DofOrder::Order TotalReaction::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 331 of file totalequation.h.

References DofOrder::ALGEBRAIC, ASSERT, and nConstraints.

331  {
332  ASSERT(i >= 0 && i < nConstraints);
333  return DofOrder::ALGEBRAIC;
334  };
#define ASSERT(expression)
Definition: colamd.c:977
unsigned int nConstraints
DofOrder::Order TotalReaction::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 1837 of file totalequation.cc.

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

1838 {
1839  ASSERTMSGBREAK(i < iGetNumDof(),
1840  "INDEX ERROR in TotalReaction::GetEqType");
1841 
1842  return DofOrder::ALGEBRAIC;
1843 }
#define ASSERTMSGBREAK(expr, msg)
Definition: myassert.h:222
virtual unsigned int iGetNumDof(void) const

Here is the call graph for this function:

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

Implements Joint.

Definition at line 299 of file totalequation.h.

References Joint::TOTALREACTION.

299  {
300  return Joint::TOTALREACTION;
301  };
virtual unsigned int TotalReaction::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 377 of file totalequation.h.

References nConstraints.

377  {
378  return 2*nConstraints;
379  };
unsigned int nConstraints
virtual unsigned int TotalReaction::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 304 of file totalequation.h.

Referenced by GetEqType().

304  {
305  return 0;
306  };
unsigned int TotalReaction::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2201 of file totalequation.cc.

2202 {
2203  return 21;
2204 }
unsigned int TotalReaction::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2207 of file totalequation.cc.

References ASSERT.

2208 {
2209  ASSERT(s != NULL);
2210 
2211  unsigned int off = 0;
2212 
2213  switch (s[0]) {
2214  case 'p':
2215  /* relative position */
2216  break;
2217 
2218  case 'r':
2219  /* relative orientation */
2220  off += 3;
2221  break;
2222 
2223  case 'F':
2224  /* force */
2225  off += 6;
2226  break;
2227 
2228  case 'M':
2229  /* moment */
2230  off += 9;
2231  break;
2232 
2233  case 'd':
2234  /* imposed relative position */
2235  off += 12;
2236  break;
2237 
2238  case 't':
2239  /* imposed relative orientation */
2240  off += 15;
2241  break;
2242 
2243  case 'v':
2244  /* relative linear velocity */
2245  off += 18;
2246  break;
2247 
2248  default:
2249  return 0;
2250  }
2251 
2252  switch (s[1]) {
2253  case 'x':
2254  return off + 1;
2255 
2256  case 'y':
2257  return off + 2;
2258 
2259  case 'z':
2260  return off + 3;
2261  }
2262 
2263  return 0;
2264 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & TotalReaction::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1880 of file totalequation.cc.

References FullSubMatrixHandler::Add(), FullSubMatrixHandler::AddT(), Vec3::Cross(), F, f2, StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), iPosIncid, iRotIncid, M, MatCross, MatCrossCross, nConstraints, nPosConstraints, nRotConstraints, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R1hr, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), FullSubMatrixHandler::SubT(), total_equation_element, and Zero3.

1882 {
1883 
1884  /* Per ora usa la matrice piena; eventualmente si puo'
1885  * passare a quella sparsa quando si ottimizza */
1886  FullSubMatrixHandler& WM = WorkMat.SetFull();
1887 
1888  /* Dimensiona e resetta la matrice di lavoro */
1889  integer iNumRows = 0;
1890  integer iNumCols = 0;
1891  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1892  WM.ResizeReset(iNumRows, iNumCols);
1893 
1894  /* Equazioni: vedi joints.dvi */
1895 
1896  /* equazioni ed incognite
1897  * F1 Delta_x1 1
1898  * M1 Delta_g1 3 + 1
1899  * FP1 Delta_xP1 6 + 1
1900  * MP1 Delta_w1 9 + 1
1901  * F2 Delta_x2 12 + 1
1902  * M2 Delta_g2 15 + 1
1903  * FP2 Delta_xP2 18 + 1
1904  * MP2 Delta_w2 21 + 1
1905  * vincolo spostamento Delta_F 24 + 1
1906  * vincolo rotazione Delta_M 24 + nPosConstraints
1907  * derivata vincolo spostamento Delta_FP 24 + nConstraints
1908  * derivata vincolo rotazione Delta_MP 24 + nConstraints + nPosConstraints
1909  */
1910 
1911 
1912  /* Indici */
1913  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1914  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
1915  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1916  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
1917  integer iFirstReactionIndex = total_equation_element->iGetFirstIndex();
1918  integer iReactionPrimeIndex = iFirstReactionIndex + nConstraints;
1919 
1920 
1921  /* Setta gli indici dei nodi */
1922  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1923  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1924  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1925  WM.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
1926  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
1927  WM.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
1928  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
1929  WM.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
1930  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
1931  }
1932 
1933  /* Setta gli indici delle reazioni */
1934  for (unsigned int iCnt = 1; iCnt <= nConstraints; iCnt++) {
1935  WM.PutRowIndex(24 + iCnt, iFirstReactionIndex + iCnt);
1936  WM.PutColIndex(24 + iCnt, iFirstReactionIndex + iCnt);
1937  WM.PutRowIndex(24 + nConstraints + iCnt, iReactionPrimeIndex + iCnt);
1938  WM.PutColIndex(24 + nConstraints + iCnt, iReactionPrimeIndex + iCnt);
1939  }
1940 
1941  /* Recupera i dati che servono */
1942  Mat3x3 R1(pNode1->GetRRef()*R1h);
1943  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
1944 
1945  Vec3 b2(pNode2->GetRCurr()*f2);
1946  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
1947 
1948  Vec3 Omega1(pNode1->GetWCurr());
1949  Vec3 Omega2(pNode2->GetWCurr());
1950 
1951  Vec3 b1Prime(pNode2->GetVCurr() + Omega2.Cross(b2) - pNode1->GetVCurr());
1952 
1953  /* F ed M sono gia' state aggiornate da InitialAssRes;
1954  * Recupero FPrime e MPrime*/
1955  Vec3 MPrime(Zero3);
1956  Vec3 FPrime(Zero3);
1957 
1958  for (unsigned iCnt = 0; iCnt < nPosConstraints; iCnt++) {
1959  FPrime(iPosIncid[iCnt]) = XCurr(iReactionPrimeIndex + 1 + iCnt);
1960  }
1961 
1962  for (unsigned iCnt = 0; iCnt < nRotConstraints; iCnt++) {
1963  MPrime(iRotIncid[iCnt]) = XCurr(iReactionPrimeIndex + 1 + nPosConstraints + iCnt);
1964  }
1965 
1966  Vec3 FTmp(R1 * F);
1967  Vec3 MTmp(R1r * M);
1968  Vec3 FPrimeTmp(R1 * FPrime);
1969  Vec3 MPrimeTmp(R1r * MPrime);
1970 
1971  Mat3x3 Tmp;
1972 
1973  /* [ F x ] */
1974  Tmp = Mat3x3(MatCross, FTmp);
1975 
1976  /* Force, Node 1, Lines 1->3: */
1977  WM.Add(1, 3 + 1, Tmp); // * Delta_g1
1978 
1979  /* Moment, Node 1, Lines 4->6: */
1980  WM.Sub(3 + 1, 1, Tmp); // * Delta_x1
1981 
1982  WM.Add(3 + 1, 12 + 1, Tmp); // * Delta_x2
1983 
1984  /* Force, Node 2, Lines 13->15: */
1985  WM.Sub(12 + 1, 3 + 1, Tmp); // * Delta_g1
1986 
1987  /* [ FP x ] */
1988  Tmp = Mat3x3(MatCross, FPrimeTmp);
1989 
1990  /* d/dt(Force), Node 1, Lines 7->9: */
1991  WM.Add(6 + 1, 9 + 1, Tmp); // * Delta_W1
1992 
1993  /* d/dt(Moment), Node 1, Lines 10->12: */
1994  WM.Sub(9 + 1, 6 + 1, Tmp); // * Delta_x1P
1995 
1996  WM.Add(9 + 1, 18 + 1, Tmp); // * Delta_x2P
1997 
1998  /* d/dt(Force), Node 2, Lines 19->21: */
1999  WM.Sub(18 + 1 , 9 + 1, Tmp); // * Delta_W1
2000 
2001  /* [ F x ] [ b2 x ] */
2002  Tmp = Mat3x3(MatCrossCross, FTmp, b2);
2003 
2004  /* Moment, Node1, Lines 4->6: */
2005  WM.Sub(3 + 1, 15 + 1, Tmp); // * Delta_g2
2006 
2007  /* Moment, Node2, Lines 16->18: */
2008  WM.Add(15 + 1, 15 + 1, Tmp); // * Delta_g2
2009 
2010  /* [ FP x ] [ b2 x ] */
2011  Tmp = Mat3x3(MatCrossCross, FPrimeTmp, b2);
2012 
2013  /* d/dt(Moment), Node1, Lines 10->12: */
2014  WM.Sub(9 + 1, 21 + 1, Tmp); // * Delta_W2
2015 
2016  /* d/dt(Moment), Node2, Lines 22->24: */
2017  WM.Add(21 + 1, 21 + 1, Tmp); // * Delta_W2
2018 
2019  /* [ b1 x ] [ F x ] + [ M x ] */
2020 
2021  /* Moment, Node1, Lines 4->6: */
2022  WM.Add(3 + 1, 3 + 1, Mat3x3(MatCrossCross, b1, FTmp) + Mat3x3(MatCross, MTmp)); // *Delta_g1
2023 
2024  /* d/dt(Moment), Node1, Lines 10->12: */
2025  WM.Add(9 + 1, 9 + 1, Mat3x3(MatCrossCross, b1, FPrimeTmp) + Mat3x3(MatCross, MPrimeTmp));// *Delta_W1
2026 
2027  /* [ b2 x ] [ F x ] + [ M x ] */
2028 
2029  /* Moment, Node2, Lines 16->18: */
2030  WM.Sub(15 + 1, 3 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp)); // * Delta_g1
2031 
2032  /* d/dt(Moment), Node2, Lines 22->24: */
2033  WM.Sub(21 + 1, 9 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp)); // * Delta_W1
2034 
2035  /* Constraints: Add only active rows/columns*/
2036 
2037  /* Positions contribution:*/
2038 
2039  Mat3x3 b1Cross_R1(b1.Cross(R1)); // = [ b1 x ] * R1
2040  Mat3x3 b2Cross_R1(b2.Cross(R1)); // = [ b2 x ] * R1
2041 
2042  for (unsigned iCnt = 0 ; iCnt < nPosConstraints; iCnt++) {
2043  Vec3 vR1(R1.GetVec(iPosIncid[iCnt]));
2044  Vec3 vb1Cross_R1(b1Cross_R1.GetVec(iPosIncid[iCnt]));
2045  Vec3 vb2Cross_R1(b2Cross_R1.GetVec(iPosIncid[iCnt]));
2046 
2047  /* Equilibrium, node 1 */
2048  WM.Sub(1, 24 + 1 + iCnt, vR1); // * Delta_F
2049  WM.Sub(3 + 1, 24 + 1 + iCnt, vb1Cross_R1); // * Delta_F
2050 
2051  /* Constraint, node 1 */
2052  WM.SubT(24 + 1 + iCnt, 1, vR1); // * Delta_x1
2053  WM.SubT(24 + 1 + iCnt, 3 + 1, vb1Cross_R1); // * Delta_g1
2054 
2055  /* d/dt(Equilibrium), node 1 */
2056  WM.Sub(6 + 1, 24 + 1 + nConstraints + iCnt, vR1); // * Delta_FP
2057  WM.Sub(9 + 1, 24 + 1 + nConstraints + iCnt, vb1Cross_R1); // * Delta_FP
2058 
2059  /* d/dt(Constraint), node 1 */
2060  WM.SubT(24 + 1 + nConstraints + iCnt, 6 + 1, vR1); // * Delta_xP1
2061  WM.SubT(24 + 1 + nConstraints + iCnt, 9 + 1, vb1Cross_R1); // * Delta_W1
2062 
2063  /* Equilibrium, node 2 */
2064  WM.Add(12 + 1, 24 + 1 + iCnt, vR1); // * Delta_F
2065  WM.Add(15 + 1, 24 + 1 + iCnt, vb2Cross_R1); // * Delta_F
2066 
2067  /* Constraint, node 2 */
2068  WM.AddT(24 + 1 + iCnt, 12 + 1, vR1); // * Delta_x2
2069  WM.AddT(24 + 1 + iCnt, 15 + 1, vb2Cross_R1); // * Delta_g2
2070 
2071  /* d/dt(Equilibrium), node 2 */
2072  WM.Add(18 + 1, 24 + 1 + nConstraints + iCnt, vR1); // * Delta_FP
2073  WM.Add(21 + 1, 24 + 1 + nConstraints + iCnt, vb2Cross_R1); // * Delta_FP
2074 
2075  /* d/dt(Constraint), node 2 */
2076  WM.AddT(24 + 1 + nConstraints + iCnt, 18 + 1, vR1); // * Delta_xP2
2077  WM.AddT(24 + 1 + nConstraints + iCnt, 21 + 1, vb2Cross_R1); // * Delta_W2
2078  }
2079 
2080  for (unsigned iCnt = 0 ; iCnt < nRotConstraints; iCnt++) {
2081  Vec3 vR1(R1r.GetVec(iRotIncid[iCnt]));
2082 
2083  /* Equilibrium, node 1 */
2084  WM.Sub(3 + 1, 24 + 1 + nPosConstraints + iCnt, vR1); // * Delta_M
2085 
2086  /* Constraint, node 1 */
2087  WM.SubT(24 + 1 + nPosConstraints + iCnt, 3 + 1, vR1); // * Delta_g1
2088 
2089  /* d/dt(Equilibrium), node 1 */
2090  WM.Sub(9 + 1, 24 + 1 + nConstraints + nPosConstraints + iCnt, vR1); // * Delta_MP
2091 
2092  /* d/dt(Constraint), node 1 */
2093  WM.SubT(24 + 1 + nConstraints + nPosConstraints + iCnt, 9 + 1, vR1); // * Delta_W1
2094 
2095  /* Equilibrium, node 2 */
2096  WM.Add(15 + 1, 24 + 1 + nPosConstraints + iCnt, vR1); // * Delta_M
2097 
2098  /* Constraint, node 2 */
2099  WM.AddT(24 + 1 + nPosConstraints + iCnt, 15 + 1, vR1); // * Delta_g2
2100 
2101  /* d/dt(Equilibrium), node 2 */
2102  WM.Add(21 + 1, 24 + 1 + nConstraints + nPosConstraints + iCnt, vR1); // * Delta_MP
2103 
2104  /* d/dt(Constraint), node 2 */
2105  WM.AddT(24 + 1 + nConstraints + nPosConstraints + iCnt, 21 + 1, vR1); // * Delta_W2
2106  }
2107 
2108  return WorkMat;
2109 }
const StructNode * pNode1
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
unsigned int iPosIncid[3]
unsigned int nRotConstraints
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
unsigned int nPosConstraints
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
unsigned int iRotIncid[3]
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
TotalEquation * total_equation_element
void AddT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:227
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const StructNode * pNode2
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void SubT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:233
unsigned int nConstraints
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 2114 of file totalequation.cc.

References VectorHandler::Add(), Vec3::Cross(), DEBUGCOUT, F, f2, StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), iPosIncid, iRotIncid, M, nConstraints, nPosConstraints, nRotConstraints, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R1hr, R2hr, VectorHandler::ResizeReset(), VectorHandler::Sub(), total_equation_element, and Zero3.

2116 {
2117 
2118  DEBUGCOUT("Entering TotalReaction::InitialAssRes()" << std::endl);
2119 
2120  /* Dimensiona e resetta la matrice di lavoro */
2121  integer iNumRows = 0;
2122  integer iNumCols = 0;
2123  InitialWorkSpaceDim(&iNumRows, &iNumCols);
2124  WorkVec.ResizeReset(iNumRows);
2125 
2126  /* Indici */
2127  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
2128  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
2129  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
2130  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
2131  integer iFirstReactionIndex = total_equation_element->iGetFirstIndex();
2132  integer iReactionPrimeIndex = iFirstReactionIndex + nConstraints;
2133 
2134  /* Setta gli indici */
2135  for (int iCnt = 1; iCnt <= 6; iCnt++) {
2136  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
2137  WorkVec.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
2138  WorkVec.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
2139  WorkVec.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
2140  }
2141 
2142  for (unsigned int iCnt = 1; iCnt <= nConstraints; iCnt++) {
2143  WorkVec.PutRowIndex(24 + iCnt, iFirstReactionIndex + iCnt);
2144  WorkVec.PutRowIndex(24 + nConstraints + iCnt, iReactionPrimeIndex + iCnt);
2145  }
2146 
2147  /* Recupera i dati */
2148  /* Recupera i dati che servono */
2149  Mat3x3 R1(pNode1->GetRRef()*R1h);
2150  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
2151  Mat3x3 R2r(pNode2->GetRCurr()*R2hr);
2152 
2153  Vec3 b2(pNode2->GetRCurr()*f2);
2154  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
2155 
2156  Vec3 Omega1(pNode1->GetWCurr());
2157  Vec3 Omega2(pNode2->GetWCurr());
2158 
2159  Vec3 b1Prime(pNode2->GetVCurr() + Omega2.Cross(b2) - pNode1->GetVCurr());
2160 
2161  Vec3 FPrime(Zero3);
2162  Vec3 MPrime(Zero3);
2163 
2164  /* Aggiorna F ed M, che restano anche per InitialAssJac */
2165  for (unsigned iCnt = 0; iCnt < nPosConstraints; iCnt++) {
2166  F(iPosIncid[iCnt]) = XCurr(iFirstReactionIndex + 1 + iCnt);
2167  FPrime(iPosIncid[iCnt]) = XCurr(iReactionPrimeIndex + 1 + iCnt);
2168  }
2169 
2170  for (unsigned iCnt = 0; iCnt < nRotConstraints; iCnt++) {
2171  M(iRotIncid[iCnt]) = XCurr(iFirstReactionIndex + 1 + nPosConstraints + iCnt);
2172  MPrime(iRotIncid[iCnt]) = XCurr(iReactionPrimeIndex + 1 + nPosConstraints + iCnt);
2173  }
2174 
2175  Vec3 FTmp(R1 * F);
2176  Vec3 MTmp(R1r * M);
2177  Vec3 FPrimeTmp(R1 * FPrime);
2178  Vec3 MPrimeTmp(R1r * MPrime);
2179 
2180  /* Equilibrium, node 1 */
2181  WorkVec.Add(1, FTmp);
2182  WorkVec.Add(3 + 1, b1.Cross(FTmp) + MTmp);
2183 
2184  /* d/dt(Equilibrium), node 1 */
2185  WorkVec.Add(6 + 1, FPrimeTmp);
2186  WorkVec.Add(9 + 1, b1.Cross(FPrimeTmp) + MPrimeTmp);
2187 
2188  /* Equilibrium, node 2 */
2189  WorkVec.Sub(12 + 1, FTmp);
2190  WorkVec.Sub(15 + 1, b2.Cross(FTmp) + MTmp);
2191 
2192  /* d/dt( Equilibrium ) , node 2 */
2193  WorkVec.Sub(18 + 1, FPrimeTmp);
2194  WorkVec.Sub(21 + 1, b2.Cross(FPrimeTmp) + MPrimeTmp);
2195 
2196  return WorkVec;
2197 }
const StructNode * pNode1
unsigned int iPosIncid[3]
unsigned int nRotConstraints
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
unsigned int nPosConstraints
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
unsigned int iRotIncid[3]
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
TotalEquation * total_equation_element
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
const StructNode * pNode2
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
unsigned int nConstraints
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 381 of file totalequation.h.

References nConstraints.

Referenced by InitialAssJac(), and InitialAssRes().

381  {
382  *piNumRows = 24;
383  *piNumCols = *piNumRows = 24 + 2*nConstraints;
384  };
unsigned int nConstraints
void TotalReaction::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 1847 of file totalequation.cc.

References ToBeOutput::bToBeOutput(), F, f2, WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), OutputHandler::Joints(), M, Mat3x3::MulTM(), Mat3x3::MulTV(), Joint::Output(), pNode1, pNode2, R1h, R1hr, R2hr, tilde_f1, V1, V2, and RotManip::VecRot().

1848 {
1849  if (bToBeOutput()) {
1850  const Vec3& X1(pNode1->GetXCurr());
1851  const Vec3& X2(pNode2->GetXCurr());
1852  const Mat3x3& R1(pNode1->GetRCurr());
1853  const Mat3x3& R2(pNode2->GetRCurr());
1854  const Vec3& V1(pNode1->GetVCurr());
1855  const Vec3& V2(pNode2->GetVCurr());
1856  const Vec3& Omega1(pNode1->GetWCurr());
1857  const Vec3& Omega2(pNode2->GetWCurr());
1858 
1859  Mat3x3 R1Tmp(R1*R1h);
1860  Mat3x3 R1rTmp(R1*R1hr);
1861  Mat3x3 R2rTmp(R2*R2hr);
1862  Mat3x3 RTmp(R1rTmp.MulTM(R2rTmp));
1863  Vec3 b2(R2*f2);
1864  Vec3 b1(X2 + b2 - X1);
1865  Vec3 X(R1Tmp.MulTV(b1) - tilde_f1);
1866 
1867  Joint::Output(OH.Joints(), "TotalReaction", GetLabel(),
1868  F, M, R1Tmp*F, R1rTmp*M)
1869  << " " << X
1870  << " " << RotManip::VecRot(RTmp)
1871  << " " << R1Tmp.MulTV(V2 + Omega2.Cross(b2) - V1 - Omega1.Cross(b1))
1872  << " " << R1rTmp.MulTV(Omega2 - Omega1)
1873  << std::endl;
1874  // accelerations?
1875  }
1876 }
const StructNode * pNode1
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Definition: matvec3.h:50
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const StructNode * pNode2
std::ostream & Joints(void) const
Definition: output.h:443
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Definition: matvec3.h:49
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
std::ostream & Output(std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
Definition: joint.cc:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 1476 of file totalequation.cc.

References STRLENOF.

1477 {
1478  if (strncasecmp(s, "offset{" /*}*/ , STRLENOF("offset{" /*}*/ )) == 0)
1479  {
1480  s += STRLENOF("offset{" /*}*/ );
1481 
1482  if (strcmp(&s[1], /*{*/ "}") != 0) {
1483  return 0;
1484  }
1485 
1486  switch (s[0]) {
1487  case '1':
1488  return new Joint::OffsetHint<1>;
1489 
1490  case '2':
1491  return new Joint::OffsetHint<2>;
1492  }
1493 
1494  } else if (strncasecmp(s, "position-hinge{" /*}*/, STRLENOF("position-hinge{" /*}*/)) == 0) {
1495  s += STRLENOF("position-hinge{" /*}*/);
1496 
1497  if (strcmp(&s[1], /*{*/ "}") != 0) {
1498  return 0;
1499  }
1500 
1501  switch (s[0]) {
1502  case '1':
1503  return new Joint::HingeHint<1>;
1504 
1505  case '2':
1506  return new Joint::HingeHint<2>;
1507  }
1508 
1509  } else if (strncasecmp(s, "position-drive3{" /*}*/, STRLENOF("position-drive3{" /*}*/)) == 0) {
1510  s += STRLENOF("position-");
1511 
1512  Hint *pH = ::ParseHint(pDM, s);
1513  if (pH) {
1514  TplDriveHint<Vec3> *pTDH = dynamic_cast<TplDriveHint<Vec3> *>(pH);
1515  if (pTDH) {
1516  return new PositionDriveHint<Vec3>(pTDH);
1517  }
1518  }
1519  return 0;
1520 
1521  } else if (strncasecmp(s, "orientation-hinge{" /*}*/, STRLENOF("orientation-hinge{" /*}*/)) == 0) {
1522  s += STRLENOF("orientation-hinge{" /*}*/);
1523 
1524  if (strcmp(&s[1], /*{*/ "}") != 0) {
1525  return 0;
1526  }
1527 
1528  switch (s[0]) {
1529  case '1':
1530  return new Joint::HingeHint<1>;
1531 
1532  case '2':
1533  return new Joint::HingeHint<2>;
1534  }
1535 
1536  } else if (strncasecmp(s, "orientation-drive3{" /*}*/, STRLENOF("orientation-drive3{" /*}*/)) == 0) {
1537  s += STRLENOF("orientation-");
1538 
1539  Hint *pH = ::ParseHint(pDM, s);
1540  if (pH) {
1541  TplDriveHint<Vec3> *pTDH = dynamic_cast<TplDriveHint<Vec3> *>(pH);
1542  if (pTDH) {
1543  return new OrientationDriveHint<Vec3>(pTDH);
1544  }
1545  }
1546  return 0;
1547  }
1548 
1549  return 0;
1550 }
Definition: hint.h:38
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
#define STRLENOF(s)
Definition: mbdyn.h:166
std::ostream & TotalReaction::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 1568 of file totalequation.cc.

References bPosActive, bRotActive, f1, f2, WithLabel::GetLabel(), Mat3x3::GetVec(), pNode1, pNode2, R1h, R1hr, R2h, R2hr, Joint::Restart(), and Vec3::Write().

1569 {
1570  Joint::Restart(out) << ", total equation, "
1571  << pNode1->GetLabel() << ", "
1572  << "position, ";
1573  f1.Write(out, ", ") << ", "
1574  << "position orientation, "
1575  "1 , ";
1576  R1h.GetVec(1).Write(out, ", ") << ", "
1577  "2 , ";
1578  R1h.GetVec(2).Write(out, ", ") << ", "
1579  << "rotation orientation, "
1580  "1 , ";
1581  R1hr.GetVec(1).Write(out, ", ") << ", "
1582  "2 , ";
1583  R1hr.GetVec(2).Write(out, ", ") << ", "
1584  << pNode2->GetLabel() << ", "
1585  << "position, ";
1586  f2.Write(out, ", ") << ", "
1587  << "position orientation, "
1588  "1 , ";
1589  R2h.GetVec(1).Write(out, ", ") << ", "
1590  "2 , ";
1591  R2h.GetVec(2).Write(out, ", ") << ", "
1592  << "rotation orientation, "
1593  "1 , ";
1594  R2hr.GetVec(1).Write(out, ", ") << ", "
1595  "2 , ";
1596  R2hr.GetVec(2).Write(out, ", ");
1597 
1598  if (bPosActive[0] || bPosActive[1] || bPosActive[2]) {
1599  out << ", position constraint";
1600  for (unsigned i = 0; i < 3; i++) {
1601  if (bPosActive[i]) {
1602  out << ", active";
1603  } else {
1604  out << ", inactive";
1605  }
1606  }
1607  }
1608 
1609  if (bRotActive[0] || bRotActive[1] || bRotActive[2]) {
1610  out << ", orientation constraint";
1611  for (unsigned i = 0; i < 3; i++) {
1612  if (bRotActive[i]) {
1613  out << ", active";
1614  } else {
1615  out << ", inactive";
1616  }
1617  }
1618  }
1619 
1620  return out << std::endl;
1621 }
bool bRotActive[3]
const StructNode * pNode1
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
bool bPosActive[3]
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 * pNode2
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 1383 of file totalequation.cc.

References f1, f2, StructNode::GetRCurr(), StructDispNode::GetXCurr(), MBDYN_EXCEPT_ARGS, Mat3x3::MulTM(), Mat3x3::MulTV(), pNode1, pNode2, Joint::JointDriveHint< T >::pTDH, R1h, R1hr, R2h, R2hr, tilde_f1, and WithLabel::uLabel.

1386 {
1387  if (ph) {
1388  for (unsigned int i = 0; i < ph->size(); i++) {
1389  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
1390 
1391  if (pjh) {
1392 
1393  if (dynamic_cast<Joint::OffsetHint<1> *>(pjh)) {
1394  const Mat3x3& R1(pNode1->GetRCurr());
1395  Vec3 fTmp2(pNode2->GetRCurr()*f2);
1396 
1397  f1 = R1.MulTV(pNode2->GetXCurr() + fTmp2 - pNode1->GetXCurr());
1398  tilde_f1 = R1h.MulTV(f1);
1399 
1400 
1401  } else if (dynamic_cast<Joint::OffsetHint<2> *>(pjh)) {
1402  const Mat3x3& R2(pNode2->GetRCurr());
1403  Vec3 fTmp1(pNode1->GetRCurr()*f1);
1404 
1405  f2 = R2.MulTV(pNode1->GetXCurr() + fTmp1 - pNode2->GetXCurr());
1406 
1407  } else if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
1408  if (dynamic_cast<Joint::PositionHingeHint<1> *>(pjh)) {
1409  const Mat3x3& R1(pNode1->GetRCurr());
1410  R1h = R1.MulTM(pNode2->GetRCurr()*R2h);
1411 
1412  } else if (dynamic_cast<Joint::OrientationHingeHint<1> *>(pjh)) {
1413  const Mat3x3& R1(pNode1->GetRCurr());
1414  R1hr = R1.MulTM(pNode2->GetRCurr()*R2hr);
1415  }
1416 
1417  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
1418  if (dynamic_cast<Joint::PositionHingeHint<2> *>(pjh)) {
1419  const Mat3x3& R2(pNode2->GetRCurr());
1420  R2h = R2.MulTM(pNode1->GetRCurr()*R1h);
1421 
1422  } else if (dynamic_cast<Joint::OrientationHingeHint<2> *>(pjh)) {
1423  const Mat3x3& R2(pNode2->GetRCurr());
1424  R2hr = R2.MulTM(pNode1->GetRCurr()*R1hr);
1425  }
1426 
1427 #if 0
1428  } else if (dynamic_cast<Joint::JointDriveHint<Vec3> *>(pjh)) {
1430  = dynamic_cast<Joint::JointDriveHint<Vec3> *>(pjh);
1431  pedantic_cout("TotalReaction(" << uLabel << "): "
1432  "creating drive from hint[" << i << "]..." << std::endl);
1433 
1434  TplDriveCaller<Vec3> *pDC = pjdh->pTDH->pCreateDrive(pDM);
1435  if (pDC == 0) {
1436  silent_cerr("TotalReaction(" << uLabel << "): "
1437  "unable to create drive "
1438  "after hint #" << i << std::endl);
1440  }
1441 
1442  if (dynamic_cast<Joint::PositionDriveHint<Vec3> *>(pjdh)) {
1443  XDrv.Set(pDC);
1444 
1445  } else if (dynamic_cast<Joint::VelocityDriveHint<Vec3> *>(pjdh)) {
1446  XPDrv.Set(pDC);
1447 
1448  } else if (dynamic_cast<Joint::AccelerationDriveHint<Vec3> *>(pjdh)) {
1449  XPPDrv.Set(pDC);
1450 
1451  } else if (dynamic_cast<Joint::OrientationDriveHint<Vec3> *>(pjdh)) {
1452  ThetaDrv.Set(pDC);
1453 
1454  } else if (dynamic_cast<Joint::AngularVelocityDriveHint<Vec3> *>(pjdh)) {
1455  OmegaDrv.Set(pDC);
1456 
1457  } else if (dynamic_cast<Joint::AngularAccelerationDriveHint<Vec3> *>(pjdh)) {
1458  OmegaPDrv.Set(pDC);
1459 
1460  } else {
1461  delete pDC;
1462  }
1463 #endif
1464 
1465  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
1466  /* TODO */
1467  }
1468 
1469  continue;
1470  }
1471  }
1472  }
1473 }
const StructNode * pNode1
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
TplDriveHint< T > * pTDH
Definition: joint.h:137
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
unsigned int uLabel
Definition: withlab.h:44
const StructNode * pNode2
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310

Here is the call graph for this function:

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

Implements Elem.

Definition at line 353 of file totalequation.h.

References nConstraints.

Referenced by AssJac(), and AssRes().

353  {
354  *piNumRows = 12;
355  *piNumCols = 12 + nConstraints ;
356  };
unsigned int nConstraints

Member Data Documentation

bool TotalReaction::bPosActive[3]
private

Definition at line 260 of file totalequation.h.

Referenced by DescribeDof(), dGetPrivData(), Restart(), and TotalReaction().

bool TotalReaction::bRotActive[3]
private

Definition at line 261 of file totalequation.h.

Referenced by DescribeDof(), dGetPrivData(), Restart(), and TotalReaction().

Vec3 TotalReaction::F
mutableprivate

Definition at line 273 of file totalequation.h.

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

Vec3 TotalReaction::f1
private

Definition at line 254 of file totalequation.h.

Referenced by dGetPrivData(), Restart(), and SetValue().

Vec3 TotalReaction::f2
private
unsigned int TotalReaction::iPosIncid[3]
private

Definition at line 267 of file totalequation.h.

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

unsigned int TotalReaction::iRotIncid[3]
private

Definition at line 268 of file totalequation.h.

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

Vec3 TotalReaction::M
mutableprivate

Definition at line 272 of file totalequation.h.

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

unsigned int TotalReaction::nConstraints
private
unsigned int TotalReaction::nPosConstraints
private
unsigned int TotalReaction::nRotConstraints
private
const StructNode* TotalReaction::pNode1
private
const StructNode* TotalReaction::pNode2
private
Mat3x3 TotalReaction::R1h
private
Mat3x3 TotalReaction::R1hr
private

Definition at line 256 of file totalequation.h.

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

Mat3x3 TotalReaction::R2h
private

Definition at line 258 of file totalequation.h.

Referenced by Restart(), and SetValue().

Mat3x3 TotalReaction::R2hr
private

Definition at line 259 of file totalequation.h.

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

Vec3 TotalReaction::ThetaDelta
mutableprivate

Definition at line 274 of file totalequation.h.

Referenced by AfterConvergence(), and dGetPrivData().

Vec3 TotalReaction::ThetaDeltaPrev
mutableprivate

Definition at line 275 of file totalequation.h.

Referenced by AfterConvergence(), and dGetPrivData().

Vec3 TotalReaction::tilde_f1
private

Definition at line 270 of file totalequation.h.

Referenced by Output(), and SetValue().

TotalEquation* TotalReaction::total_equation_element
private

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