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

#include <planej.h>

Inheritance diagram for AxialRotationJoint:
Collaboration diagram for AxialRotationJoint:

Public Member Functions

 AxialRotationJoint (unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &dTmp1, const Vec3 &dTmp2, const Mat3x3 &R1hTmp, const Mat3x3 &R2hTmp, const DriveCaller *pDC, const OrientationDescription &od, flag fOut, const doublereal rr=0., const doublereal pref=0., BasicShapeCoefficient *const sh=0, BasicFriction *const f=0)
 
 ~AxialRotationJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
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)
 
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 OutputPrepare (OutputHandler &OH)
 
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 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 void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void 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)
 
- Public Member Functions inherited from DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 

Protected Attributes

OrientationDescription od
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 

Private Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Vec3 d1
 
Mat3x3 R1h
 
Vec3 d2
 
Mat3x3 R2h
 
Vec3 F
 
Vec3 M
 
int NTheta
 
doublereal dTheta
 
doublereal dThetaWrapped
 
BasicShapeCoefficient *const Sh_c
 
BasicFriction *const fc
 
const doublereal preF
 
const doublereal r
 
doublereal M3
 

Static Private Attributes

static const unsigned int NumSelfDof
 
static const unsigned int NumDof
 

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
 

Detailed Description

Definition at line 344 of file planej.h.

Constructor & Destructor Documentation

AxialRotationJoint::AxialRotationJoint ( unsigned int  uL,
const DofOwner pDO,
const StructNode pN1,
const StructNode pN2,
const Vec3 dTmp1,
const Vec3 dTmp2,
const Mat3x3 R1hTmp,
const Mat3x3 R2hTmp,
const DriveCaller pDC,
const OrientationDescription od,
flag  fOut,
const doublereal  rr = 0.,
const doublereal  pref = 0.,
BasicShapeCoefficient *const  sh = 0,
BasicFriction *const  f = 0 
)

Definition at line 2521 of file planej.cc.

References NO_OP.

2534 : Elem(uL, fOut),
2535 Joint(uL, pDO, fOut),
2536 DriveOwner(pDC),
2537 pNode1(pN1), pNode2(pN2),
2538 d1(dTmp1), R1h(R1hTmp), d2(dTmp2), R2h(R2hTmp), F(Zero3), M(Zero3),
2539 NTheta(0), dTheta(0.), dThetaWrapped(0.),
2540 #ifdef USE_NETCDF
2541 Var_Phi(0),
2542 Var_Omega(0),
2543 //Var_MFR(0),
2544 //Var_MU(0),
2545 #endif // USE_NETCDF
2546 Sh_c(sh), fc(f), preF(pref), r(rr),
2547 od(od)
2548 {
2549  NO_OP;
2550 }
const StructNode * pNode2
Definition: planej.h:358
const Vec3 Zero3(0., 0., 0.)
doublereal dTheta
Definition: planej.h:366
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
doublereal dThetaWrapped
Definition: planej.h:366
BasicFriction *const fc
Definition: planej.h:377
#define NO_OP
Definition: myassert.h:74
const doublereal preF
Definition: planej.h:378
const doublereal r
Definition: planej.h:379
BasicShapeCoefficient *const Sh_c
Definition: planej.h:376
OrientationDescription od
Definition: planej.h:386
const StructNode * pNode1
Definition: planej.h:357
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
AxialRotationJoint::~AxialRotationJoint ( void  )

Definition at line 2554 of file planej.cc.

References fc, and Sh_c.

2555 {
2556  if (Sh_c) {
2557  delete Sh_c;
2558  }
2559 
2560  if (fc) {
2561  delete fc;
2562  }
2563 }
BasicFriction *const fc
Definition: planej.h:377
BasicShapeCoefficient *const Sh_c
Definition: planej.h:376

Member Function Documentation

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

Reimplemented from SimulationEntity.

Definition at line 2952 of file planej.cc.

References BasicFriction::AfterConvergence(), grad::Dot(), dTheta, dThetaWrapped, F, fc, StructNode::GetRCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), M_PI, Vec3::Norm(), NTheta, NumSelfDof, pNode1, pNode2, preF, r, R1h, R2h, and RotManip::VecRot().

2954 {
2956  doublereal dThetaTmp(v(3));
2957 
2958  // unwrap
2959  if (dThetaTmp - dThetaWrapped < -M_PI) {
2960  NTheta++;
2961  }
2962 
2963  if (dThetaTmp - dThetaWrapped > M_PI) {
2964  NTheta--;
2965  }
2966 
2967  // save new wrapped angle
2968  dThetaWrapped = dThetaTmp;
2969 
2970  // compute new unwrapped angle
2972 
2973  if (fc) {
2974  const Mat3x3& R1(pNode1->GetRCurr());
2975  Mat3x3 R1hTmp(R1*R1h);
2976  Vec3 e3a(R1hTmp.GetVec(3));
2977  const Vec3& Omega1(pNode1->GetWCurr());
2978  const Vec3& Omega2(pNode2->GetWCurr());
2979  //relative velocity
2980  doublereal v = (Omega1-Omega2).Dot(e3a)*r;
2981  //reaction norm
2982  doublereal modF = std::max(F.Norm(), preF);;
2983  fc->AfterConvergence(modF,v,X,XP,iGetFirstIndex()+NumSelfDof);
2984  }
2985 }
const StructNode * pNode2
Definition: planej.h:358
#define M_PI
Definition: gradienttest.cc:67
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Norm(void) const
Definition: matvec3.h:263
doublereal dTheta
Definition: planej.h:366
doublereal dThetaWrapped
Definition: planej.h:366
BasicFriction *const fc
Definition: planej.h:377
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
const doublereal preF
Definition: planej.h:378
virtual void AfterConvergence(const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP, const unsigned int solution_startdof)
Definition: friction.h:96
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
const doublereal r
Definition: planej.h:379
static const unsigned int NumSelfDof
Definition: planej.h:381
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

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

Implements Elem.

Definition at line 3007 of file planej.cc.

References ExpandableRowVector::Add(), FullSubMatrixHandler::Add(), BasicFriction::AssJac(), Vec3::Cross(), d1, d2, DEBUGCOUT, Vec3::dGet(), grad::Dot(), BasicShapeCoefficient::dSh_c(), F, BasicFriction::fc(), fc, StructNode::GetRRef(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), iGetNumDof(), ExpandableRowVector::Link(), M, MatCross, MatCrossCross, Vec3::Norm(), NumSelfDof, pNode1, pNode2, preF, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), r, R1h, R2h, ExpandableRowVector::ReDim(), FullSubMatrixHandler::ResizeReset(), ExpandableRowVector::Set(), VariableSubMatrixHandler::SetFull(), BasicShapeCoefficient::Sh_c(), Sh_c, ExpandableRowVector::Sub(), FullSubMatrixHandler::Sub(), and WorkSpaceDim().

3011 {
3012  DEBUGCOUT("Entering AxialRotationJoint::AssJac()" << std::endl);
3013 
3014  /* Setta la sottomatrice come piena (e' un po' dispersivo, ma lo jacobiano
3015  * e' complicato */
3016  FullSubMatrixHandler& WM = WorkMat.SetFull();
3017 
3018  /* Ridimensiona la sottomatrice in base alle esigenze */
3019  integer iNumRows = 0;
3020  integer iNumCols = 0;
3021  WorkSpaceDim(&iNumRows, &iNumCols);
3022  WM.ResizeReset(iNumRows, iNumCols);
3023 
3024  /* Recupera gli indici delle varie incognite */
3025  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
3026  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
3027  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
3028  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
3029  integer iFirstReactionIndex = iGetFirstIndex();
3030 
3031  /* Recupera i dati che servono */
3032  const Mat3x3& R1(pNode1->GetRRef());
3033  const Mat3x3& R2(pNode2->GetRRef());
3034  const Vec3& Omega2(pNode2->GetWRef()); /* Serve dopo */
3035  Vec3 d1Tmp(R1*d1);
3036  Vec3 d2Tmp(R2*d2);
3037  Mat3x3 R1hTmp(R1*R1h);
3038  Mat3x3 R2hTmp(R2*R2h);
3039  /* Suppongo che le reazioni F, M siano gia' state aggiornate da AssRes;
3040  * ricordo che la forza F e' nel sistema globale, mentre la coppia M
3041  * e' nel sistema locale ed il terzo termine, M(3), e' nullo in quanto
3042  * diretto come l'asse attorno al quale la rotazione e' consentita */
3043 
3044 
3045  /*
3046  * La cerniera piana ha le prime 3 equazioni uguali alla cerniera sferica;
3047  * inoltre ha due equazioni che affermano la coincidenza dell'asse 3 del
3048  * riferimento solidale con la cerniera visto dai due nodi.
3049  *
3050  * (R1 * R1h * e1)^T * (R2 * R2h * e3) = 0
3051  * (R1 * R1h * e2)^T * (R2 * R2h * e3) = 0
3052  *
3053  * A queste equazioni corrisponde una reazione di coppia agente attorno
3054  * agli assi 1 e 2 del riferimento della cerniera. La coppia attorno
3055  * all'asse 3 e' nulla per definizione. Quindi la coppia nel sistema
3056  * globale e':
3057  * -R1 * R1h * M per il nodo 1,
3058  * R2 * R2h * M per il nodo 2
3059  *
3060  *
3061  * xa ga xb gb F M
3062  * Qa | 0 0 0 0 I 0 | | xa | | -F |
3063  * Ga | 0 c*(F/\da/\-(Sa*M)/\) 0 0 da/\ Sa | | ga | | -da/\F-Sa*M |
3064  * Qb | 0 0 0 0 -I 0 | | xb | = | F |
3065  * Gb | 0 0 0 -c*(F/\db/\-(Sb*M)/\) -db/\ -Sb | | gb | | db/\F+Sb*M |
3066  * F | -c*I c*da/\ c*I -c*db/\ 0 0 | | F | | xa+da-xb-db |
3067  * M1 | 0 c*Tb1^T*Ta3/\ 0 c*Ta3^T*Tb1/\ 0 0 | | M | | Sb^T*Ta3 |
3068  * M2 | 0 c*Tb2^T*Ta3/\ 0 c*Ta3^T*Tb2/\ 0 0 |
3069  *
3070  * con da = R1*d01, db = R2*d02, c = dCoef,
3071  * Sa = R1*R1h*[e1,e2], Sb = R2*R2h*[e1, e2],
3072  * Ta3 = R1*R1h*e3, Tb1 = R2*R2h*e1, Tb2 = R2*R2h*e2
3073  */
3074 
3075  /* Setta gli indici delle equazioni */
3076  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3077  WM.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
3078  WM.PutColIndex(iCnt, iNode1FirstPosIndex+iCnt);
3079  WM.PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
3080  WM.PutColIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
3081  }
3082 
3083  for (unsigned int iCnt = 1; iCnt <= iGetNumDof(); iCnt++) {
3084  WM.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
3085  WM.PutColIndex(12+iCnt, iFirstReactionIndex+iCnt);
3086  }
3087 
3088  /* Contributo della forza alle equazioni di equilibrio dei due nodi */
3089  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3090  WM.PutCoef(iCnt, 12+iCnt, 1.);
3091  WM.PutCoef(6+iCnt, 12+iCnt, -1.);
3092  }
3093 
3094  WM.Add(4, 13, Mat3x3(MatCross, d1Tmp));
3095  WM.Sub(10, 13, Mat3x3(MatCross, d2Tmp));
3096 
3097  /* Moltiplica la forza ed il momento per il coefficiente
3098  * del metodo */
3099  Vec3 FTmp = F*dCoef;
3100  Vec3 MTmp = M*dCoef;
3101 
3102  Vec3 e3a(R1hTmp.GetVec(3));
3103  Vec3 e1b(R2hTmp.GetVec(1));
3104  Vec3 e2b(R2hTmp.GetVec(2));
3105  MTmp = e2b*MTmp.dGet(1) - e1b*MTmp.dGet(2);
3106 
3107  Mat3x3 MWedgee3aWedge(MatCrossCross, MTmp, e3a);
3108  Mat3x3 e3aWedgeMWedge(MatCrossCross, e3a, MTmp);
3109 
3110  WM.Add(4, 4, Mat3x3(MatCrossCross, FTmp, d1Tmp) - MWedgee3aWedge - Mat3x3(MatCross, e3a*M(3)));
3111  WM.Add(4, 10, e3aWedgeMWedge);
3112 
3113  WM.Add(10, 4, MWedgee3aWedge);
3114  WM.Sub(10, 10, Mat3x3(MatCrossCross, FTmp, d2Tmp) + e3aWedgeMWedge
3115  - Mat3x3(MatCross, e3a*M(3)));
3116 
3117  /* Contributo del momento alle equazioni di equilibrio dei nodi */
3118  Vec3 Tmp1(e2b.Cross(e3a));
3119  Vec3 Tmp2(e3a.Cross(e1b));
3120 
3121  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3122  doublereal d = Tmp1(iCnt);
3123  WM.PutCoef(3+iCnt, 16, d);
3124  WM.PutCoef(9+iCnt, 16, -d);
3125 
3126  d = Tmp2(iCnt);
3127  WM.PutCoef(3+iCnt, 17, d);
3128  WM.PutCoef(9+iCnt, 17, -d);
3129 
3130  d = e3a(iCnt);
3131  WM.PutCoef(3+iCnt, 18, d);
3132  WM.PutCoef(9+iCnt, 18, -d);
3133  }
3134 
3135  /* Modifica: divido le equazioni di vincolo per dCoef */
3136 
3137  /* Equazioni di vincolo degli spostamenti */
3138  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3139  WM.PutCoef(12+iCnt, iCnt, -1.);
3140  WM.PutCoef(12+iCnt, 6+iCnt, 1.);
3141  }
3142 
3143  WM.Add(13, 4, Mat3x3(MatCross, d1Tmp));
3144  WM.Sub(13, 10, Mat3x3(MatCross, d2Tmp));
3145 
3146  /* Equazione di vincolo del momento
3147  *
3148  * Attenzione: bisogna scrivere il vettore trasposto
3149  * (Sb[1]^T*(Sa[3]/\))*dCoef
3150  * Questo pero' e' uguale a:
3151  * (-Sa[3]/\*Sb[1])^T*dCoef,
3152  * che puo' essere ulteriormente semplificato:
3153  * (Sa[3].Cross(Sb[1])*(-dCoef))^T;
3154  */
3155 
3156  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3157  doublereal d = Tmp1(iCnt);
3158  WM.PutCoef(16, 3+iCnt, d);
3159  WM.PutCoef(16, 9+iCnt, -d);
3160 
3161  d = Tmp2.dGet(iCnt);
3162  WM.PutCoef(17, 3+iCnt, -d);
3163  WM.PutCoef(17, 9+iCnt, d);
3164  }
3165 
3166  /* Questa equazione non viene divisa per dCoef */
3167 
3168  /* Equazione di imposizione della velocita' di rotazione:
3169  * (e3a+c(wb/\e3a))^T*(Delta_gPb-Delta_gPa) */
3170  Vec3 Tmp = e3a + Omega2.Cross(e3a*dCoef);
3171  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3172  doublereal d = Tmp(iCnt);
3173  WM.PutCoef(18, 3+iCnt, -d);
3174  WM.PutCoef(18, 9+iCnt, d);
3175  }
3176 
3177  if (fc) {
3178  //retrive
3179  //friction coef
3180  doublereal f = fc->fc();
3181  //shape function
3182  doublereal shc = Sh_c->Sh_c();
3183  //omega and omega rif
3184  const Vec3& Omega1(pNode1->GetWCurr());
3185  const Vec3& Omega2(pNode2->GetWCurr());
3186  // const Vec3& Omega1r(pNode1->GetWRef());
3187  // const Vec3& Omega2r(pNode2->GetWRef());
3188  //compute
3189  //relative velocity
3190  doublereal v = (Omega1-Omega2).Dot(e3a)*r;
3191  //reaction norm
3192  doublereal modF = std::max(F.Norm(), preF);
3193  //reaction moment
3194  //doublereal M3 = shc*modF*f*r;
3195 
3196  ExpandableRowVector dfc;
3199  //variation of reaction force
3200  dF.ReDim(3);
3201  if ((modF == 0.) or (F.Norm() > preF)) {
3202  dF.Set(0.,1,12+1);
3203  dF.Set(0.,2,12+2);
3204  dF.Set(0.,3,12+3);
3205  } else {
3206  dF.Set(F.dGet(1)/modF,1,12+1);
3207  dF.Set(F.dGet(2)/modF,2,12+2);
3208  dF.Set(F.dGet(3)/modF,3,12+3);
3209  }
3210  //variation of relative velocity
3211  dv.ReDim(6);
3212 
3213 /* (approximate: assume constant triads orientations)
3214  * relative velocity linearization
3215 */
3216  dv.Set(e3a*r,1, 0+4);
3217  dv.Set(-e3a*r,4, 6+4);
3218 
3219  //assemble friction states
3220  fc->AssJac(WM,dfc,12+NumSelfDof,iFirstReactionIndex+NumSelfDof,dCoef,modF,v,
3221  XCurr,XPrimeCurr,dF,dv);
3222  ExpandableRowVector dM3;
3223  ExpandableRowVector dShc;
3224  //compute
3225  //variation of shape function
3226  Sh_c->dSh_c(dShc,f,modF,v,dfc,dF,dv);
3227  //variation of moment component
3228  dM3.ReDim(2);
3229  dM3.Set(shc * r,1); dM3.Link(1,&dF);
3230  dM3.Set(modF * r,2); dM3.Link(2,&dShc);
3231  //assemble first node
3232  //variation of moment component
3233  dM3.Add(WM,0+4,e3a.dGet(1));
3234  dM3.Add(WM,0+5,e3a.dGet(2));
3235  dM3.Add(WM,0+6,e3a.dGet(3));
3236  //assemble second node
3237  //variation of moment component
3238  dM3.Sub(WM,6+4,e3a.dGet(1));
3239  dM3.Sub(WM,6+5,e3a.dGet(2));
3240  dM3.Sub(WM,6+6,e3a.dGet(3));
3241  }
3242 
3243  return WorkMat;
3244 }
const StructNode * pNode2
Definition: planej.h:358
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
void Set(doublereal xx, integer i, integer iidx)
Definition: JacSubMatrix.cc:95
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
doublereal Norm(void) const
Definition: matvec3.h:263
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void Add(doublereal xx, integer i)
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual doublereal Sh_c(void) const =0
BasicFriction *const fc
Definition: planej.h:377
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: planej.h:454
virtual doublereal fc(void) const =0
const doublereal preF
Definition: planej.h:378
void ReDim(const integer n)
Definition: JacSubMatrix.cc:50
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
virtual void dSh_c(ExpandableRowVector &dShc, const doublereal f, const doublereal F, const doublereal v, const ExpandableRowVector &dfc, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const =0
const doublereal r
Definition: planej.h:379
void Link(const integer i, const ExpandableRowVector *const xp, const integer rhs_block=1)
Definition: JacSubMatrix.cc:68
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
virtual unsigned int iGetNumDof(void) const
Definition: planej.h:413
virtual void AssJac(FullSubMatrixHandler &WorkMat, ExpandableRowVector &dfc, const unsigned int startdof, const unsigned int solution_startdof, const doublereal dCoef, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP, const ExpandableRowVector &dF, const ExpandableRowVector &dv) const =0
BasicShapeCoefficient *const Sh_c
Definition: planej.h:376
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
static const unsigned int NumSelfDof
Definition: planej.h:381
void Sub(doublereal xx, integer i)
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

!!!!!!!!!!!!!

Implements Elem.

Definition at line 3248 of file planej.cc.

References VectorHandler::Add(), ASSERT, BasicFriction::AssRes(), Vec3::Cross(), d1, d2, DEBUGCOUT, Vec3::dGet(), DriveCaller::dGet(), Vec3::Dot(), grad::Dot(), F, BasicFriction::fc(), fc, StructNode::GetRCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), iGetNumDof(), M, M3, MBDYN_EXCEPT_ARGS, Vec3::Norm(), NumSelfDof, DriveOwner::pGetDriveCaller(), pNode1, pNode2, preF, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), r, R1h, R2h, VectorHandler::ResizeReset(), BasicShapeCoefficient::Sh_c(), Sh_c, VectorHandler::Sub(), and WorkSpaceDim().

3252 {
3253  DEBUGCOUT("Entering AxialRotationJoint::AssRes()" << std::endl);
3254 
3255  /* Dimensiona e resetta la matrice di lavoro */
3256  integer iNumRows = 0;
3257  integer iNumCols = 0;
3258  WorkSpaceDim(&iNumRows, &iNumCols);
3259  WorkVec.ResizeReset(iNumRows);
3260 
3261  /* Indici */
3262  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
3263  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
3264  integer iFirstReactionIndex = iGetFirstIndex();
3265 
3266  /* Indici dei nodi */
3267  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3268  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
3269  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
3270  }
3271  /* Indici del vincolo */
3272  for (unsigned int iCnt = 1; iCnt <= iGetNumDof(); iCnt++) {
3273  WorkVec.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
3274  }
3275 
3276  /* Aggiorna i dati propri */
3277  F = Vec3(XCurr, iFirstReactionIndex+1);
3278  M = Vec3(XCurr, iFirstReactionIndex+4);
3279 
3280  /* Recupera i dati */
3281  const Vec3& x1(pNode1->GetXCurr());
3282  const Vec3& x2(pNode2->GetXCurr());
3283  const Mat3x3& R1(pNode1->GetRCurr());
3284  const Mat3x3& R2(pNode2->GetRCurr());
3285 
3286  /* Costruisce i dati propri nella configurazione corrente */
3287  Vec3 dTmp1(R1*d1);
3288  Vec3 dTmp2(R2*d2);
3289  Mat3x3 R1hTmp(R1*R1h);
3290  Mat3x3 R2hTmp(R2*R2h);
3291 
3292  Vec3 e3a(R1hTmp.GetVec(3));
3293  Vec3 e1b(R2hTmp.GetVec(1));
3294  Vec3 e2b(R2hTmp.GetVec(2));
3295 
3296  Vec3 MTmp(e2b.Cross(e3a)*M.dGet(1)+e3a.Cross(e1b)*M.dGet(2));
3297 
3298  /* Equazioni di equilibrio, nodo 1 */
3299  WorkVec.Sub(1, F);
3300  WorkVec.Add(4, F.Cross(dTmp1)-MTmp-e3a*M.dGet(3)); /* Sfrutto F/\d = -d/\F */
3301 
3302  /* Equazioni di equilibrio, nodo 2 */
3303  WorkVec.Add(7, F);
3304  WorkVec.Add(10, dTmp2.Cross(F)+MTmp+e3a*M.dGet(3));
3305 
3306  /* Modifica: divido le equazioni di vincolo per dCoef */
3307  ASSERT(dCoef != 0.);
3308 
3309  /* Equazione di vincolo di posizione */
3310  WorkVec.Add(13, (x1+dTmp1-x2-dTmp2)/dCoef);
3311 
3312  /* Equazioni di vincolo di rotazione */
3313  Vec3 Tmp = Vec3(R1hTmp.GetVec(3));
3314  WorkVec.PutCoef(16, Tmp.Dot(R2hTmp.GetVec(2))/dCoef);
3315  WorkVec.PutCoef(17, Tmp.Dot(R2hTmp.GetVec(1))/dCoef);
3316 
3317  /* Questa equazione non viene divisa per dCoef */
3318 
3319  /* Equazione di vincolo di velocita' di rotazione */
3320  const Vec3& Omega1(pNode1->GetWCurr());
3321  const Vec3& Omega2(pNode2->GetWCurr());
3322  doublereal dOmega0 = pGetDriveCaller()->dGet();
3323  WorkVec.PutCoef(18, dOmega0-e3a.Dot(Omega2-Omega1));
3324 
3325  if (fc) {
3326  bool ChangeJac(false);
3327  doublereal v = (Omega1-Omega2).Dot(e3a)*r;
3328  doublereal modF = std::max(F.Norm(), preF);
3329  try {
3330  fc->AssRes(WorkVec,12+NumSelfDof,iFirstReactionIndex+NumSelfDof,modF,v,XCurr,XPrimeCurr);
3331  }
3333  ChangeJac = true;
3334  }
3335  doublereal f = fc->fc();
3336  doublereal shc = Sh_c->Sh_c(f,modF,v);
3337  M3 = shc*modF*r;
3338  WorkVec.Sub(4,e3a*M3);
3339  WorkVec.Add(10,e3a*M3);
3341 // M += e3a*M3;
3342  if (ChangeJac) {
3344  }
3345  }
3346 
3347  return WorkVec;
3348 }
const StructNode * pNode2
Definition: planej.h:358
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual void AssRes(SubVectorHandler &WorkVec, const unsigned int startdof, const unsigned int solution_startdof, const doublereal F, const doublereal v, const VectorHandler &X, const VectorHandler &XP)=0
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Norm(void) const
Definition: matvec3.h:263
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual doublereal Sh_c(void) const =0
BasicFriction *const fc
Definition: planej.h:377
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: planej.h:454
virtual doublereal fc(void) const =0
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const doublereal preF
Definition: planej.h:378
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal r
Definition: planej.h:379
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
doublereal M3
Definition: planej.h:380
virtual doublereal dGet(const doublereal &dVar) const =0
virtual unsigned int iGetNumDof(void) const
Definition: planej.h:413
BasicShapeCoefficient *const Sh_c
Definition: planej.h:376
static const unsigned int NumSelfDof
Definition: planej.h:381
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 2567 of file planej.cc.

References SimulationEntity::DescribeDof(), fc, DofOwnerOwner::iGetFirstIndex(), SimulationEntity::iGetNumDof(), and NumSelfDof.

2568 {
2569  integer iIndex = iGetFirstIndex();
2570 
2571  out
2572  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
2573  "reaction forces [Fx,Fy,Fz]" << std::endl
2574  << prefix << iIndex + 4 << "->" << iIndex + 6 << ": "
2575  "reaction couples [mx,my,mz]" << std::endl;
2576 
2577  if (bInitial) {
2578  iIndex += NumSelfDof;
2579  out
2580  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
2581  "reaction force derivatives [FPx,FPy,FPz]" << std::endl
2582  << prefix << iIndex + 4 << "->" << iIndex + 5 << ": "
2583  "reaction couple derivatives [mPx,mPy]" << std::endl;
2584  }
2585 
2586  iIndex += NumSelfDof;
2587  if (fc) {
2588  integer iFCDofs = fc->iGetNumDof();
2589  if (iFCDofs > 0) {
2590  out << prefix << iIndex + 1;
2591  if (iFCDofs > 1) {
2592  out << "->" << iIndex + iFCDofs;
2593  }
2594  out << ": friction dof(s)" << std::endl
2595  << " ", fc->DescribeDof(out, prefix, bInitial);
2596  }
2597  }
2598 
2599  return out;
2600 }
BasicFriction *const fc
Definition: planej.h:377
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const =0
virtual unsigned int iGetNumDof(void) const =0
static const unsigned int NumSelfDof
Definition: planej.h:381
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 AxialRotationJoint::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 2603 of file planej.cc.

References SimulationEntity::DescribeDof(), fc, WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, NumSelfDof, and xyz.

2604 {
2605  std::ostringstream os;
2606  os << "AxialRotationJoint(" << GetLabel() << ")";
2607 
2608  unsigned short nself = NumSelfDof;
2609  if (bInitial) {
2610  nself += NumSelfDof - 1;
2611  }
2612  if (fc && (i == -1 || i >= nself)) {
2613  fc->DescribeDof(desc, bInitial, i - nself);
2614  if (i != -1) {
2615  desc[0] = os.str() + ": " + desc[0];
2616  return;
2617  }
2618  }
2619 
2620  if (i == -1) {
2621  // move fc desc to the end
2622  unsigned short nfc = 0;
2623  if (fc) {
2624  nfc = desc.size();
2625  }
2626  desc.resize(nfc + nself);
2627  for (unsigned i = nfc; i-- > 0; ) {
2628  desc[nself + i] = os.str() + ": " + desc[nfc];
2629  }
2630 
2631  std::string name = os.str();
2632 
2633  for (unsigned i = 0; i < 3; i++) {
2634  os.str(name);
2635  os.seekp(0, std::ios_base::end);
2636  os << ": reaction force f" << xyz[i];
2637  desc[i] = os.str();
2638  }
2639 
2640  for (unsigned i = 0; i < 3; i++) {
2641  os.str(name);
2642  os.seekp(0, std::ios_base::end);
2643  os << ": reaction couple m" << xyz[i];
2644  desc[3 + i] = os.str();
2645  }
2646 
2647  if (bInitial) {
2648  for (unsigned i = 0; i < 3; i++) {
2649  os.str(name);
2650  os.seekp(0, std::ios_base::end);
2651  os << ": reaction force derivative fP" << xyz[i];
2652  desc[6 + i] = os.str();
2653  }
2654 
2655  for (unsigned i = 0; i < 2; i++) {
2656  os.str(name);
2657  os.seekp(0, std::ios_base::end);
2658  os << ": reaction couple derivative mP" << xyz[i];
2659  desc[9 + i] = os.str();
2660  }
2661  }
2662 
2663  } else {
2664  if (i < -1) {
2665  // error
2667  }
2668 
2669  if (i >= nself) {
2670  // error
2672  }
2673 
2674  desc.resize(1);
2675 
2676  switch (i) {
2677  case 0:
2678  case 1:
2679  case 2:
2680  os << ": reaction force f" << xyz[i];
2681  break;
2682 
2683  case 3:
2684  case 4:
2685  case 5:
2686  os << ": reaction couple m" << xyz[i - 3];
2687  break;
2688 
2689  case 6:
2690  case 7:
2691  case 8:
2692  os << ": reaction force derivative fP" << xyz[i - 6];
2693  break;
2694 
2695  case 9:
2696  case 10:
2697  os << ": reaction couple derivative mP" << xyz[i - 9];
2698  break;
2699  }
2700  desc[0] = os.str();
2701  }
2702 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
BasicFriction *const fc
Definition: planej.h:377
static const char xyz[]
Definition: planej.cc:133
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const =0
static const unsigned int NumSelfDof
Definition: planej.h:381
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 2705 of file planej.cc.

References SimulationEntity::DescribeEq(), fc, DofOwnerOwner::iGetFirstIndex(), SimulationEntity::iGetNumDof(), and NumSelfDof.

2706 {
2707  integer iIndex = iGetFirstIndex();
2708 
2709  out
2710  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
2711  "position constraints [Px1=Px2,Py1=Py2,Pz1=Pz2]" << std::endl
2712  << prefix << iIndex + 4 << "->" << iIndex + 5 << ": "
2713  "orientation constraints [gx1=gx2,gy1=gy2]" << std::endl
2714  << prefix << iIndex + 6 << ": "
2715  "angular velocity constraint wz2-wz1=Omega]" << std::endl;
2716 
2717  if (bInitial) {
2718  iIndex += NumSelfDof;
2719  out
2720  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
2721  "velocity constraints [vx1=vx2,vy1=vy2,vz1=vz2]" << std::endl
2722  << prefix << iIndex + 4 << "->" << iIndex + 5 << ": "
2723  "reaction couple derivatives [wx1=wx2,wy1=wy2]" << std::endl;
2724  }
2725 
2726  iIndex += NumSelfDof;
2727  if (fc) {
2728  integer iFCDofs = fc->iGetNumDof();
2729  if (iFCDofs > 0) {
2730  out << prefix << iIndex + 1;
2731  if (iFCDofs > 1) {
2732  out << "->" << iIndex + iFCDofs;
2733  }
2734  out << ": friction equation(s)" << std::endl
2735  << " ", fc->DescribeEq(out, prefix, bInitial);
2736  }
2737  }
2738 
2739  return out;
2740 }
BasicFriction *const fc
Definition: planej.h:377
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const =0
virtual unsigned int iGetNumDof(void) const =0
static const unsigned int NumSelfDof
Definition: planej.h:381
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 AxialRotationJoint::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 2743 of file planej.cc.

References SimulationEntity::DescribeEq(), fc, WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, NumSelfDof, and xyz.

2744 {
2745  std::ostringstream os;
2746  os << "AxialRotationJoint(" << GetLabel() << ")";
2747 
2748  unsigned short nself = NumSelfDof;
2749  if (bInitial) {
2750  nself += NumSelfDof - 1;
2751  }
2752  if (fc && (i == -1 || i >= nself)) {
2753  fc->DescribeEq(desc, bInitial, i - nself);
2754  if (i != -1) {
2755  desc[0] = os.str() + ": " + desc[0];
2756  return;
2757  }
2758  }
2759 
2760  if (i == -1) {
2761  // move fc desc to the end
2762  unsigned short nfc = 0;
2763  if (fc) {
2764  nfc = desc.size();
2765  }
2766  desc.resize(nfc + nself);
2767  for (unsigned i = nfc; i-- > 0; ) {
2768  desc[nself + i] = os.str() + ": " + desc[nfc];
2769  }
2770 
2771  std::string name = os.str();
2772 
2773  for (unsigned i = 0; i < 3; i++) {
2774  os.str(name);
2775  os.seekp(0, std::ios_base::end);
2776  os << ": position constraint P" << xyz[i];
2777  desc[i] = os.str();
2778  }
2779 
2780  for (unsigned i = 0; i < 2; i++) {
2781  os.str(name);
2782  os.seekp(0, std::ios_base::end);
2783  os << ": orientation constraint g" << xyz[i];
2784  desc[3 + i] = os.str();
2785  }
2786 
2787  os.str(name);
2788  os.seekp(0, std::ios_base::end);
2789  os << ": angular velocity constraint wz";
2790  desc[5] = os.str();
2791 
2792  if (bInitial) {
2793  for (unsigned i = 0; i < 3; i++) {
2794  os.str(name);
2795  os.seekp(0, std::ios_base::end);
2796  os << ": position constraint derivative v" << xyz[i];
2797  desc[6 + i] = os.str();
2798  }
2799 
2800  for (unsigned i = 0; i < 2; i++) {
2801  os.str(name);
2802  os.seekp(0, std::ios_base::end);
2803  os << ": orientation constraint derivative w" << xyz[i];
2804  desc[9 + i] = os.str();
2805  }
2806  }
2807 
2808  } else {
2809  if (i < -1) {
2810  // error
2812  }
2813 
2814  if (i >= nself) {
2815  // error
2817  }
2818 
2819  desc.resize(1);
2820 
2821  switch (i) {
2822  case 0:
2823  case 1:
2824  case 2:
2825  os << ": position constraint P" << xyz[i];
2826  break;
2827 
2828  case 3:
2829  case 4:
2830  os << ": orientation constraint g" << xyz[i - 3];
2831  break;
2832 
2833  case 5:
2834  os << ": angular velocity constraint wz";
2835  break;
2836 
2837  case 6:
2838  case 7:
2839  case 8:
2840  os << ": position constraint derivative v" << xyz[i - 6];
2841  break;
2842 
2843  case 9:
2844  case 10:
2845  os << ": orientation constraint derivative w" << xyz[i - 9];
2846  break;
2847  }
2848  desc[0] = os.str();
2849  }
2850 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
BasicFriction *const fc
Definition: planej.h:377
static const char xyz[]
Definition: planej.cc:133
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const =0
static const unsigned int NumSelfDof
Definition: planej.h:381
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 3930 of file planej.cc.

References ASSERT, DriveOwner::dGet(), dThetaWrapped, F, WithLabel::GetLabel(), StructNode::GetRCurr(), iGetNumPrivData(), M, M_PI, MBDYN_EXCEPT_ARGS, NTheta, pNode1, pNode2, R1h, R2h, and RotManip::VecRot().

3931 {
3932  ASSERT(i >= 1 && i <= iGetNumPrivData());
3933 
3934  switch (i) {
3935  case 1: {
3937  doublereal dThetaTmp(v(3));
3938 
3939  int n = 0;
3940 
3941  if (dThetaTmp - dThetaWrapped < -M_PI) {
3942  n++;
3943  }
3944 
3945  if (dThetaTmp - dThetaWrapped > M_PI) {
3946  n--;
3947  }
3948 
3949  return 2*M_PI*(NTheta + n) + dThetaTmp;
3950  }
3951 
3952  case 2:
3953  return dGet();
3954 
3955  case 3:
3956  case 4:
3957  case 5:
3958  return F(i - 2);
3959 
3960  case 6:
3961  case 7:
3962  case 8:
3963  return M(i - 5);
3964  }
3965 
3966  silent_cerr("AxialRotationJoint(" << GetLabel() << "): "
3967  "illegal private data " << i << std::endl);
3969 }
const StructNode * pNode2
Definition: planej.h:358
#define M_PI
Definition: gradienttest.cc:67
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal dGet(void) const
Definition: drive.cc:671
doublereal dThetaWrapped
Definition: planej.h:366
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual unsigned int iGetNumPrivData(void) const
Definition: planej.cc:3887
#define ASSERT(expression)
Definition: colamd.c:977
const StructNode * pNode1
Definition: planej.h:357
double doublereal
Definition: colamd.c:52
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 506 of file planej.h.

References pNode1, and pNode2.

506  {
507  connectedNodes.resize(2);
508  connectedNodes[0] = pNode1;
509  connectedNodes[1] = pNode2;
510  };
const StructNode * pNode2
Definition: planej.h:358
const StructNode * pNode1
Definition: planej.h:357
DofOrder::Order AxialRotationJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 435 of file planej.h.

References DofOrder::ALGEBRAIC, ASSERT, fc, SimulationEntity::GetDofType(), iGetNumDof(), and NumSelfDof.

435  {
436  ASSERT(i >= 0 && i < iGetNumDof());
437  if (i<NumSelfDof) {
438  return DofOrder::ALGEBRAIC;
439  } else {
440  return fc->GetDofType(i-NumSelfDof);
441  }
442  };
BasicFriction *const fc
Definition: planej.h:377
virtual DofOrder::Order GetDofType(unsigned int i) const =0
#define ASSERT(expression)
Definition: colamd.c:977
virtual unsigned int iGetNumDof(void) const
Definition: planej.h:413
static const unsigned int NumSelfDof
Definition: planej.h:381

Here is the call graph for this function:

DofOrder::Order AxialRotationJoint::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 3351 of file planej.cc.

References DofOrder::ALGEBRAIC, ASSERTMSGBREAK, DofOrder::DIFFERENTIAL, fc, SimulationEntity::GetEqType(), iGetNumDof(), and NumSelfDof.

3352 {
3353  ASSERTMSGBREAK(i < iGetNumDof(),
3354  "INDEX ERROR in AxialRotationJoint::GetEqType");
3355  if (i == 5) {
3356  return DofOrder::DIFFERENTIAL;
3357  } else if (i < NumSelfDof) {
3358  return DofOrder::ALGEBRAIC;
3359  } else {
3360  return fc->GetEqType(i-NumSelfDof);
3361  }
3362 }
virtual DofOrder::Order GetEqType(unsigned int i) const
Definition: simentity.h:138
#define ASSERTMSGBREAK(expr, msg)
Definition: myassert.h:222
BasicFriction *const fc
Definition: planej.h:377
virtual unsigned int iGetNumDof(void) const
Definition: planej.h:413
static const unsigned int NumSelfDof
Definition: planej.h:381

Here is the call graph for this function:

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

Implements Joint.

Definition at line 406 of file planej.h.

References Joint::AXIALROTATION.

406  {
407  return Joint::AXIALROTATION;
408  };
virtual unsigned int AxialRotationJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 481 of file planej.h.

481  {
482  return 11;
483  };
virtual unsigned int AxialRotationJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 413 of file planej.h.

References fc, SimulationEntity::iGetNumDof(), and NumSelfDof.

Referenced by AssJac(), AssRes(), GetDofType(), and GetEqType().

413  {
414  unsigned int i = NumSelfDof;
415  if (fc) {
416  i+=fc->iGetNumDof();
417  }
418  return i;
419  };
BasicFriction *const fc
Definition: planej.h:377
virtual unsigned int iGetNumDof(void) const =0
static const unsigned int NumSelfDof
Definition: planej.h:381

Here is the call graph for this function:

unsigned int AxialRotationJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 3887 of file planej.cc.

Referenced by dGetPrivData().

3888 {
3889  return 8;
3890 }
unsigned int AxialRotationJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 3893 of file planej.cc.

References ASSERT.

3894 {
3895  ASSERT(s != NULL);
3896 
3897  unsigned int idx = 0;
3898 
3899  switch (s[0]) {
3900  case 'w':
3901  idx++;
3902  case 'r':
3903  idx++;
3904  if (s[1] == 'z') {
3905  return idx;
3906  }
3907  break;
3908 
3909  case 'M':
3910  idx += 3;
3911  case 'F':
3912  idx += 2;
3913 
3914  switch (s[1]) {
3915  case 'x':
3916  return idx + 1;
3917 
3918  case 'y':
3919  return idx + 2;
3920 
3921  case 'z':
3922  return idx + 3;
3923  }
3924  }
3925 
3926  return 0;
3927 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & AxialRotationJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 3494 of file planej.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), d1, d2, Vec3::dGet(), F, WithLabel::GetLabel(), StructNode::GetRRef(), Mat3x3::GetVec(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, MatCross, MatCrossCross, MBDYN_EXCEPT_ARGS, pNode1, pNode2, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R2h, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

3496 {
3497  /* Per ora usa la matrice piena; eventualmente si puo'
3498  * passare a quella sparsa quando si ottimizza */
3499  FullSubMatrixHandler& WM = WorkMat.SetFull();
3500 
3501  /* Dimensiona e resetta la matrice di lavoro */
3502  integer iNumRows = 0;
3503  integer iNumCols = 0;
3504  InitialWorkSpaceDim(&iNumRows, &iNumCols);
3505  WM.ResizeReset(iNumRows, iNumCols);
3506 
3507  /* Equazioni: vedi joints.dvi */
3508 
3509  /* equazioni ed incognite
3510  * F1 Delta_x1 0+1 = 1
3511  * M1 Delta_g1 3+1 = 4
3512  * FP1 Delta_xP1 6+1 = 7
3513  * MP1 Delta_w1 9+1 = 10
3514  * F2 Delta_x2 12+1 = 13
3515  * M2 Delta_g2 15+1 = 16
3516  * FP2 Delta_xP2 18+1 = 19
3517  * MP2 Delta_w2 21+1 = 22
3518  * vincolo spostamento Delta_F 24+1 = 25
3519  * vincolo rotazione Delta_M 27+1 = 28
3520  * derivata vincolo spostamento Delta_FP 29+1 = 30
3521  * derivata vincolo rotazione Delta_MP 32+1 = 33
3522  * vincolo di velocita' di rotazione
3523  */
3524 
3525 
3526  /* Indici */
3527  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
3528  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
3529  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
3530  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
3531  integer iFirstReactionIndex = iGetFirstIndex();
3532  integer iReactionPrimeIndex = iFirstReactionIndex+5;
3533 
3534  /* Nota: le reazioni vincolari sono:
3535  * Forza, 3 incognite, riferimento globale,
3536  * Momento, 2 incognite, riferimento locale
3537  */
3538 
3539  /* Setta gli indici dei nodi */
3540  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3541  WM.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
3542  WM.PutColIndex(iCnt, iNode1FirstPosIndex+iCnt);
3543  WM.PutRowIndex(6+iCnt, iNode1FirstVelIndex+iCnt);
3544  WM.PutColIndex(6+iCnt, iNode1FirstVelIndex+iCnt);
3545  WM.PutRowIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
3546  WM.PutColIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
3547  WM.PutRowIndex(18+iCnt, iNode2FirstVelIndex+iCnt);
3548  WM.PutColIndex(18+iCnt, iNode2FirstVelIndex+iCnt);
3549  }
3550 
3551  /* Setta gli indici delle reazioni */
3552  for (int iCnt = 1; iCnt <= 5; iCnt++) {
3553  WM.PutRowIndex(24+iCnt, iFirstReactionIndex+iCnt);
3554  WM.PutColIndex(24+iCnt, iFirstReactionIndex+iCnt);
3555  }
3556 
3557  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3558  WM.PutRowIndex(29+iCnt, iReactionPrimeIndex+iCnt);
3559  WM.PutColIndex(29+iCnt, iReactionPrimeIndex+iCnt);
3560  }
3561 
3562  /* Recupera i dati */
3563  const Mat3x3& R1(pNode1->GetRRef());
3564  const Mat3x3& R2(pNode2->GetRRef());
3565  const Vec3& Omega1(pNode1->GetWRef());
3566  const Vec3& Omega2(pNode2->GetWRef());
3567  /* F ed M sono gia' state aggiornate da InitialAssRes */
3568  Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
3569  Vec3 MPrime(XCurr, iReactionPrimeIndex+4);
3570 
3571  /* Matrici identita' */
3572  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3573  /* Contributo di forza all'equazione della forza, nodo 1 */
3574  WM.PutCoef(iCnt, 24+iCnt, 1.);
3575 
3576  /* Contrib. di der. di forza all'eq. della der. della forza, nodo 1 */
3577  WM.PutCoef(6+iCnt, 29+iCnt, 1.);
3578 
3579  /* Contributo di forza all'equazione della forza, nodo 2 */
3580  WM.PutCoef(12+iCnt, 24+iCnt, -1.);
3581 
3582  /* Contrib. di der. di forza all'eq. della der. della forza, nodo 2 */
3583  WM.PutCoef(18+iCnt, 29+iCnt, -1.);
3584 
3585  /* Equazione di vincolo, nodo 1 */
3586  WM.PutCoef(24+iCnt, iCnt, -1.);
3587 
3588  /* Derivata dell'equazione di vincolo, nodo 1 */
3589  WM.PutCoef(29+iCnt, 6+iCnt, -1.);
3590 
3591  /* Equazione di vincolo, nodo 2 */
3592  WM.PutCoef(24+iCnt, 12+iCnt, 1.);
3593 
3594  /* Derivata dell'equazione di vincolo, nodo 2 */
3595  WM.PutCoef(29+iCnt, 18+iCnt, 1.);
3596  }
3597 
3598  /* Distanze e matrici di rotazione dai nodi alla cerniera
3599  * nel sistema globale */
3600  Vec3 d1Tmp(R1*d1);
3601  Vec3 d2Tmp(R2*d2);
3602  Mat3x3 R1hTmp(R1*R1h);
3603  Mat3x3 R2hTmp(R2*R2h);
3604 
3605  Vec3 e3a(R1hTmp.GetVec(3));
3606  Vec3 e1b(R2hTmp.GetVec(1));
3607  Vec3 e2b(R2hTmp.GetVec(2));
3608 
3609  /* Ruota il momento e la sua derivata con le matrici della cerniera
3610  * rispetto ai nodi */
3611  Vec3 MTmp(e2b*M.dGet(1)-e1b*M.dGet(2));
3612  Vec3 MPrimeTmp(e2b*MPrime.dGet(1)-e1b*MPrime.dGet(2));
3613 
3614  /* Matrici F/\d1/\, -F/\d2/\ */
3615  Mat3x3 FWedged1Wedge(MatCrossCross, F, d1Tmp);
3616  Mat3x3 FWedged2Wedge(MatCrossCross, F, -d2Tmp);
3617 
3618  /* Matrici (omega1/\d1)/\, -(omega2/\d2)/\ */
3619  Mat3x3 O1Wedged1Wedge(MatCross, Omega1.Cross(d1Tmp));
3620  Mat3x3 O2Wedged2Wedge(MatCross, d2Tmp.Cross(Omega2));
3621 
3622  Mat3x3 MDeltag1((Mat3x3(MatCross, Omega2.Cross(MTmp) + MPrimeTmp)
3623  + Mat3x3(MatCrossCross, MTmp, Omega1))*Mat3x3(MatCross, e3a));
3624  Mat3x3 MDeltag2(Mat3x3(MatCrossCross, Omega1.Cross(e3a), MTmp)
3625  + Mat3x3(MatCrossCross, e3a, MPrimeTmp)
3626  + e3a.Cross(Mat3x3(MatCrossCross, Omega2, MTmp)));
3627 
3628  /* Vettori temporanei */
3629  Vec3 Tmp1(e2b.Cross(e3a));
3630  Vec3 Tmp2(e3a.Cross(e1b));
3631 
3632  /* Prodotto vettore tra il versore 3 della cerniera secondo il nodo 1
3633  * ed il versore 1 della cerniera secondo il nodo 2. A convergenza
3634  * devono essere ortogonali, quindi il loro prodotto vettore deve essere
3635  * unitario */
3636 
3637  /* Error handling: il programma si ferma, pero' segnala dov'e' l'errore */
3638  if (Tmp1.Dot() <= std::numeric_limits<doublereal>::epsilon() || Tmp2.Dot() <= std::numeric_limits<doublereal>::epsilon()) {
3639  silent_cerr("AxialRotationJoint(" << GetLabel() << "): "
3640  "first and second node hinge axes are (nearly) orthogonal"
3641  << std::endl);
3643  }
3644 
3645  Vec3 TmpPrime1(e2b.Cross(Omega1.Cross(e3a))-e3a.Cross(Omega2.Cross(e2b)));
3646  Vec3 TmpPrime2(e3a.Cross(Omega2.Cross(e1b))-e1b.Cross(Omega1.Cross(e3a)));
3647 
3648  /* Equazione di momento, nodo 1 */
3649  WM.Add(4, 4, FWedged1Wedge - Mat3x3(MatCrossCross, MTmp, e3a));
3650  WM.Add(4, 16, Mat3x3(MatCrossCross, e3a, MTmp));
3651  WM.Add(4, 25, Mat3x3(MatCross, d1Tmp));
3652  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3653  WM.PutCoef(3+iCnt, 28, Tmp1(iCnt));
3654  WM.PutCoef(3+iCnt, 29, Tmp2(iCnt));
3655  }
3656 
3657  /* Equazione di momento, nodo 2 */
3658  WM.Add(4, 16, Mat3x3(MatCrossCross, MTmp, e3a));
3659  WM.Add(16, 16, FWedged2Wedge - Mat3x3(MatCrossCross, e3a, MTmp));
3660  WM.Sub(16, 25, Mat3x3(MatCross, d2Tmp));
3661  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3662  WM.PutCoef(15+iCnt, 28, -Tmp1(iCnt));
3663  WM.PutCoef(15+iCnt, 29, -Tmp2(iCnt));
3664  }
3665 
3666  /* Derivata dell'equazione di momento, nodo 1 */
3667  WM.Add(10, 4, (Mat3x3(MatCross, FPrime) + Mat3x3(MatCrossCross, F, Omega1))*Mat3x3(MatCross, d1Tmp)
3668  - MDeltag1
3669  - Mat3x3(MatCross, e3a*MPrime(3)));
3670  WM.Add(10, 10, FWedged1Wedge
3671  - Mat3x3(MatCrossCross, MTmp, e3a)
3672  - Mat3x3(MatCross, e3a*MPrime(3)));
3673  WM.Add(10, 16, MDeltag2);
3674  WM.Add(10, 22, Mat3x3(MatCrossCross, e3a, MTmp));
3675  WM.Add(10, 25, O1Wedged1Wedge);
3676  WM.Add(10, 30, Mat3x3(MatCross, d1Tmp));
3677 
3678  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3679  WM.PutCoef(9+iCnt, 28, TmpPrime1(iCnt));
3680  WM.PutCoef(9+iCnt, 29, TmpPrime2(iCnt));
3681  WM.PutCoef(9+iCnt, 33, Tmp1(iCnt));
3682  WM.PutCoef(9+iCnt, 34, Tmp2(iCnt));
3683 
3684  /* Contributo del momento attorno all'asse 3, dovuto alla velocita'
3685  * imposta */
3686  WM.PutCoef(9+iCnt, 35, e3a(iCnt));
3687  }
3688 
3689  /* Derivata dell'equazione di momento, nodo 2 */
3690  WM.Add(22, 4, MDeltag1 + Mat3x3(MatCross, e3a*MPrime(3)));
3691  WM.Add(22, 10, Mat3x3(MatCrossCross, MTmp, e3a) + Mat3x3(MatCross, e3a*MPrime(3)));
3692  WM.Sub(22, 16, (Mat3x3(MatCross, FPrime) + Mat3x3(MatCrossCross, F, Omega2))*Mat3x3(MatCross, d2Tmp) + MDeltag2);
3693  WM.Add(22, 22, FWedged2Wedge - Mat3x3(MatCrossCross, e3a, MTmp));
3694  WM.Add(22, 25, O2Wedged2Wedge);
3695  WM.Sub(22, 30, Mat3x3(MatCross, d2Tmp));
3696 
3697  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3698  WM.PutCoef(21+iCnt, 28, -TmpPrime1(iCnt));
3699  WM.PutCoef(21+iCnt, 29, -TmpPrime2(iCnt));
3700  WM.PutCoef(21+iCnt, 33, -Tmp1(iCnt));
3701  WM.PutCoef(21+iCnt, 34, -Tmp2(iCnt));
3702 
3703  /* Contributo del momento attorno all'asse 3, dovuto alla velocita'
3704  * imposta */
3705  WM.PutCoef(21+iCnt, 35, -e3a(iCnt));
3706  }
3707 
3708  /* Equazione di vincolo di posizione */
3709  WM.Add(25, 4, Mat3x3(MatCross, d1Tmp));
3710  WM.Sub(25, 16, Mat3x3(MatCross, d2Tmp));
3711 
3712  /* Derivata dell'equazione di vincolo di posizione */
3713  WM.Add(30, 4, O1Wedged1Wedge);
3714  WM.Add(30, 10, Mat3x3(MatCross, d1Tmp));
3715  WM.Add(30, 16, O2Wedged2Wedge);
3716  WM.Sub(30, 22, Mat3x3(MatCross, d2Tmp));
3717 
3718  /* Equazioni di vincolo di rotazione: e1b~e3a, e2b~e3a */
3719 
3720  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3721  doublereal d = Tmp1(iCnt);
3722  WM.PutCoef(28, 3+iCnt, d);
3723  WM.PutCoef(28, 15+iCnt, -d);
3724 
3725  /* Queste sono per la derivata dell'equazione, sono qui solo per
3726  * ottimizzazione */
3727  WM.PutCoef(33, 9+iCnt, d);
3728  WM.PutCoef(33, 21+iCnt, -d);
3729 
3730  d = Tmp2.dGet(iCnt);
3731  WM.PutCoef(29, 3+iCnt, -d);
3732  WM.PutCoef(29, 15+iCnt, d);
3733 
3734  /* Queste sono per la derivata dell'equazione, sono qui solo per
3735  * ottimizzazione */
3736  WM.PutCoef(34, 9+iCnt, -d);
3737  WM.PutCoef(34, 21+iCnt, d);
3738  }
3739 
3740  /* Derivate delle equazioni di vincolo di rotazione: e1b~e3a, e2b~e3a */
3741  Vec3 O1mO2(Omega1 - Omega2);
3742  TmpPrime1 = e3a.Cross(O1mO2.Cross(e2b));
3743  TmpPrime2 = e2b.Cross(e3a.Cross(O1mO2));
3744  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3745  WM.PutCoef(33, 3+iCnt, TmpPrime1(iCnt));
3746  WM.PutCoef(33, 15+iCnt, TmpPrime2(iCnt));
3747  }
3748 
3749  TmpPrime1 = e3a.Cross(O1mO2.Cross(e1b));
3750  TmpPrime2 = e1b.Cross(e3a.Cross(O1mO2));
3751  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3752  WM.PutCoef(34, 3+iCnt, TmpPrime1(iCnt));
3753  WM.PutCoef(34, 15+iCnt, TmpPrime2(iCnt));
3754  }
3755 
3756  /* Equazione di vincolo di velocita' di rotazione; viene posta qui perche'
3757  * a questo numero di equazione corrisponde il numero della
3758  * relativa incognita */
3759  Vec3 Tmp = O1mO2.Cross(e3a);
3760  for (int iCnt = 1; iCnt <= 3; iCnt++) {
3761  WM.PutCoef(35, 3+iCnt, Tmp(iCnt));
3762  doublereal d = e3a(iCnt);
3763  WM.PutCoef(35, 9+iCnt, -d);
3764  WM.PutCoef(35, 21+iCnt, d);
3765  }
3766 
3767  return WorkMat;
3768 }
const StructNode * pNode2
Definition: planej.h:358
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: planej.h:484
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 3773 of file planej.cc.

References VectorHandler::Add(), Vec3::Cross(), grad::Cross(), d1, d2, DEBUGCOUT, Vec3::dGet(), DriveCaller::dGet(), F, StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, DriveOwner::pGetDriveCaller(), pNode1, pNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), R1h, R2h, VectorHandler::ResizeReset(), and VectorHandler::Sub().

3775 {
3776  DEBUGCOUT("Entering AxialRotationJoint::InitialAssRes()" << std::endl);
3777 
3778  /* Dimensiona e resetta la matrice di lavoro */
3779  integer iNumRows = 0;
3780  integer iNumCols = 0;
3781  InitialWorkSpaceDim(&iNumRows, &iNumCols);
3782  WorkVec.ResizeReset(iNumRows);
3783 
3784  /* Indici */
3785  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
3786  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
3787  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
3788  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
3789  integer iFirstReactionIndex = iGetFirstIndex();
3790  integer iReactionPrimeIndex = iFirstReactionIndex+5;
3791 
3792  /* Setta gli indici */
3793  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3794  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
3795  WorkVec.PutRowIndex(6+iCnt, iNode1FirstVelIndex+iCnt);
3796  WorkVec.PutRowIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
3797  WorkVec.PutRowIndex(18+iCnt, iNode2FirstVelIndex+iCnt);
3798  }
3799 
3800  for (int iCnt = 1; iCnt <= 5; iCnt++) {
3801  WorkVec.PutRowIndex(24+iCnt, iFirstReactionIndex+iCnt);
3802  }
3803 
3804  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3805  WorkVec.PutRowIndex(29+iCnt, iReactionPrimeIndex+iCnt);
3806  }
3807 
3808  /* Recupera i dati */
3809  const Vec3& x1(pNode1->GetXCurr());
3810  const Vec3& x2(pNode2->GetXCurr());
3811  const Vec3& v1(pNode1->GetVCurr());
3812  const Vec3& v2(pNode2->GetVCurr());
3813  const Mat3x3& R1(pNode1->GetRCurr());
3814  const Mat3x3& R2(pNode2->GetRCurr());
3815  const Vec3& Omega1(pNode1->GetWCurr());
3816  const Vec3& Omega2(pNode2->GetWCurr());
3817 
3818  /* Aggiorna F ed M, che restano anche per InitialAssJac */
3819  F = Vec3(XCurr, iFirstReactionIndex+1);
3820  M = Vec3(XCurr(iFirstReactionIndex+4),
3821  XCurr(iFirstReactionIndex+5),
3822  0.);
3823  Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
3824  Vec3 MPrime(XCurr, iReactionPrimeIndex+4);
3825 
3826  /* Distanza nel sistema globale */
3827  Vec3 d1Tmp(R1*d1);
3828  Vec3 d2Tmp(R2*d2);
3829  Mat3x3 R1hTmp(R1*R1h);
3830  Mat3x3 R2hTmp(R2*R2h);
3831 
3832  /* Vettori omega1/\d1, -omega2/\d2 */
3833  Vec3 O1Wedged1(Omega1.Cross(d1Tmp));
3834  Vec3 O2Wedged2(Omega2.Cross(d2Tmp));
3835 
3836  Vec3 e3a(R1hTmp.GetVec(3));
3837  Vec3 e1b(R2hTmp.GetVec(1));
3838  Vec3 e2b(R2hTmp.GetVec(2));
3839 
3840  /* Ruota il momento e la sua derivata con le matrici della cerniera
3841  * rispetto ai nodi */
3842  Vec3 MTmp(e2b*M.dGet(1)-e1b*M.dGet(2));
3843  Vec3 MPrimeTmp(e3a.Cross(MTmp.Cross(Omega2))+MTmp.Cross(Omega1.Cross(e3a))+
3844  e2b.Cross(e3a)*MPrime.dGet(1)+e3a.Cross(e1b)*MPrime.dGet(2));
3845 
3846  /* Equazioni di equilibrio, nodo 1 */
3847  WorkVec.Sub(1, F);
3848  WorkVec.Add(4, F.Cross(d1Tmp)-MTmp.Cross(e3a)); /* Sfrutto il fatto che F/\d = -d/\F */
3849 
3850  /* Derivate delle equazioni di equilibrio, nodo 1 */
3851  WorkVec.Sub(7, FPrime);
3852  WorkVec.Add(10, FPrime.Cross(d1Tmp)-O1Wedged1.Cross(F)-MPrimeTmp-
3853  e3a*MPrime.dGet(3));
3854 
3855  /* Equazioni di equilibrio, nodo 2 */
3856  WorkVec.Add(13, F);
3857  WorkVec.Add(16, d2Tmp.Cross(F)+MTmp.Cross(e3a));
3858 
3859  /* Derivate delle equazioni di equilibrio, nodo 2 */
3860  WorkVec.Add(19, FPrime);
3861  WorkVec.Add(22, d2Tmp.Cross(FPrime)+O2Wedged2.Cross(F)+MPrimeTmp+
3862  e3a*MPrime.dGet(3));
3863 
3864  /* Equazione di vincolo di posizione */
3865  WorkVec.Add(25, x1+d1Tmp-x2-d2Tmp);
3866 
3867  /* Derivata dell'equazione di vincolo di posizione */
3868  WorkVec.Add(30, v1+O1Wedged1-v2-O2Wedged2);
3869 
3870  /* Equazioni di vincolo di rotazione */
3871  WorkVec.PutCoef(28, e2b.Dot(e3a));
3872  WorkVec.PutCoef(29, e1b.Dot(e3a));
3873 
3874  /* Derivate delle equazioni di vincolo di rotazione: e1b~e3a, e2b~e3a */
3875  Vec3 Tmp((Omega1-Omega2).Cross(e3a));
3876  WorkVec.PutCoef(33, e2b.Dot(Tmp));
3877  WorkVec.PutCoef(34, e1b.Dot(Tmp));
3878 
3879  /* Equazione di vincolo di velocita' di rotazione */
3880  doublereal Omega0 = pGetDriveCaller()->dGet();
3881  WorkVec.PutCoef(35, Omega0-e3a.Dot(Omega2-Omega1));
3882 
3883  return WorkVec;
3884 }
const StructNode * pNode2
Definition: planej.h:358
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual doublereal dGet(const doublereal &dVar) const =0
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: planej.h:484
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 484 of file planej.h.

Referenced by InitialAssJac(), and InitialAssRes().

485  {
486  *piNumRows = 35;
487  *piNumCols = 35;
488  };
void AxialRotationJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 3391 of file planej.cc.

References ToBeOutput::bToBeOutput(), DriveOwner::dGet(), dRaDegr, EULER_123, EULER_313, EULER_321, F, BasicFriction::fc(), fc, OutputHandler::GetCurrentStep(), WithLabel::GetLabel(), StructNode::GetRCurr(), StructNode::GetWCurr(), OutputHandler::JOINTS, OutputHandler::Joints(), M, M3, MatR2EulerAngles123(), MatR2EulerAngles313(), MatR2EulerAngles321(), od, ORIENTATION_MATRIX, ORIENTATION_VECTOR, Joint::Output(), Vec3::pGetVec(), pNode1, pNode2, R1h, R2h, OutputHandler::UseNetCDF(), OutputHandler::UseText(), and RotManip::VecRot().

3392 {
3393  if (bToBeOutput()) {
3394  Mat3x3 R2Tmp(pNode2->GetRCurr()*R2h);
3395  Mat3x3 RTmp((pNode1->GetRCurr()*R1h).MulTM(R2Tmp));
3396  Vec3 E;
3397  switch (od) {
3398  case EULER_123:
3399  E = MatR2EulerAngles123(RTmp)*dRaDegr;
3400  break;
3401 
3402  case EULER_313:
3403  E = MatR2EulerAngles313(RTmp)*dRaDegr;
3404  break;
3405 
3406  case EULER_321:
3407  E = MatR2EulerAngles321(RTmp)*dRaDegr;
3408  break;
3409 
3410  case ORIENTATION_VECTOR:
3411  E = RotManip::VecRot(RTmp);
3412  break;
3413 
3414  case ORIENTATION_MATRIX:
3415  break;
3416 
3417  default:
3418  /* impossible */
3419  break;
3420  }
3421  Vec3 OmegaTmp(R2Tmp.MulTV(pNode2->GetWCurr()-pNode1->GetWCurr()));
3422 
3423 #ifdef USE_NETCDF
3424  if (OH.UseNetCDF(OutputHandler::JOINTS)) {
3425  Var_F_local->put_rec((R2Tmp.MulTV(F)).pGetVec(), OH.GetCurrentStep());
3426  Var_M_local->put_rec(M.pGetVec(), OH.GetCurrentStep());
3427  Var_F_global->put_rec(F.pGetVec(), OH.GetCurrentStep());
3428  Var_M_global->put_rec((R2Tmp*M).pGetVec(), OH.GetCurrentStep());
3429  switch (od) {
3430  case EULER_123:
3431  case EULER_313:
3432  case EULER_321:
3433  case ORIENTATION_VECTOR:
3434  Var_Phi->put_rec(E.pGetVec(), OH.GetCurrentStep());
3435  break;
3436 
3437  case ORIENTATION_MATRIX:
3438  Var_Phi->put_rec(RTmp.pGetMat(), OH.GetCurrentStep());
3439  break;
3440 
3441  default:
3442  /* impossible */
3443  break;
3444  }
3445  Var_Omega->put_rec(OmegaTmp.pGetVec(), OH.GetCurrentStep());
3446 /*
3447  if (fc) {
3448  Var_MFR->put_rec(&M3, OH.GetCurrentStep());
3449  Var_MU->put_rec(fc->fc(), OH.GetCurrentStep());
3450  }
3451  else
3452  {
3453  Var_MFR->put_rec(0, OH.GetCurrentStep());
3454  Var_MU->put_rec(0, OH.GetCurrentStep());
3455  }
3456 */
3457  }
3458 #endif // USE_NETCDF
3459  if (OH.UseText(OutputHandler::JOINTS)) {
3460  std::ostream &of = Joint::Output(OH.Joints(), "AxialRotation", GetLabel(),
3461  R2Tmp.MulTV(F), M, F, R2Tmp*M)
3462  << " ";
3463 
3464  switch (od) {
3465  case EULER_123:
3466  case EULER_313:
3467  case EULER_321:
3468  case ORIENTATION_VECTOR:
3469  OH.Joints() << E;
3470  break;
3471 
3472  case ORIENTATION_MATRIX:
3473  OH.Joints() << RTmp;
3474  break;
3475 
3476  default:
3477  /* impossible */
3478  break;
3479  }
3480 
3481  OH.Joints() << " " << dGet()
3482  << " " << OmegaTmp;
3483  if (fc) {
3484  of << " " << M3 << " " << fc->fc();
3485  }
3486  of << std::endl;
3487  }
3488  }
3489 }
const StructNode * pNode2
Definition: planej.h:358
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
doublereal dGet(void) const
Definition: drive.cc:671
BasicFriction *const fc
Definition: planej.h:377
virtual doublereal fc(void) const =0
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Definition: matvec3.cc:927
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
doublereal M3
Definition: planej.h:380
OrientationDescription od
Definition: planej.h:386
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
Definition: matvec3.cc:941
const StructNode * pNode1
Definition: planej.h:357
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
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

void AxialRotationJoint::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 3365 of file planej.cc.

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

3366 {
3367  if (bToBeOutput()) {
3368 #ifdef USE_NETCDF
3369  if (OH.UseNetCDF(OutputHandler::JOINTS)) {
3370  std::string name;
3371  OutputPrepare_int("axial rotation", OH, name);
3372 
3373  Var_Phi = OH.CreateRotationVar(name, "", od, "global");
3374 
3375  Var_Omega = OH.CreateVar<Vec3>(name + "Omega", "radian/s",
3376  "local relative angular velocity (x, y, z)");
3377 
3378 /* TODO
3379  Var_MFR = OH.CreateVar<doublereal>(name + "MFR", "Nm",
3380  "friciton moment ");
3381 
3382  Var_MU = OH.CreateVar<doublereal>(name + "MU", "--",
3383  "friction model specific data: friction coefficient?");
3384 */
3385  }
3386 #endif // USE_NETCDF
3387  }
3388 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
virtual void OutputPrepare_int(const std::string &type, OutputHandler &OH, std::string &name)
Definition: joint.cc:107
OrientationDescription od
Definition: planej.h:386

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 2912 of file planej.cc.

References fc, SimulationEntity::ParseHint(), and STRLENOF.

2913 {
2914  if (strncasecmp(s, "offset{" /*}*/, STRLENOF("offset{" /*}*/)) == 0) {
2915  s += STRLENOF("offset{" /*}*/);
2916 
2917  if (strcmp(&s[1], /*{*/ "}") != 0) {
2918  return 0;
2919  }
2920 
2921  switch (s[0]) {
2922  case '1':
2923  return new Joint::OffsetHint<1>;
2924 
2925  case '2':
2926  return new Joint::OffsetHint<2>;
2927  }
2928 
2929  } else if (strncasecmp(s, "hinge{" /*}*/, STRLENOF("hinge{" /*}*/)) == 0) {
2930  s += STRLENOF("hinge{" /*}*/);
2931 
2932  if (strcmp(&s[1], /*{*/ "}") != 0) {
2933  return 0;
2934  }
2935 
2936  switch (s[0]) {
2937  case '1':
2938  return new Joint::HingeHint<1>;
2939 
2940  case '2':
2941  return new Joint::HingeHint<2>;
2942  }
2943 
2944  } else if (fc) {
2945  return fc->ParseHint(pDM, s);
2946  }
2947 
2948  return 0;
2949 }
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: simentity.cc:76
BasicFriction *const fc
Definition: planej.h:377
#define STRLENOF(s)
Definition: mbdyn.h:166

Here is the call graph for this function:

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

Implements Elem.

Definition at line 2989 of file planej.cc.

References d1, d2, WithLabel::GetLabel(), Mat3x3::GetVec(), DriveOwner::pGetDriveCaller(), pNode1, pNode2, R1h, R2h, Joint::Restart(), DriveCaller::Restart(), Write(), and Vec3::Write().

2990 {
2991  Joint::Restart(out) << ", axial rotation, "
2992  << pNode1->GetLabel()
2993  << ", reference, node, ", d1.Write(out, ", ")
2994  << ", hinge, reference, node, 1, ", (R1h.GetVec(1)).Write(out, ", ")
2995  << ", 2, ", (R1h.GetVec(2)).Write(out, ", ") << ", "
2996  << pNode2->GetLabel()
2997  << ", reference, node, ", d2.Write(out, ", ")
2998  << ", hinge, reference, node, 1, ", (R2h.GetVec(1)).Write(out, ", ")
2999  << ", 2, ", (R2h.GetVec(2)).Write(out, ", ") << ", ";
3000 
3001  return pGetDriveCaller()->Restart(out) << ';' << std::endl;
3002 }
const StructNode * pNode2
Definition: planej.h:358
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
virtual std::ostream & Restart(std::ostream &out) const =0
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const StructNode * pNode1
Definition: planej.h:357
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 2853 of file planej.cc.

References d1, d2, Vec3::dGet(), dTheta, dThetaWrapped, fc, StructNode::GetRCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), MatR2EulerAngles(), MBDYN_EXCEPT_ARGS, Mat3x3::MulTM(), NumSelfDof, DriveHint::pCreateDrive(), pNode1, pNode2, R1h, R2h, DriveOwner::Set(), and BasicFriction::SetValue().

2856 {
2857  if (ph) {
2858  for (unsigned i = 0; i < ph->size(); i++) {
2859  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
2860 
2861  if (pjh == 0) {
2862  DriveHint *pdh = dynamic_cast<DriveHint *>((*ph)[i]);
2863  if (pdh) {
2864  DriveCaller *pDC = pdh->pCreateDrive(pDM);
2865  if (pDC == 0) {
2866  silent_cerr("AxialRotationJoint::SetValue: "
2867  "unable to create drive after hint "
2868  "#" << i << std::endl);
2870  }
2871 
2872  DriveOwner::Set(pDC);
2873  }
2874  continue;
2875  }
2876 
2877  if (dynamic_cast<Joint::OffsetHint<1> *>(pjh)) {
2878  const Mat3x3& R1(pNode1->GetRCurr());
2879  Vec3 dTmp2(pNode2->GetRCurr()*d2);
2880 
2881  d1 = R1.MulTV(pNode2->GetXCurr() + dTmp2 - pNode1->GetXCurr());
2882 
2883  } else if (dynamic_cast<Joint::OffsetHint<2> *>(pjh)) {
2884  const Mat3x3& R2(pNode2->GetRCurr());
2885  Vec3 dTmp1(pNode1->GetRCurr()*d1);
2886 
2887  d2 = R2.MulTV(pNode1->GetXCurr() + dTmp1 - pNode2->GetXCurr());
2888 
2889  } else if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
2891 
2892  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
2894 
2895  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
2896  /* TODO */
2897  }
2898  }
2899  }
2900 
2901  Mat3x3 RTmp((pNode1->GetRCurr()*R1h).MulTM(pNode2->GetRCurr()*R2h));
2902  Vec3 v(MatR2EulerAngles(RTmp));
2903 
2904  dThetaWrapped = dTheta = v.dGet(3);
2905 
2906  if (fc) {
2907  fc->SetValue(pDM, X, XP, ph, iGetFirstIndex() + NumSelfDof);
2908  }
2909 }
const StructNode * pNode2
Definition: planej.h:358
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal dTheta
Definition: planej.h:366
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: friction.h:45
doublereal dThetaWrapped
Definition: planej.h:366
BasicFriction *const fc
Definition: planej.h:377
DriveCaller * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.cc:117
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
Vec3 MatR2EulerAngles(const Mat3x3 &R)
Definition: matvec3.cc:887
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
void Set(const DriveCaller *pDC)
Definition: drive.cc:647
static const unsigned int NumSelfDof
Definition: planej.h:381
const StructNode * pNode1
Definition: planej.h:357
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127

Here is the call graph for this function:

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

Implements Elem.

Definition at line 454 of file planej.h.

References fc, SimulationEntity::iGetNumDof(), and NumDof.

Referenced by AssJac(), and AssRes().

454  {
455  *piNumRows = NumDof;
456  *piNumCols = NumDof;
457  if (fc) {
458  *piNumRows += fc->iGetNumDof();
459  *piNumCols += fc->iGetNumDof();
460  }
461  };
BasicFriction *const fc
Definition: planej.h:377
static const unsigned int NumDof
Definition: planej.h:382
virtual unsigned int iGetNumDof(void) const =0

Here is the call graph for this function:

Member Data Documentation

Vec3 AxialRotationJoint::d1
private

Definition at line 359 of file planej.h.

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

Vec3 AxialRotationJoint::d2
private

Definition at line 361 of file planej.h.

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

doublereal AxialRotationJoint::dTheta
mutableprivate

Definition at line 366 of file planej.h.

Referenced by AfterConvergence(), and SetValue().

doublereal AxialRotationJoint::dThetaWrapped
mutableprivate

Definition at line 366 of file planej.h.

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

Vec3 AxialRotationJoint::F
private
Vec3 AxialRotationJoint::M
private

Definition at line 364 of file planej.h.

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

doublereal AxialRotationJoint::M3
private

Definition at line 380 of file planej.h.

Referenced by AssRes(), and Output().

int AxialRotationJoint::NTheta
mutableprivate

Definition at line 365 of file planej.h.

Referenced by AfterConvergence(), and dGetPrivData().

const unsigned int AxialRotationJoint::NumDof
staticprivate

Definition at line 382 of file planej.h.

Referenced by WorkSpaceDim().

const unsigned int AxialRotationJoint::NumSelfDof
staticprivate
OrientationDescription AxialRotationJoint::od
protected

Definition at line 386 of file planej.h.

Referenced by Output(), and OutputPrepare().

const StructNode* AxialRotationJoint::pNode1
private
const StructNode* AxialRotationJoint::pNode2
private
const doublereal AxialRotationJoint::preF
private

Definition at line 378 of file planej.h.

Referenced by AfterConvergence(), AssJac(), and AssRes().

const doublereal AxialRotationJoint::r
private

Definition at line 379 of file planej.h.

Referenced by AfterConvergence(), AssJac(), and AssRes().

Mat3x3 AxialRotationJoint::R1h
private
Mat3x3 AxialRotationJoint::R2h
private
BasicShapeCoefficient* const AxialRotationJoint::Sh_c
private

Definition at line 376 of file planej.h.

Referenced by AssJac(), AssRes(), and ~AxialRotationJoint().


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