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

#include <vehj.h>

Inheritance diagram for DeformableHingeJoint:
Collaboration diagram for DeformableHingeJoint:

Public Member Functions

 DeformableHingeJoint (unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &tilde_R1h, const Mat3x3 &tilde_R2h, const OrientationDescription &od, flag fOut)
 
virtual ~DeformableHingeJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void SetInitialValue (VectorHandler &)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual ConstLawType::Type GetConstLawType (void) const =0
 
virtual unsigned int iGetNumDof (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual bool bInverseDynamics (void) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
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 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)
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const =0
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)=0
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)=0
 
- Public Member Functions inherited from ConstitutiveLawOwner< T, Tder >
 ConstitutiveLawOwner (const ConstitutiveLaw< T, Tder > *pCL)
 
virtual ~ConstitutiveLawOwner (void)
 
ConstitutiveLaw< T, Tder > * pGetConstLaw (void) const
 
void Update (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
void AfterConvergence (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
const T & GetF (void) const
 
const Tder & GetFDE (void) const
 
const Tder & GetFDEPrime (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 std::ostream & OutputAppend (std::ostream &out) const
 

Protected Member Functions

virtual void AssMatM (FullSubMatrixHandler &WMA, doublereal dCoef)
 
void AssMatMInv (FullSubMatrixHandler &WMA, doublereal dCoef)
 
void AssMatMDE (FullSubMatrixHandler &WMA, doublereal dCoef)
 
virtual void AssMatMDEPrime (FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
 
void AssMatMDEPrimeInv (FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
 
void OutputInv (OutputHandler &OH) const
 
doublereal dGetPrivDataInv (unsigned int i) const
 
virtual void AfterPredict (void)=0
 
- Protected Member Functions inherited from Joint
virtual void OutputPrepare_int (const std::string &type, OutputHandler &OH, std::string &name)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Protected Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Mat3x3 tilde_R1h
 
Mat3x3 tilde_R2h
 
OrientationDescription od
 
bool bFirstRes
 
Vec3 M
 
Mat3x3 MDE
 
Mat3x3 MDEPrime
 
Mat3x3 hat_I
 
Mat3x3 hat_IT
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 
- Protected Attributes inherited from ConstitutiveLawOwner< T, Tder >
ConstitutiveLaw< T, Tder > * pConstLaw
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Joint
enum  Type {
  UNKNOWN = -1, DISTANCE = 0, DISTANCEWITHOFFSET, CLAMP,
  SPHERICALHINGE, PIN, UNIVERSALHINGE, UNIVERSALROTATION,
  UNIVERSALPIN, PLANEHINGE, PLANEROTATION, PLANEPIN,
  AXIALROTATION, PLANEDISP, PLANEDISPPIN, INPLANE,
  INPLANECONTACT, J_INLINE, ROD, RODBEZIER,
  DEFORMABLEHINGE, DEFORMABLEDISPJOINT, DEFORMABLEJOINT, DEFORMABLEAXIALJOINT,
  VISCOUSBODY, LINEARVELOCITY, ANGULARVELOCITY, LINEARACCELERATION,
  ANGULARACCELERATION, PRISMATIC, DRIVEHINGE, DRIVEDISP,
  DRIVEDISPPIN, IMPOSEDORIENTATION, IMPOSEDDISP, IMPOSEDDISPPIN,
  IMPOSEDKINEMATICS, BEAMSLIDER, BRAKE, GIMBAL,
  POINT_SURFACE_CONTACT, TOTALJOINT, TOTALPINJOINT, TOTALEQUATION,
  TOTALREACTION, MODAL, SCREWJOINT, LASTJOINTTYPE
}
 

Detailed Description

Definition at line 45 of file vehj.h.

Constructor & Destructor Documentation

DeformableHingeJoint::DeformableHingeJoint ( unsigned int  uL,
const DofOwner pDO,
const ConstitutiveLaw3D pCL,
const StructNode pN1,
const StructNode pN2,
const Mat3x3 tilde_R1h,
const Mat3x3 tilde_R2h,
const OrientationDescription od,
flag  fOut 
)

Definition at line 45 of file vehj.cc.

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

54 : Elem(uL, fOut),
55 Joint(uL, pDO, fOut),
57 pNode1(pN1),
58 pNode2(pN2),
59 tilde_R1h(tilde_R1h),
60 tilde_R2h(tilde_R2h),
61 od(od),
62 #ifdef USE_NETCDF
63 Var_Phi(0),
64 Var_Omega(0),
65 #endif // USE_NETCDF
66 bFirstRes(false)
67 {
68  ASSERT(pNode1 != NULL);
69  ASSERT(pNode2 != NULL);
72 }
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
ConstitutiveLawOwner< Vec3, Mat3x3 > ConstitutiveLaw3DOwner
Definition: constltp.h:379
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
const StructNode * pNode1
Definition: vehj.h:48
OrientationDescription od
Definition: vehj.h:53
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 tilde_R1h
Definition: vehj.h:50
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
Mat3x3 tilde_R2h
Definition: vehj.h:51
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

DeformableHingeJoint::~DeformableHingeJoint ( void  )
virtual

Definition at line 75 of file vehj.cc.

References NO_OP.

76 {
77  NO_OP;
78 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

virtual void DeformableHingeJoint::AfterPredict ( void  )
protectedpure virtual
void DeformableHingeJoint::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 335 of file vehj.cc.

References AfterPredict(), and bFirstRes.

337 {
338  bFirstRes = true;
339 
340  AfterPredict();
341 }
virtual void AfterPredict(void)=0

Here is the call graph for this function:

void DeformableHingeJoint::AssMatM ( FullSubMatrixHandler WMA,
doublereal  dCoef 
)
protectedvirtual

Reimplemented in ViscoElasticHingeJointInv, ViscousHingeJointInv, and ElasticHingeJointInv.

Definition at line 83 of file vehj.cc.

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

Referenced by ElasticHingeJoint::AssMat(), ViscousHingeJoint::AssMats(), and ViscoElasticHingeJoint::AssMats().

85 {
86  /* M was updated by AssRes */
87  Mat3x3 MTmp(MatCross, M*dCoef);
88 
89  WMA.Add(1, 1, MTmp);
90  WMA.Sub(4, 1, MTmp);
91 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215

Here is the call graph for this function:

void DeformableHingeJoint::AssMatMDE ( FullSubMatrixHandler WMA,
doublereal  dCoef 
)
protected

Definition at line 113 of file vehj.cc.

References FullSubMatrixHandler::Add(), MDE, and FullSubMatrixHandler::Sub().

Referenced by ElasticHingeJoint::AssMat(), and ViscoElasticHingeJoint::AssMats().

115 {
116  Mat3x3 MTmp(MDE*dCoef);
117 
118  WMA.Add(1, 1, MTmp);
119  WMA.Sub(1, 4, MTmp);
120  WMA.Sub(4, 1, MTmp);
121  WMA.Add(4, 4, MTmp);
122 }
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215

Here is the call graph for this function:

void DeformableHingeJoint::AssMatMDEPrime ( FullSubMatrixHandler WMA,
FullSubMatrixHandler WMB,
doublereal  dCoef 
)
protectedvirtual

Reimplemented in ViscoElasticHingeJointInv, and ViscousHingeJointInv.

Definition at line 126 of file vehj.cc.

References FullSubMatrixHandler::Add(), StructNode::GetWCurr(), MatCross, MDEPrime, pNode2, and FullSubMatrixHandler::Sub().

Referenced by ViscousHingeJoint::AssMats(), and ViscoElasticHingeJoint::AssMats().

128 {
129  WMB.Add(1, 1, MDEPrime);
130  WMB.Sub(1, 4, MDEPrime);
131  WMB.Sub(4, 1, MDEPrime);
132  WMB.Add(4, 4, MDEPrime);
133 
134  Mat3x3 MTmp(MDEPrime*Mat3x3(MatCross, pNode2->GetWCurr()*dCoef));
135  WMA.Sub(1, 1, MTmp);
136  WMA.Add(1, 4, MTmp);
137  WMA.Add(4, 1, MTmp);
138  WMA.Sub(4, 4, MTmp);
139 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
Mat3x3 MDEPrime
Definition: vehj.h:67
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

void DeformableHingeJoint::AssMatMDEPrimeInv ( FullSubMatrixHandler WMA,
FullSubMatrixHandler WMB,
doublereal  dCoef 
)
protected

Definition at line 143 of file vehj.cc.

References FullSubMatrixHandler::Add(), StructNode::GetWCurr(), hat_I, hat_IT, MDEPrime, pNode1, pNode2, and FullSubMatrixHandler::Sub().

Referenced by ViscousHingeJointInv::AssMatMDEPrime(), and ViscoElasticHingeJointInv::AssMatMDEPrime().

145 {
146  /* hat_I and hat_IT were updated by AfterPredict */
147  WMB.Add(1, 1, MDEPrime);
148  WMB.Sub(1, 4, MDEPrime);
149  WMB.Sub(4, 1, MDEPrime);
150  WMB.Add(4, 4, MDEPrime);
151 
152  Vec3 W1(pNode1->GetWCurr()*dCoef);
153  Vec3 W2(pNode2->GetWCurr()*dCoef);
154  Mat3x3 MTmp(MDEPrime*(W2.Cross(hat_IT) + W1.Cross(hat_I)));
155  WMA.Sub(1, 1, MTmp);
156  WMA.Add(1, 4, MTmp);
157  WMA.Add(4, 1, MTmp);
158  WMA.Sub(4, 4, MTmp);
159 }
Definition: matvec3.h:98
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
Mat3x3 hat_I
Definition: vehj.h:70
const StructNode * pNode1
Definition: vehj.h:48
Mat3x3 hat_IT
Definition: vehj.h:71
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
Mat3x3 MDEPrime
Definition: vehj.h:67
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

void DeformableHingeJoint::AssMatMInv ( FullSubMatrixHandler WMA,
doublereal  dCoef 
)
protected

Definition at line 95 of file vehj.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), hat_I, hat_IT, M, and FullSubMatrixHandler::Sub().

Referenced by ElasticHingeJointInv::AssMatM(), ViscousHingeJointInv::AssMatM(), and ViscoElasticHingeJointInv::AssMatM().

96 {
97  /* M was updated by AssRes;
98  * hat_I and hat_IT were updated by AfterPredict */
99  Vec3 MCoef(M*dCoef);
100  Mat3x3 MTmp(MCoef.Cross(hat_IT));
101 
102  WMA.Add(1, 1, MTmp);
103  WMA.Sub(4, 1, MTmp);
104 
105  MTmp = MCoef.Cross(hat_I);
106 
107  WMA.Add(1, 4, MTmp);
108  WMA.Sub(4, 4, MTmp);
109 }
Definition: matvec3.h:98
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
Mat3x3 hat_I
Definition: vehj.h:70
Mat3x3 hat_IT
Definition: vehj.h:71
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215

Here is the call graph for this function:

bool DeformableHingeJoint::bInverseDynamics ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 374 of file vehj.cc.

375 {
376  return true;
377 }
doublereal DeformableHingeJoint::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from ConstitutiveLawOwner< T, Tder >.

Reimplemented in ViscoElasticHingeJointInv, ViscousHingeJointInv, and ElasticHingeJointInv.

Definition at line 470 of file vehj.cc.

References ASSERT, ConstitutiveLawOwner< T, Tder >::dGetPrivData(), ConstitutiveLawOwner< T, Tder >::GetF(), StructNode::GetRCurr(), StructNode::GetWCurr(), iGetNumPrivData(), pNode1, pNode2, tilde_R1h, tilde_R2h, and RotManip::VecRot().

Referenced by dGetPrivDataInv().

471 {
472  ASSERT(i > 0);
473 
474  ASSERT(i <= iGetNumPrivData());
475 
476  switch (i) {
477  case 1:
478  case 2:
479  case 3:
480  {
481  /* NOTE: this is correct also in the invariant case */
484 
485  Vec3 v(RotManip::VecRot(R1h.MulTM(R2h)));
486 
487  return v(i);
488  }
489 
490  case 4:
491  case 5:
492  case 6:
493  {
495  Vec3 w(R1h.MulTV(pNode2->GetWCurr() - pNode1->GetWCurr()));
496 
497  return w(i - 3);
498  }
499 
500  case 7:
501  case 8:
502  case 9:
503  return GetF()(i - 6);
504 
505  default:
507  }
508 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual unsigned int iGetNumPrivData(void) const
Definition: vehj.cc:408
const StructNode * pNode1
Definition: vehj.h:48
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
#define ASSERT(expression)
Definition: colamd.c:977
virtual doublereal dGetPrivData(unsigned int i) const
Definition: constltp.h:369
const T & GetF(void) const
Definition: constltp.h:293
Mat3x3 tilde_R1h
Definition: vehj.h:50
Mat3x3 tilde_R2h
Definition: vehj.h:51
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

doublereal DeformableHingeJoint::dGetPrivDataInv ( unsigned int  i) const
protected

Definition at line 511 of file vehj.cc.

References ASSERT, dGetPrivData(), StructNode::GetRCurr(), StructNode::GetWCurr(), iGetNumPrivData(), pNode1, pNode2, RotManip::Rot(), tilde_R1h, tilde_R2h, and RotManip::VecRot().

Referenced by ElasticHingeJointInv::dGetPrivData(), ViscousHingeJointInv::dGetPrivData(), and ViscoElasticHingeJointInv::dGetPrivData().

512 {
513  ASSERT(i > 0);
514 
515  ASSERT(i <= iGetNumPrivData());
516 
517  switch (i) {
518  case 4:
519  case 5:
520  case 6:
521  {
524  Mat3x3 hat_R(R1h*RotManip::Rot(RotManip::VecRot(R1h.MulTM(R2h)/2.)));
525  Vec3 w(hat_R.MulTV(pNode2->GetWCurr() - pNode1->GetWCurr()));
526 
527  return w(i - 3);
528  }
529 
530  default:
531  /* fall back to regular one */
533  }
534 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual unsigned int iGetNumPrivData(void) const
Definition: vehj.cc:408
virtual doublereal dGetPrivData(unsigned int i) const
Definition: vehj.cc:470
const StructNode * pNode1
Definition: vehj.h:48
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Mat3x3 Rot(const Vec3 &phi)
Definition: Rot.cc:62
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 tilde_R1h
Definition: vehj.h:50
Mat3x3 tilde_R2h
Definition: vehj.h:51
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 161 of file vehj.h.

References pNode1, and pNode2.

161  {
162  connectedNodes.resize(2);
163  connectedNodes[0] = pNode1;
164  connectedNodes[1] = pNode2;
165  };
const StructNode * pNode1
Definition: vehj.h:48
const StructNode * pNode2
Definition: vehj.h:49
virtual ConstLawType::Type DeformableHingeJoint::GetConstLawType ( void  ) const
pure virtual
virtual Joint::Type DeformableHingeJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 115 of file vehj.h.

References Joint::DEFORMABLEHINGE.

115  {
116  return Joint::DEFORMABLEHINGE;
117  };
virtual unsigned int DeformableHingeJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 154 of file vehj.h.

154  {
155  return 0;
156  };
virtual unsigned int DeformableHingeJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from ConstitutiveLawOwner< T, Tder >.

Definition at line 139 of file vehj.h.

139  {
140  return 0;
141  };
unsigned int DeformableHingeJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from ConstitutiveLawOwner< T, Tder >.

Definition at line 408 of file vehj.cc.

References ConstitutiveLawOwner< T, Tder >::iGetNumPrivData().

Referenced by dGetPrivData(), and dGetPrivDataInv().

409 {
411 }
virtual unsigned int iGetNumPrivData(void) const
Definition: constltp.h:352

Here is the call graph for this function:

unsigned int DeformableHingeJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from ConstitutiveLawOwner< T, Tder >.

Definition at line 414 of file vehj.cc.

References ASSERT, ConstitutiveLawOwner< T, Tder >::iGetPrivDataIdx(), and STRLENOF.

415 {
416  ASSERT(s != NULL);
417 
418  unsigned idx = 0;
419 
420  switch (s[0]) {
421  case 'r':
422  break;
423 
424  case 'w':
425  idx += 3;
426  break;
427 
428  case 'M':
429  idx += 6;
430  break;
431 
432  default:
433  {
434  const size_t l = STRLENOF("constitutiveLaw.");
435  if (strncmp(s, "constitutiveLaw.", l) == 0) {
437  if (idx > 0) {
438  return 9 + idx;
439  }
440  }
441  return 0;
442  }
443  }
444 
445  switch (s[1]) {
446  case 'x':
447  idx += 1;
448  break;
449 
450  case 'y':
451  idx += 2;
452  break;
453 
454  case 'z':
455  idx += 3;
456  break;
457 
458  default:
459  return 0;
460  }
461 
462  if (s[2] != '\0') {
463  return 0;
464  }
465 
466  return idx;
467 }
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: constltp.h:361
#define ASSERT(expression)
Definition: colamd.c:977
#define STRLENOF(s)
Definition: mbdyn.h:166

Here is the call graph for this function:

void DeformableHingeJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Reimplemented in ViscoElasticHingeJointInv, ViscousHingeJointInv, and ElasticHingeJointInv.

Definition at line 195 of file vehj.cc.

References ToBeOutput::bToBeOutput(), dRaDegr, EULER_123, EULER_313, EULER_321, GetConstLawType(), OutputHandler::GetCurrentStep(), ConstitutiveLawOwner< T, Tder >::GetF(), WithLabel::GetLabel(), StructNode::GetRCurr(), StructNode::GetWCurr(), OutputHandler::JOINTS, OutputHandler::Joints(), MatR2EulerAngles123(), MatR2EulerAngles313(), MatR2EulerAngles321(), od, ORIENTATION_MATRIX, ORIENTATION_VECTOR, Joint::Output(), Mat3x3::pGetMat(), Vec3::pGetVec(), pNode1, pNode2, R, tilde_R1h, tilde_R2h, OutputHandler::UseNetCDF(), OutputHandler::UseText(), RotManip::VecRot(), ConstLawType::VISCOUS, and Zero3.

196 {
197  if (bToBeOutput()) {
200  Mat3x3 R(R1h.MulTM(R2h));
201  Vec3 OmegaTmp(R1h.MulTV(pNode2->GetWCurr() - pNode1->GetWCurr()));
202  Vec3 v(GetF());
203  Vec3 E;
204  switch (od) {
205  case EULER_123:
207  break;
208 
209  case EULER_313:
211  break;
212 
213  case EULER_321:
215  break;
216 
217  case ORIENTATION_VECTOR:
218  E = RotManip::VecRot(R);
219  break;
220 
221  case ORIENTATION_MATRIX:
222  break;
223 
224  default:
225  /* impossible */
226  break;
227  }
228 
229 #ifdef USE_NETCDF
231  Var_F_local->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
232  Var_M_local->put_rec(v.pGetVec(), OH.GetCurrentStep());
233  Var_F_global->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
234  Var_M_global->put_rec((R1h*v).pGetVec(), OH.GetCurrentStep());
235  Var_Omega->put_rec(OmegaTmp.pGetVec(), OH.GetCurrentStep());
236 
237  switch (od) {
238  case EULER_123:
239  case EULER_313:
240  case EULER_321:
241  case ORIENTATION_VECTOR:
242  Var_Phi->put_rec(E.pGetVec(), OH.GetCurrentStep());
243  break;
244 
245  case ORIENTATION_MATRIX:
246  Var_Phi->put_rec(R.pGetMat(), OH.GetCurrentStep());
247  break;
248 
249  default:
250  /* impossible */
251  break;
252  }
253 
254 
255  }
256 #endif // USE_NETCDF
257  if (OH.UseText(OutputHandler::JOINTS)) {
258  Joint::Output(OH.Joints(), "DeformableHinge", GetLabel(),
259  Zero3, v, Zero3, R1h*v) << " ";
260 
261  switch (od) {
262  case EULER_123:
263  case EULER_313:
264  case EULER_321:
265  case ORIENTATION_VECTOR:
266  OH.Joints() << E;
267  break;
268 
269  case ORIENTATION_MATRIX:
270  OH.Joints() << R;
271  break;
272 
273  default:
274  /* impossible */
275  break;
276  }
277 
278 
280  OH.Joints() << " " << OmegaTmp;
281  }
282 
283  OH.Joints() << std::endl;
284  }
285  }
286 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: vehj.h:48
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Definition: matvec3.cc:927
OrientationDescription od
Definition: vehj.h:53
long GetCurrentStep(void) const
Definition: output.h:116
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
Definition: matvec3.cc:893
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const doublereal dRaDegr
Definition: matvec3.cc:884
std::ostream & Joints(void) const
Definition: output.h:443
const doublereal * pGetMat(void) const
Definition: matvec3.h:743
const T & GetF(void) const
Definition: constltp.h:293
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
Definition: matvec3.cc:941
Mat3x3 tilde_R1h
Definition: vehj.h:50
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
Mat3x3 tilde_R2h
Definition: vehj.h:51
virtual ConstLawType::Type GetConstLawType(void) const =0
bool UseText(int out) const
Definition: output.cc:446
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

void DeformableHingeJoint::OutputInv ( OutputHandler OH) const
protected

Definition at line 289 of file vehj.cc.

References ToBeOutput::bToBeOutput(), dRaDegr, EULER_123, EULER_313, EULER_321, GetConstLawType(), ConstitutiveLawOwner< T, Tder >::GetF(), WithLabel::GetLabel(), StructNode::GetRCurr(), StructNode::GetWCurr(), OutputHandler::Joints(), MatR2EulerAngles123(), MatR2EulerAngles313(), MatR2EulerAngles321(), od, ORIENTATION_MATRIX, ORIENTATION_VECTOR, Joint::Output(), pNode1, pNode2, R, RotManip::Rot(), tilde_R1h, tilde_R2h, RotManip::VecRot(), ConstLawType::VISCOUS, and Zero3.

Referenced by ElasticHingeJointInv::Output(), ViscousHingeJointInv::Output(), and ViscoElasticHingeJointInv::Output().

290 {
291  if (bToBeOutput()) {
294  Mat3x3 R(R1h.MulTM(R2h));
295  Mat3x3 hat_R(R1h*RotManip::Rot(RotManip::VecRot(R)/2.));
296 
297  Vec3 v(GetF());
298  Joint::Output(OH.Joints(), "DeformableHinge", GetLabel(),
299  Zero3, v, Zero3, hat_R*v) << " ";
300 
301  switch (od) {
302  case EULER_123:
304  break;
305 
306  case EULER_313:
308  break;
309 
310  case EULER_321:
312  break;
313 
314  case ORIENTATION_VECTOR:
315  OH.Joints() << RotManip::VecRot(R);
316  break;
317 
318  case ORIENTATION_MATRIX:
319  OH.Joints() << R;
320  break;
321 
322  default:
323  /* impossible */
324  break;
325  }
326 
328  OH.Joints() << " " << hat_R.MulTV(pNode2->GetWCurr() - pNode1->GetWCurr());
329  }
330  OH.Joints() << std::endl;
331  }
332 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: vehj.h:48
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Definition: matvec3.cc:927
OrientationDescription od
Definition: vehj.h:53
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
Definition: matvec3.cc:893
Mat3x3 Rot(const Vec3 &phi)
Definition: Rot.cc:62
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const doublereal dRaDegr
Definition: matvec3.cc:884
std::ostream & Joints(void) const
Definition: output.h:443
const T & GetF(void) const
Definition: constltp.h:293
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
Definition: matvec3.cc:941
Mat3x3 tilde_R1h
Definition: vehj.h:50
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
Mat3x3 tilde_R2h
Definition: vehj.h:51
virtual ConstLawType::Type GetConstLawType(void) const =0
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

void DeformableHingeJoint::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 177 of file vehj.cc.

References ToBeOutput::bToBeOutput(), OutputHandler::JOINTS, od, Joint::OutputPrepare_int(), and OutputHandler::UseNetCDF().

178 {
179  if (bToBeOutput()) {
180 #ifdef USE_NETCDF
182  std::string name;
183  OutputPrepare_int("deformable hinge", OH, name);
184 
185  Var_Phi = OH.CreateRotationVar(name, "", od, "global");
186 
187  Var_Omega = OH.CreateVar<Vec3>(name + "Omega", "radian/s",
188  "local relative angular velocity (x, y, z)");
189  }
190 #endif // USE_NETCDF
191  }
192 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
OrientationDescription od
Definition: vehj.h:53
virtual void OutputPrepare_int(const std::string &type, OutputHandler &OH, std::string &name)
Definition: joint.cc:107

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 386 of file vehj.cc.

References SimulationEntity::ParseHint(), and STRLENOF.

387 {
388  if (strncasecmp(s, "hinge{" /*}*/, STRLENOF("hinge{" /*}*/)) == 0) {
389  s += STRLENOF("hinge{" /*}*/);
390 
391  if (strcmp(&s[1], /*{*/ "}") != 0) {
392  return 0;
393  }
394 
395  switch (s[0]) {
396  case '1':
397  return new Joint::HingeHint<1>;
398 
399  case '2':
400  return new Joint::HingeHint<2>;
401  }
402  }
403 
404  return ConstitutiveLaw3DOwner::ParseHint(pDM, s);
405 }
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: simentity.cc:76
#define STRLENOF(s)
Definition: mbdyn.h:166

Here is the call graph for this function:

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

Implements Elem.

Definition at line 163 of file vehj.cc.

References WithLabel::GetLabel(), Mat3x3::GetVec(), ConstitutiveLawOwner< T, Tder >::pGetConstLaw(), pNode1, pNode2, Joint::Restart(), tilde_R1h, tilde_R2h, and Write().

164 {
165  /* FIXME: does not work for invariant hinge */
166  Joint::Restart(out) << ", deformable hinge, "
167  << pNode1->GetLabel() << ", hinge, reference, node, 1, ",
168  (tilde_R1h.GetVec(1)).Write(out, ", ")
169  << ", 2, ", (tilde_R1h.GetVec(2)).Write(out, ", ") << ", "
170  << pNode2->GetLabel() << ", hinge, reference, node, 1, ",
171  (tilde_R2h.GetVec(1)).Write(out, ", ")
172  << ", 2, ", (tilde_R2h.GetVec(2)).Write(out, ", ") << ", ";
173  return pGetConstLaw()->Restart(out) << ';' << std::endl;
174 }
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
Definition: constltp.h:278
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const StructNode * pNode1
Definition: vehj.h:48
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
Mat3x3 tilde_R1h
Definition: vehj.h:50
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Mat3x3 tilde_R2h
Definition: vehj.h:51
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

void DeformableHingeJoint::SetInitialValue ( VectorHandler X)
virtual

Initialize state vector used in initial assembly. May set internal states of the element. Do not rely on being always called, because initial assembly could be implicitly or explicitly skipped

Reimplemented from Joint.

Definition at line 380 of file vehj.cc.

References AfterPredict().

381 {
382  AfterPredict();
383 }
virtual void AfterPredict(void)=0

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 344 of file vehj.cc.

References StructNode::GetRCurr(), pNode1, pNode2, SimulationEntity::SetValue(), tilde_R1h, tilde_R2h, and Mat3x3::Transpose().

347 {
348  if (ph) {
349  for (unsigned i = 0; i < ph->size(); i++) {
350  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
351 
352  if (pjh) {
353  if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
355 
356  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
358 
359  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
360  /* TODO */
361  }
362 
363  continue;
364  }
365 
366  /* else, pass to constitutive law */
367  ConstitutiveLaw3DOwner::SetValue(pDM, X, XP, ph);
368  }
369  }
370 }
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: vehj.h:48
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Mat3x3 tilde_R1h
Definition: vehj.h:50
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
Definition: simentity.cc:63
Mat3x3 tilde_R2h
Definition: vehj.h:51
const StructNode * pNode2
Definition: vehj.h:49

Here is the call graph for this function:

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

Implements Elem.

Definition at line 144 of file vehj.h.

144  {
145  *piNumRows = 6;
146  *piNumCols = 6;
147  };

Member Data Documentation

OrientationDescription DeformableHingeJoint::od
protected

Definition at line 53 of file vehj.h.

Referenced by Output(), OutputInv(), and OutputPrepare().


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