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

#include <prismj.h>

Inheritance diagram for PrismaticJoint:
Collaboration diagram for PrismaticJoint:

Public Member Functions

 PrismaticJoint (unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &R1hTmp, const Mat3x3 &R2hTmp, flag fOut)
 
 ~PrismaticJoint (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual Joint::Type GetJointType (void) const
 
virtual unsigned int iGetNumDof (void) const
 
DofOrder::Order GetDofType (unsigned int i) const
 
DofOrder::Order GetEqType (unsigned int i) const
 
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)
 
void OutputPrepare (OutputHandler &OH)
 
void Output (OutputHandler &OH) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Joint
 Joint (unsigned int uL, const DofOwner *pD, flag fOut)
 
virtual ~Joint (void)
 
virtual Elem::Type GetElemType (void) const
 
std::ostream & Output (std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
bool bIsPrescribedMotion (void) const
 
bool bIsTorque (void) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 

Private Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Mat3x3 R1h
 
Mat3x3 R2h
 
Vec3 M
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Joint
enum  Type {
  UNKNOWN = -1, DISTANCE = 0, DISTANCEWITHOFFSET, CLAMP,
  SPHERICALHINGE, PIN, UNIVERSALHINGE, UNIVERSALROTATION,
  UNIVERSALPIN, PLANEHINGE, PLANEROTATION, PLANEPIN,
  AXIALROTATION, PLANEDISP, PLANEDISPPIN, INPLANE,
  INPLANECONTACT, J_INLINE, ROD, RODBEZIER,
  DEFORMABLEHINGE, DEFORMABLEDISPJOINT, DEFORMABLEJOINT, DEFORMABLEAXIALJOINT,
  VISCOUSBODY, LINEARVELOCITY, ANGULARVELOCITY, LINEARACCELERATION,
  ANGULARACCELERATION, PRISMATIC, DRIVEHINGE, DRIVEDISP,
  DRIVEDISPPIN, IMPOSEDORIENTATION, IMPOSEDDISP, IMPOSEDDISPPIN,
  IMPOSEDKINEMATICS, BEAMSLIDER, BRAKE, GIMBAL,
  POINT_SURFACE_CONTACT, TOTALJOINT, TOTALPINJOINT, TOTALEQUATION,
  TOTALREACTION, MODAL, SCREWJOINT, LASTJOINTTYPE
}
 
- Protected Member Functions inherited from Joint
virtual void OutputPrepare_int (const std::string &type, OutputHandler &OH, std::string &name)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 

Detailed Description

Definition at line 42 of file prismj.h.

Constructor & Destructor Documentation

PrismaticJoint::PrismaticJoint ( unsigned int  uL,
const DofOwner pDO,
const StructNode pN1,
const StructNode pN2,
const Mat3x3 R1hTmp,
const Mat3x3 R2hTmp,
flag  fOut 
)

Definition at line 43 of file prismj.cc.

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

47 : Elem(uL, fOut),
48 Joint(uL, pDO, fOut),
49 pNode1(pN1), pNode2(pN2),
50 R1h(R1hTmp), R2h(R2hTmp), M(Zero3)
51 {
52  ASSERT(pNode1 != NULL);
54  ASSERT(pNode2 != NULL);
56 }
const Vec3 Zero3(0., 0., 0.)
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
const StructNode * pNode1
Definition: prismj.h:51
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
Mat3x3 R2h
Definition: prismj.h:54
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 R1h
Definition: prismj.h:53
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

PrismaticJoint::~PrismaticJoint ( void  )

Definition at line 60 of file prismj.cc.

References NO_OP.

61 {
62  NO_OP;
63 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 92 of file prismj.cc.

References FullSubMatrixHandler::Add(), DEBUGCOUT, StructNode::GetRRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), M, MatCrossCross, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R2h, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), and WorkSpaceDim().

96 {
97  DEBUGCOUT("Entering PrismaticJoint::AssJac()" << std::endl);
98 
99  /* Setta la sottomatrice come piena (e' un po' dispersivo, ma lo jacobiano
100  * e' complicato */
101  FullSubMatrixHandler& WM = WorkMat.SetFull();
102 
103  /* Ridimensiona la sottomatrice in base alle esigenze */
104  integer iNumRows = 0;
105  integer iNumCols = 0;
106  this->WorkSpaceDim(&iNumRows, &iNumCols);
107  WM.ResizeReset(iNumRows, iNumCols);
108 
109  /* Recupera gli indici delle varie incognite */
110  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex()+3;
111  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex()+3;
112  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex()+3;
113  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex()+3;
114  integer iFirstReactionIndex = iGetFirstIndex();
115 
116  /* Recupera i dati che servono */
117  Mat3x3 R1hTmp(pNode1->GetRRef()*R1h);
118  Mat3x3 R2hTmp(pNode2->GetRRef()*R2h);
119  /* Suppongo che le reazioni M siano gia' state aggiornate da AssRes;
120  * ricordo che la coppia M e' nel sistema locale */
121 
122 
123  /*
124  * Il vincolo prismatico ha tre equazioni che affermano la coincidenza del
125  * riferimento solidale con il vincolo visto dai due nodi.
126  *
127  * (R1 * R1h * e2)^T * (R2 * R2h * e3) = 0
128  * (R1 * R1h * e3)^T * (R2 * R2h * e1) = 0
129  * (R1 * R1h * e1)^T * (R2 * R2h * e2) = 0
130  *
131  * A queste equazioni corrisponde una reazione di coppia agente attorno
132  * agli assi dati dall'errore di allineamento:
133  *
134  * [ (R1 * R1h * e2) /\ (R2 * R2h *e3), ]
135  * [ (R1 * R1h * e3) /\ (R2 * R2h *e1), ] M
136  * [ (R1 * R1h * e1) /\ (R2 * R2h *e2) ]
137  *
138  */
139 
140  /* Setta gli indici delle equazioni */
141  for (int iCnt = 1; iCnt <= 3; iCnt++) {
142  WM.PutRowIndex(0+iCnt, iNode1FirstMomIndex+iCnt);
143  WM.PutColIndex(0+iCnt, iNode1FirstPosIndex+iCnt);
144  WM.PutRowIndex(3+iCnt, iNode2FirstMomIndex+iCnt);
145  WM.PutColIndex(3+iCnt, iNode2FirstPosIndex+iCnt);
146 
147  WM.PutRowIndex(6+iCnt, iFirstReactionIndex+iCnt);
148  WM.PutColIndex(6+iCnt, iFirstReactionIndex+iCnt);
149  }
150 
151  Vec3 MTmp = M*dCoef; /* M e' stato aggiornato da AssRes */
152 
153  Vec3 e1a(R1hTmp.GetVec(1));
154  Vec3 e2a(R1hTmp.GetVec(2));
155  Vec3 e3a(R1hTmp.GetVec(3));
156  Vec3 e1b(R2hTmp.GetVec(1));
157  Vec3 e2b(R2hTmp.GetVec(2));
158  Vec3 e3b(R2hTmp.GetVec(3));
159 
160  Mat3x3 MWedge(Mat3x3(MatCrossCross, e3b, e2a*MTmp(1))
161  +Mat3x3(MatCrossCross, e1b, e3a*MTmp(2))
162  +Mat3x3(MatCrossCross, e2b, e1a*MTmp(3)));
163  Mat3x3 MWedgeT(MWedge.Transpose());
164 
165  WM.Add(1, 1, MWedge);
166  WM.Sub(1, 4, MWedgeT);
167 
168  WM.Add(4, 1, MWedgeT);
169  WM.Sub(4, 4, MWedge);
170 
171  Vec3 v1(e2a.Cross(e3b));
172  Vec3 v2(e3a.Cross(e1b));
173  Vec3 v3(e1a.Cross(e2b));
174 
175  MWedge = Mat3x3(v1, v2, v3);
176 
177  WM.Add(1, 7, MWedge);
178  WM.Sub(4, 7, MWedge);
179 
180  /* Modifica: divido le equazioni di vincolo per dCoef */
181 
182  /* Equazione di vincolo del momento
183  *
184  * Attenzione: bisogna scrivere il vettore trasposto
185  * (Sb[1]^T*(Sa[3]/\))*dCoef
186  * Questo pero' e' uguale a:
187  * (-Sa[3]/\*Sb[1])^T*dCoef,
188  * che puo' essere ulteriormente semplificato:
189  * (Sa[3].Cross(Sb[1])*(-dCoef))^T;
190  */
191 
192  MWedge = MWedge.Transpose();
193 
194  WM.Add(7, 1, MWedge);
195  WM.Sub(7, 4, MWedge);
196 
197  return WorkMat;
198 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:85
Definition: matvec3.h:98
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
const StructNode * pNode1
Definition: prismj.h:51
Mat3x3 R2h
Definition: prismj.h:54
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
Mat3x3 R1h
Definition: prismj.h:53
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Implements Elem.

Definition at line 202 of file prismj.cc.

References VectorHandler::Add(), ASSERT, DEBUGCOUT, StructNode::GetRCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), M, pNode1, pNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), R1h, R2h, VectorHandler::ResizeReset(), VectorHandler::Sub(), and WorkSpaceDim().

206 {
207  DEBUGCOUT("Entering PrismaticJoint::AssRes()" << std::endl);
208 
209  /* Dimensiona e resetta la matrice di lavoro */
210  integer iNumRows = 0;
211  integer iNumCols = 0;
212  this->WorkSpaceDim(&iNumRows, &iNumCols);
213  WorkVec.ResizeReset(iNumRows);
214 
215  /* Indici */
216  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex()+3;
217  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex()+3;
218  integer iFirstReactionIndex = iGetFirstIndex();
219 
220  /* Indici dei nodi */
221  for (int iCnt = 1; iCnt <= 3; iCnt++) {
222  WorkVec.PutRowIndex(0+iCnt, iNode1FirstMomIndex+iCnt);
223  WorkVec.PutRowIndex(3+iCnt, iNode2FirstMomIndex+iCnt);
224 
225  WorkVec.PutRowIndex(6+iCnt, iFirstReactionIndex+iCnt);
226  }
227 
228  /* Aggiorna i dati propri */
229  M = Vec3(XCurr, iFirstReactionIndex+1);
230 
231  /* Costruisce i dati propri nella configurazione corrente */
232  Mat3x3 R1hTmp(pNode1->GetRCurr()*R1h);
233  Mat3x3 R2hTmp(pNode2->GetRCurr()*R2h);
234 
235  Vec3 e1a(R1hTmp.GetVec(1));
236  Vec3 e2a(R1hTmp.GetVec(2));
237  Vec3 e3a(R1hTmp.GetVec(3));
238  Vec3 e1b(R2hTmp.GetVec(1));
239  Vec3 e2b(R2hTmp.GetVec(2));
240  Vec3 e3b(R2hTmp.GetVec(3));
241 
242  Vec3 MTmp(Mat3x3(e2a.Cross(e3b), e3a.Cross(e1b), e1a.Cross(e2b))*M);
243 
244  /* Equazioni di equilibrio, nodo 1 */
245  WorkVec.Sub(1, MTmp);
246 
247  /* Equazioni di equilibrio, nodo 2 */
248  WorkVec.Add(4, MTmp);
249 
250  /* Modifica: divido le equazioni di vincolo per dCoef */
251  ASSERT(dCoef != 0.);
252 
253  /* Equazioni di vincolo di rotazione */
254  WorkVec.PutCoef(7, -(e3b.Dot(e2a)/dCoef));
255  WorkVec.PutCoef(8, -(e1b.Dot(e3a)/dCoef));
256  WorkVec.PutCoef(9, -(e2b.Dot(e1a)/dCoef));
257 
258  return WorkVec;
259 }
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:85
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: prismj.h:51
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
Mat3x3 R2h
Definition: prismj.h:54
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
#define ASSERT(expression)
Definition: colamd.c:977
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
Mat3x3 R1h
Definition: prismj.h:53
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 139 of file prismj.h.

References pNode1, and pNode2.

139  {
140  connectedNodes.resize(2);
141  connectedNodes[0] = pNode1;
142  connectedNodes[1] = pNode2;
143  };
const StructNode * pNode1
Definition: prismj.h:51
const StructNode * pNode2
Definition: prismj.h:52
DofOrder::Order PrismaticJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 78 of file prismj.h.

References DofOrder::ALGEBRAIC, and ASSERT.

78  {
79  ASSERT(i >= 0 && i < 5);
80  return DofOrder::ALGEBRAIC;
81  };
#define ASSERT(expression)
Definition: colamd.c:977
DofOrder::Order PrismaticJoint::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 67 of file prismj.cc.

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

68 {
70  "INDEX ERROR in PrismaticJoint::GetEqType");
71  return DofOrder::ALGEBRAIC;
72 }
#define ASSERTMSGBREAK(expr, msg)
Definition: myassert.h:222
virtual unsigned int iGetNumDof(void) const
Definition: prismj.h:74

Here is the call graph for this function:

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

Implements Joint.

Definition at line 70 of file prismj.h.

References Joint::PRISMATIC.

70  {
71  return Joint::PRISMATIC;
72  };
virtual unsigned int PrismaticJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 112 of file prismj.h.

112  {
113  return 6;
114  };
virtual unsigned int PrismaticJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 74 of file prismj.h.

Referenced by GetEqType().

74  {
75  return 3;
76  };
VariableSubMatrixHandler & PrismaticJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 347 of file prismj.cc.

References FullSubMatrixHandler::Add(), DEBUGCOUT, 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().

349 {
350  DEBUGCOUT("Entering PrismaticJoint::InitialAssJac()" << std::endl);
351 
352  /* Per ora usa la matrice piena; eventualmente si puo'
353  * passare a quella sparsa quando si ottimizza */
354  FullSubMatrixHandler& WM = WorkMat.SetFull();
355 
356  /* Dimensiona e resetta la matrice di lavoro */
357  integer iNumRows = 0;
358  integer iNumCols = 0;
359  this->InitialWorkSpaceDim(&iNumRows, &iNumCols);
360  WM.ResizeReset(iNumRows, iNumCols);
361 
362 
363  /* Indici */
364  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex()+3;
365  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
366  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex()+3;
367  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
368  integer iFirstReactionIndex = iGetFirstIndex();
369  integer iReactionPrimeIndex = iFirstReactionIndex+3;
370 
371  /* Nota: le reazioni vincolari sono:
372  * Momento, 3 incognite, riferimento locale
373  */
374 
375  /* Setta gli indici dei nodi */
376  for (int iCnt = 1; iCnt <= 3; iCnt++) {
377  WM.PutRowIndex(0+iCnt, iNode1FirstPosIndex+iCnt);
378  WM.PutColIndex(0+iCnt, iNode1FirstPosIndex+iCnt);
379  WM.PutRowIndex(3+iCnt, iNode1FirstVelIndex+iCnt);
380  WM.PutColIndex(3+iCnt, iNode1FirstVelIndex+iCnt);
381  WM.PutRowIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
382  WM.PutColIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
383  WM.PutRowIndex(9+iCnt, iNode2FirstVelIndex+iCnt);
384  WM.PutColIndex(9+iCnt, iNode2FirstVelIndex+iCnt);
385  }
386 
387  /* Setta gli indici delle reazioni */
388  for (int iCnt = 1; iCnt <= 6; iCnt++) {
389  WM.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
390  WM.PutColIndex(12+iCnt, iFirstReactionIndex+iCnt);
391  }
392 
393  /* Recupera i dati */
394  Mat3x3 R1(pNode1->GetRRef());
395  Mat3x3 R2(pNode2->GetRRef());
396  Vec3 Omega1(pNode1->GetWRef());
397  Vec3 Omega2(pNode2->GetWRef());
398  /* M e' gia' stato aggiornato da InitialAssRes */
399  Vec3 MPrime(XCurr, iReactionPrimeIndex+1);
400 
401  /* Distanze e matrici di rotazione dai nodi alla cerniera
402  * nel sistema globale */
403  Mat3x3 R1hTmp(R1*R1h);
404  Mat3x3 R2hTmp(R2*R2h);
405 
406  Vec3 e1a(R1hTmp.GetVec(1));
407  Vec3 e2a(R1hTmp.GetVec(2));
408  Vec3 e3a(R1hTmp.GetVec(3));
409  Vec3 e1b(R2hTmp.GetVec(1));
410  Vec3 e2b(R2hTmp.GetVec(2));
411  Vec3 e3b(R2hTmp.GetVec(3));
412 
413  /* */
414  Mat3x3 MWedge(Mat3x3(MatCrossCross, e3b, e2a*M(1))
415  + Mat3x3(MatCrossCross, e1b, e3a*M(2))
416  + Mat3x3(MatCrossCross, e2b, e1a*M(3)));
417  Mat3x3 MWedgeT(MWedge.Transpose());
418 
419  /* Equilibrio */
420  WM.Add(1, 1, MWedge);
421  WM.Sub(1, 7, MWedgeT);
422 
423  WM.Add(7, 1, MWedgeT);
424  WM.Sub(7, 7, MWedge);
425 
426  /* Derivate dell'equilibrio */
427  WM.Add(4, 4, MWedge);
428  WM.Sub(4, 10, MWedgeT);
429 
430  WM.Add(10, 4, MWedgeT);
431  WM.Sub(10, 10, MWedge);
432 
433 
434  MWedge =
435  ( (Mat3x3(MatCrossCross, e3b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e3b*M(1))))
436  + Mat3x3(MatCross, e3b*MPrime(1)) )*Mat3x3(MatCross, e2a)
437  +( (Mat3x3(MatCrossCross, e1b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e1b*M(2))))
438  +Mat3x3(MatCross, e1b*MPrime(2)) )*Mat3x3(MatCross, e3a)
439  +( (Mat3x3(MatCrossCross, e2b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e2b*M(3))))
440  +Mat3x3(MatCross, e2b*MPrime(3)) )*Mat3x3(MatCross, e1a);
441 
442  WM.Add(4, 1, MWedge);
443  WM.Sub(10, 1, MWedge);
444 
445  MWedge =
446  ( (Mat3x3(MatCrossCross, e2a, Omega2) + Mat3x3(MatCross, Omega1.Cross(e2a*M(1))))
447  + Mat3x3(MatCross, e2a*MPrime(1)) )*Mat3x3(MatCross, e3b)
448  +( (Mat3x3(MatCrossCross, e3a, Omega2) + Mat3x3(MatCross, Omega1.Cross(e3a*M(2))))
449  + Mat3x3(MatCross, e3a*MPrime(2)) )*Mat3x3(MatCross, e1b)
450  +( (Mat3x3(MatCrossCross, e1a, Omega2) + Mat3x3(MatCross, Omega1.Cross(e1a*M(3))))
451  + Mat3x3(MatCross, e1a*MPrime(3)) )*Mat3x3(MatCross, e2b);
452 
453  WM.Sub(4, 7, MWedge);
454  WM.Add(10, 7, MWedge);
455 
456  Vec3 v1(e2a.Cross(e3b));
457  Vec3 v2(e3a.Cross(e1b));
458  Vec3 v3(e1a.Cross(e2b));
459 
460  /* Error handling: il programma si ferma, pero' segnala dov'e' l'errore */
461  if (v1.Dot() < std::numeric_limits<doublereal>::epsilon()
462  || v2.Dot() < std::numeric_limits<doublereal>::epsilon()
463  || v3.Dot() < std::numeric_limits<doublereal>::epsilon())
464  {
465  silent_cerr("PrismaticJoint(" << GetLabel() << "): "
466  "first and second node hinge axes are (nearly) orthogonal"
467  << std::endl);
469  }
470 
471  MWedge = Mat3x3(v1, v2, v3);
472 
473  /* Equilibrio */
474  WM.Add(1, 13, MWedge);
475  WM.Sub(7, 13, MWedge);
476 
477  /* Derivate dell'equilibrio */
478  WM.Add(4, 16, MWedge);
479  WM.Sub(10, 16, MWedge);
480 
481 
482  MWedge = MWedge.Transpose();
483 
484  /* Equaz. di vincolo */
485  WM.Add(13, 1, MWedge);
486  WM.Sub(13, 7, MWedge);
487 
488  /* Devivate delle equaz. di vincolo */
489  WM.Add(16, 4, MWedge);
490  WM.Sub(16, 10, MWedge);
491 
492  v1 = e3b.Cross(e2a.Cross(Omega1)) + e2a.Cross(Omega2.Cross(e3b));
493  v2 = e1b.Cross(e3a.Cross(Omega1)) + e3a.Cross(Omega2.Cross(e1b));
494  v3 = e2b.Cross(e1a.Cross(Omega1)) + e1a.Cross(Omega2.Cross(e2b));
495 
496  MWedge = Mat3x3(v1, v2, v3);
497 
498  /* Derivate dell'equilibrio */
499  WM.Add(4, 13, MWedge);
500  WM.Sub(10, 13, MWedge);
501 
502  /* Devivate delle equaz. di vincolo */
503  Omega1 = Omega1 - Omega2;
504 
505  v1 = e2a.Cross(e3b.Cross(Omega1));
506  Vec3 v1p(e3b.Cross(Omega1.Cross(e2a)));
507  v2 = e3a.Cross(e1b.Cross(Omega1));
508  Vec3 v2p(e1b.Cross(Omega1.Cross(e3a)));
509  v3 = e1a.Cross(e2b.Cross(Omega1));
510  Vec3 v3p(e2b.Cross(Omega1.Cross(e1a)));
511 
512  for (int iCnt = 1; iCnt <= 3; iCnt++) {
513  doublereal d = v1(iCnt);
514  WM.PutCoef(16, 0+iCnt, d);
515  d = v1p(iCnt);
516  WM.PutCoef(16, 6+iCnt, d);
517 
518  d = v2(iCnt);
519  WM.PutCoef(17, 0+iCnt, d);
520  d = v2p(iCnt);
521  WM.PutCoef(17, 6+iCnt, d);
522 
523  d = v3(iCnt);
524  WM.PutCoef(18, 0+iCnt, d);
525  d = v3p(iCnt);
526  WM.PutCoef(18, 6+iCnt, d);
527  }
528 
529  return WorkMat;
530 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
const StructNode * pNode1
Definition: prismj.h:51
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:115
Mat3x3 R2h
Definition: prismj.h:54
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
Mat3x3 R1h
Definition: prismj.h:53
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 535 of file prismj.cc.

References VectorHandler::Add(), Vec3::Cross(), DEBUGCOUT, grad::Dot(), StructNode::GetRCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, pNode1, pNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), R1h, R2h, and VectorHandler::ResizeReset().

537 {
538  DEBUGCOUT("Entering PrismaticJoint::InitialAssRes()" << std::endl);
539 
540  /* Dimensiona e resetta la matrice di lavoro */
541  integer iNumRows = 0;
542  integer iNumCols = 0;
543  this->InitialWorkSpaceDim(&iNumRows, &iNumCols);
544  WorkVec.ResizeReset(iNumRows);
545 
546  /* Indici */
547  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex()+3;
548  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
549  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex()+3;
550  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
551  integer iFirstReactionIndex = iGetFirstIndex();
552  integer iReactionPrimeIndex = iFirstReactionIndex+3;
553 
554  /* Setta gli indici */
555  for (int iCnt = 1; iCnt <= 3; iCnt++) {
556  WorkVec.PutRowIndex(0+iCnt, iNode1FirstPosIndex+iCnt);
557  WorkVec.PutRowIndex(3+iCnt, iNode1FirstVelIndex+iCnt);
558  WorkVec.PutRowIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
559  WorkVec.PutRowIndex(9+iCnt, iNode2FirstVelIndex+iCnt);
560  }
561 
562  for (int iCnt = 1; iCnt <= 6; iCnt++) {
563  WorkVec.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
564  }
565 
566  /* Recupera i dati */
567  Mat3x3 R1(pNode1->GetRCurr());
568  Mat3x3 R2(pNode2->GetRCurr());
569  Vec3 Omega1(pNode1->GetWCurr());
570  Vec3 Omega2(pNode2->GetWCurr());
571 
572  /* Aggiorna M, che resta anche per InitialAssJac */
573  M = Vec3(XCurr, iFirstReactionIndex+1);
574  Vec3 MPrime(XCurr, iReactionPrimeIndex+1);
575 
576  /* Vincolo nel sistema globale */
577  Mat3x3 R1hTmp(R1*R1h);
578  Mat3x3 R2hTmp(R2*R2h);
579 
580  Vec3 e1a(R1hTmp.GetVec(1));
581  Vec3 e2a(R1hTmp.GetVec(2));
582  Vec3 e3a(R1hTmp.GetVec(3));
583  Vec3 e1b(R2hTmp.GetVec(1));
584  Vec3 e2b(R2hTmp.GetVec(2));
585  Vec3 e3b(R2hTmp.GetVec(3));
586 
587  Vec3 MTmp(e2a.Cross(e3b*M(1))
588  +e3a.Cross(e1b*M(2))
589  +e1a.Cross(e2b*M(3)));
590 
591  /* Equazioni di equilibrio, nodo 1 */
592  WorkVec.Add(1, -MTmp);
593 
594  /* Equazioni di equilibrio, nodo 2 */
595  WorkVec.Add(7, MTmp);
596 
597  MTmp =
598  (e2a.Cross(Omega2.Cross(e3b)) - e3b.Cross(Omega1.Cross(e2a)))*M(1)
599  +(e3a.Cross(Omega2.Cross(e1b)) - e1b.Cross(Omega1.Cross(e3a)))*M(2)
600  +(e1a.Cross(Omega2.Cross(e2b)) - e2b.Cross(Omega1.Cross(e1a)))*M(3)
601  +e2a.Cross(e3b*MPrime(1))
602  +e3a.Cross(e1b*MPrime(2))
603  +e1a.Cross(e2b*MPrime(3));
604 
605  /* Derivate delle equazioni di equilibrio, nodo 1 */
606  WorkVec.Add(4, -MTmp);
607 
608  /* Derivate delle equazioni di equilibrio, nodo 2 */
609  WorkVec.Add(10, MTmp);
610 
611  /* Equazioni di vincolo di rotazione */
612  WorkVec.PutCoef(13, -(e3b.Dot(e2a)));
613  WorkVec.PutCoef(14, -(e1b.Dot(e3a)));
614  WorkVec.PutCoef(15, -(e2b.Dot(e1a)));
615 
616  /* Derivate delle equazioni di vincolo di rotazione */
617  Omega2 = Omega2-Omega1;
618  WorkVec.PutCoef(16, (e2a.Cross(e3b)).Dot(Omega2));
619  WorkVec.PutCoef(17, (e3a.Cross(e1b)).Dot(Omega2));
620  WorkVec.PutCoef(18, (e1a.Cross(e2b)).Dot(Omega2));
621 
622  return WorkVec;
623 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: prismj.h:51
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: prismj.h:115
Mat3x3 R2h
Definition: prismj.h:54
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
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 PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
Mat3x3 R1h
Definition: prismj.h:53
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 115 of file prismj.h.

Referenced by InitialAssJac(), and InitialAssRes().

116  {
117  *piNumRows = 18;
118  *piNumCols = 18;
119  };
void PrismaticJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 275 of file prismj.cc.

References ToBeOutput::bToBeOutput(), OutputHandler::GetCurrentStep(), WithLabel::GetLabel(), StructNode::GetRCurr(), OutputHandler::JOINTS, OutputHandler::Joints(), M, Joint::Output(), Vec3::pGetVec(), pNode1, R1h, OutputHandler::UseNetCDF(), OutputHandler::UseText(), and Zero3.

276 {
277  if (bToBeOutput()) {
278  Mat3x3 R1Tmp(pNode1->GetRCurr()*R1h);
279 
280 #ifdef USE_NETCDF
282  Var_F_local->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
283  Var_M_local->put_rec(M.pGetVec(), OH.GetCurrentStep());
284  Var_F_global->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
285  Var_M_global->put_rec((R1Tmp*M).pGetVec(), OH.GetCurrentStep());
286  }
287 #endif // USE_NETCDF
288 
289 
290  if (OH.UseText(OutputHandler::JOINTS)) {
291  Joint::Output(OH.Joints(), "PlaneHinge", GetLabel(),
292  Zero3, M, Zero3, R1Tmp*M) << std::endl;
293  }
294  }
295 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
bool UseNetCDF(int out) const
Definition: output.cc:491
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: prismj.h:51
long GetCurrentStep(void) const
Definition: output.h:116
std::ostream & Joints(void) const
Definition: output.h:443
Mat3x3 R1h
Definition: prismj.h:53
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
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 PrismaticJoint::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 262 of file prismj.cc.

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

263 {
264  if (bToBeOutput()) {
265 #ifdef USE_NETCDF
267  std::string name;
268  OutputPrepare_int("prismatic", OH, name);
269  }
270 #endif // USE_NETCDF
271  }
272 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
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

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 324 of file prismj.cc.

References STRLENOF.

325 {
326  if (strncasecmp(s, "hinge{" /*}*/, STRLENOF("hinge{" /*}*/)) == 0) {
327  s += STRLENOF("hinge{" /*}*/);
328 
329  if (strcmp(&s[1], /*{*/ "}") != 0) {
330  return 0;
331  }
332 
333  switch (s[0]) {
334  case '1':
335  return new Joint::HingeHint<1>;
336 
337  case '2':
338  return new Joint::HingeHint<2>;
339  }
340  }
341 
342  return 0;
343 }
#define STRLENOF(s)
Definition: mbdyn.h:166
std::ostream & PrismaticJoint::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 76 of file prismj.cc.

References WithLabel::GetLabel(), Mat3x3::GetVec(), pNode1, pNode2, R1h, R2h, Joint::Restart(), and Write().

77 {
78  Joint::Restart(out) << ", prismatic, "
79  << pNode1->GetLabel()
80  << ", hinge, reference, node, 1, ", (R1h.GetVec(1)).Write(out, ", ")
81  << ", 2, ", (R1h.GetVec(2)).Write(out, ", ") << ", "
82  << pNode2->GetLabel()
83  << ", hinge, reference, node, 1, ", (R2h.GetVec(1)).Write(out, ", ")
84  << ", 2, ", (R2h.GetVec(2)).Write(out, ", ") << ';' << std::endl;
85 
86  return out;
87 }
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
const StructNode * pNode1
Definition: prismj.h:51
Mat3x3 R2h
Definition: prismj.h:54
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
Mat3x3 R1h
Definition: prismj.h:53
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Reimplemented from Joint.

Definition at line 298 of file prismj.cc.

References StructNode::GetRCurr(), pNode1, pNode2, R1h, R2h, and Mat3x3::Transpose().

301 {
302  if (ph) {
303  for (unsigned i = 0; i < ph->size(); i++) {
304  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
305 
306  if (pjh == 0) {
307  continue;
308  }
309 
310  if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
312 
313  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
315 
316  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
317  /* TODO */
318  }
319  }
320  }
321 }
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pNode1
Definition: prismj.h:51
Mat3x3 R2h
Definition: prismj.h:54
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Mat3x3 R1h
Definition: prismj.h:53
const StructNode * pNode2
Definition: prismj.h:52

Here is the call graph for this function:

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

Implements Elem.

Definition at line 85 of file prismj.h.

Referenced by AssJac(), and AssRes().

85  {
86  *piNumRows = 9;
87  *piNumCols = 9;
88  };

Member Data Documentation

Vec3 PrismaticJoint::M
private

Definition at line 55 of file prismj.h.

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

const StructNode* PrismaticJoint::pNode1
private
const StructNode* PrismaticJoint::pNode2
private
Mat3x3 PrismaticJoint::R1h
private

Definition at line 53 of file prismj.h.

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

Mat3x3 PrismaticJoint::R2h
private

Definition at line 54 of file prismj.h.

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


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