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

#include <inline.h>

Inheritance diagram for InLineJoint:
Collaboration diagram for InLineJoint:

Public Member Functions

 InLineJoint (unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &RvTmp, const Vec3 &pTmp, flag fOut)
 
 ~InLineJoint (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual 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)
 
virtual void Output (OutputHandler &OH) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void 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 HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual 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 SetValue (DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
 
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
 
const Mat3x3 Rv
 
const Vec3 p
 
Vec3 F
 

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 39 of file inline.h.

Constructor & Destructor Documentation

InLineJoint::InLineJoint ( unsigned int  uL,
const DofOwner pDO,
const StructNode pN1,
const StructNode pN2,
const Mat3x3 RvTmp,
const Vec3 pTmp,
flag  fOut 
)

Definition at line 39 of file inline.cc.

References NO_OP.

42 : Elem(uL, fOut), Joint(uL, pDO, fOut),
43 pNode1(pN1), pNode2(pN2), Rv(RvTmp), p(pTmp), F(Zero3)
44 {
45  NO_OP;
46 };
const Vec3 Zero3(0., 0., 0.)
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
const Vec3 p
Definition: inline.h:45
#define NO_OP
Definition: myassert.h:74
const StructNode * pNode2
Definition: inline.h:42
const StructNode * pNode1
Definition: inline.h:41
Vec3 F
Definition: inline.h:47
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const Mat3x3 Rv
Definition: inline.h:44
InLineJoint::~InLineJoint ( void  )

Definition at line 49 of file inline.cc.

References NO_OP.

50 {
51  NO_OP;
52 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 73 of file inline.cc.

References DEBUGCOUTFNAME, Vec3::dGet(), F, StructNode::GetRRef(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), MatCrossCross, pNode1, pNode2, SparseSubMatrixHandler::PutCross(), SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::PutMat3x3(), SparseSubMatrixHandler::ResizeReset(), Rv, and VariableSubMatrixHandler::SetSparse().

77 {
78  DEBUGCOUTFNAME("InLineJoint::AssJac");
79  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
80 
81  WM.ResizeReset(69, 0);
82 
83  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
84  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
85  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
86  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
87  integer iFirstReactionIndex = iGetFirstIndex();
88 
89  Vec3 x2mx1(pNode2->GetXCurr()-pNode1->GetXCurr());
90  Mat3x3 RvTmp(pNode1->GetRRef()*Rv);
91  Vec3 FTmp(RvTmp*(F*dCoef));
92 
93 
94  Vec3 Tmp1_1(RvTmp.GetVec(1).Cross(x2mx1));
95  Vec3 Tmp1_2(RvTmp.GetVec(2).Cross(x2mx1));
96  for(int iCnt = 1; iCnt <= 3; iCnt++) {
97  doublereal d = RvTmp.dGet(iCnt, 1);
98  WM.PutItem(iCnt, iNode1FirstMomIndex+iCnt,
99  iFirstReactionIndex+1, -d);
100  WM.PutItem(3+iCnt, iNode2FirstMomIndex+iCnt,
101  iFirstReactionIndex+1, d);
102 
103  WM.PutItem(6+iCnt, iFirstReactionIndex+1,
104  iNode1FirstPosIndex+iCnt, -d);
105  WM.PutItem(9+iCnt, iFirstReactionIndex+1,
106  iNode2FirstPosIndex+iCnt, d);
107 
108  d = RvTmp.dGet(iCnt, 2);
109  WM.PutItem(12+iCnt, iNode1FirstMomIndex+iCnt,
110  iFirstReactionIndex+2, -d);
111  WM.PutItem(15+iCnt, iNode2FirstMomIndex+iCnt,
112  iFirstReactionIndex+2, d);
113 
114  WM.PutItem(18+iCnt, iFirstReactionIndex+2,
115  iNode1FirstPosIndex+iCnt, -d);
116  WM.PutItem(21+iCnt, iFirstReactionIndex+2,
117  iNode2FirstPosIndex+iCnt, d);
118 
119  d = Tmp1_1.dGet(iCnt);
120  WM.PutItem(24+iCnt, iNode1FirstMomIndex+3+iCnt,
121  iFirstReactionIndex+1, d);
122 
123  WM.PutItem(27+iCnt, iFirstReactionIndex+1,
124  iNode1FirstPosIndex+3+iCnt, d);
125 
126  d = Tmp1_2.dGet(iCnt);
127  WM.PutItem(30+iCnt, iNode1FirstMomIndex+3+iCnt,
128  iFirstReactionIndex+2, d);
129 
130  WM.PutItem(33+iCnt, iFirstReactionIndex+2,
131  iNode1FirstPosIndex+3+iCnt, d);
132  }
133 
134  WM.PutCross(36+1, iNode1FirstMomIndex,
135  iNode1FirstPosIndex+3, FTmp);
136  WM.PutCross(42+1, iNode1FirstMomIndex+3,
137  iNode1FirstPosIndex, -FTmp);
138  WM.PutMat3x3(48+1, iNode1FirstMomIndex+3,
139  iNode1FirstPosIndex+3, Mat3x3(MatCrossCross, x2mx1, FTmp));
140  WM.PutCross(57+1, iNode1FirstMomIndex+3,
141  iNode2FirstPosIndex, FTmp);
142  WM.PutCross(63+1, iNode2FirstMomIndex,
143  iNode2FirstPosIndex+3, -FTmp);
144 
145  return WorkMat;
146 }
void PutMat3x3(integer iSubIt, integer iFirstRow, integer iFirstCol, const Mat3x3 &m)
Definition: submat.cc:1331
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutCross(integer iSubIt, integer iFirstRow, integer iFirstCol, const Vec3 &v)
Definition: submat.cc:1236
const StructNode * pNode2
Definition: inline.h:42
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const StructNode * pNode1
Definition: inline.h:41
Vec3 F
Definition: inline.h:47
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const Mat3x3 Rv
Definition: inline.h:44

Here is the call graph for this function:

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

Implements Elem.

Definition at line 150 of file inline.cc.

References VectorHandler::Add(), ASSERT, DEBUGCOUTFNAME, Vec3::Dot(), F, StructNode::GetRCurr(), Mat3x3::GetVec(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), p, pNode1, pNode2, Vec3::Put(), VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), Rv, and VectorHandler::Sub().

154 {
155  DEBUGCOUTFNAME("InLineJoint::AssRes");
156  WorkVec.ResizeReset(14);
157 
158  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
159  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
160  integer iFirstReactionIndex = iGetFirstIndex();
161 
162  /* Indici equazioni */
163  for (int iCnt = 1; iCnt <= 6; iCnt++) {
164  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
165  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
166  }
167 
168  /* Indice equazione vincolo */
169  WorkVec.PutRowIndex(13, iFirstReactionIndex+1);
170  WorkVec.PutRowIndex(14, iFirstReactionIndex+2);
171 
172  Vec3 x2mx1(pNode2->GetXCurr()-pNode1->GetXCurr());
173  Mat3x3 RvTmp = pNode1->GetRCurr()*Rv;
174 
175  /* Aggiorna i dati propri */
176  F.Put(1, XCurr(iFirstReactionIndex+1));
177  F.Put(2, XCurr(iFirstReactionIndex+2));
178  Vec3 FTmp(RvTmp*F);
179 
180  WorkVec.Add(1, FTmp);
181  WorkVec.Add(4, x2mx1.Cross(FTmp)); /* ( = -p/\F) */
182  WorkVec.Sub(7, FTmp);
183 
184  ASSERT(dCoef != 0.);
185  WorkVec.PutCoef(13, (Rv.GetVec(1).Dot(p)-RvTmp.GetVec(1).Dot(x2mx1))/dCoef);
186  WorkVec.PutCoef(14, (Rv.GetVec(2).Dot(p)-RvTmp.GetVec(2).Dot(x2mx1))/dCoef);
187 
188  return WorkVec;
189 }
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
const Vec3 p
Definition: inline.h:45
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const StructNode * pNode2
Definition: inline.h:42
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual integer iGetFirstMomentumIndex(void) const =0
const StructNode * pNode1
Definition: inline.h:41
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 F
Definition: inline.h:47
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const Mat3x3 Rv
Definition: inline.h:44
void Put(unsigned short int iRow, const doublereal &dCoef)
Definition: matvec3.h:276

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 118 of file inline.h.

References pNode1, and pNode2.

118  {
119  connectedNodes.resize(2);
120  connectedNodes[0] = pNode1;
121  connectedNodes[1] = pNode2;
122  };
const StructNode * pNode2
Definition: inline.h:42
const StructNode * pNode1
Definition: inline.h:41
virtual DofOrder::Order InLineJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 69 of file inline.h.

References DofOrder::ALGEBRAIC, and ASSERT.

69  {
70  ASSERT(i >= 0 && i < 2);
71  return DofOrder::ALGEBRAIC;
72  };
#define ASSERT(expression)
Definition: colamd.c:977
DofOrder::Order InLineJoint::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 56 of file inline.cc.

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

57 {
59  "INDEX ERROR in InLineJoint::GetEqType");
60  return DofOrder::ALGEBRAIC;
61 }
#define ASSERTMSGBREAK(expr, msg)
Definition: myassert.h:222
virtual unsigned int iGetNumDof(void) const
Definition: inline.h:65

Here is the call graph for this function:

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

Implements Joint.

Definition at line 58 of file inline.h.

References Joint::J_INLINE.

58  {
59  return J_INLINE;
60  };
virtual unsigned int InLineJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 97 of file inline.h.

97  {
98  return 4;
99  };
virtual unsigned int InLineJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 65 of file inline.h.

Referenced by GetEqType().

65  {
66  return 2;
67  };
VariableSubMatrixHandler & InLineJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 230 of file inline.cc.

References FullSubMatrixHandler::Add(), grad::Cross(), DEBUGCOUTFNAME, F, StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWRef(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), MatCross, MatCrossCross, pNode1, pNode2, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), Rv, VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

232 {
233  DEBUGCOUTFNAME("InLineJoint::InitialAssJac");
234  FullSubMatrixHandler& WM = WorkMat.SetFull();
235  WM.ResizeReset(28, 28);
236 
237  /* Indici gdl */
238  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
239  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
240  integer iFirstReactionIndex = iGetFirstIndex();
241  integer iReactionPrimeIndex = iFirstReactionIndex+2;
242 
243  /* Indici equazioni nodi */
244  for(int iCnt = 1; iCnt <= 12; iCnt++) {
245  WM.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
246  WM.PutColIndex(iCnt, iNode1FirstPosIndex+iCnt);
247  WM.PutRowIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
248  WM.PutColIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
249  }
250 
251  /* Indici vincoli */
252  for(int iCnt = 1; iCnt <= 4; iCnt++) {
253  WM.PutRowIndex(24+iCnt, iFirstReactionIndex+iCnt);
254  WM.PutColIndex(24+iCnt, iFirstReactionIndex+iCnt);
255  }
256 
257  /* Dati */
258  Vec3 x2mx1(pNode2->GetXCurr()-pNode1->GetXCurr());
259  Vec3 xp2mxp1(pNode2->GetVCurr()-pNode1->GetVCurr());
260  Vec3 Omega(pNode1->GetWRef());
261 
262  /* Aggiorna i dati propri */
263  Vec3 FPrime(XCurr(iReactionPrimeIndex+1),
264  XCurr(iReactionPrimeIndex+2),
265  0.);
266  Mat3x3 RvTmp(pNode1->GetRRef()*Rv);
267  Vec3 FTmp(RvTmp*F);
268  Vec3 FPrimeTmp(RvTmp*FPrime);
269 
270  Vec3 v1(RvTmp.GetVec(1));
271  Vec3 Tmp1_1(v1.Cross(x2mx1));
272  Vec3 Tmp2_1(Omega.Cross(v1));
273  Vec3 Tmp3_1((Omega.Cross(x2mx1)-xp2mxp1).Cross(v1));
274  Vec3 Tmp4_1(-(xp2mxp1.Cross(v1)+x2mx1.Cross(Tmp2_1)));
275  Vec3 v2(RvTmp.GetVec(2));
276  Vec3 Tmp1_2(v2.Cross(x2mx1));
277  Vec3 Tmp2_2(Omega.Cross(v2));
278  Vec3 Tmp3_2((Omega.Cross(x2mx1)-xp2mxp1).Cross(v2));
279  Vec3 Tmp4_2(-(xp2mxp1.Cross(v2)+x2mx1.Cross(Tmp2_2)));
280  for(int iCnt = 1; iCnt <= 3; iCnt++) {
281  doublereal d = v1.dGet(iCnt);
282  WM.PutCoef(iCnt, 25, -d);
283  WM.PutCoef(12+iCnt, 25, d);
284 
285  WM.PutCoef(25, iCnt, -d);
286  WM.PutCoef(25, 12+iCnt, d);
287 
288  WM.PutCoef(6+iCnt, 27, -d);
289  WM.PutCoef(18+iCnt, 27, d);
290 
291  WM.PutCoef(27, 6+iCnt, -d);
292  WM.PutCoef(27, 18+iCnt, d);
293 
294  d = v2.dGet(iCnt);
295  WM.PutCoef(iCnt, 26, -d);
296  WM.PutCoef(12+iCnt, 26, d);
297 
298  WM.PutCoef(26, iCnt, -d);
299  WM.PutCoef(26, 12+iCnt, d);
300 
301  WM.PutCoef(6+iCnt, 28, -d);
302  WM.PutCoef(18+iCnt, 28, d);
303 
304  WM.PutCoef(28, 6+iCnt, -d);
305  WM.PutCoef(28, 18+iCnt, d);
306 
307  d = Tmp1_1.dGet(iCnt);
308  WM.PutCoef(3+iCnt, 25, d);
309  WM.PutCoef(25, 3+iCnt, d);
310 
311  WM.PutCoef(27, 9+iCnt, d);
312  WM.PutCoef(9+iCnt, 27, d);
313 
314  d = Tmp1_2.dGet(iCnt);
315  WM.PutCoef(3+iCnt, 26, d);
316  WM.PutCoef(26, 3+iCnt, d);
317 
318  WM.PutCoef(28, 9+iCnt, d);
319  WM.PutCoef(9+iCnt, 28, d);
320 
321  d = Tmp2_1.dGet(iCnt);
322  WM.PutCoef(27, iCnt, -d);
323  WM.PutCoef(27, 12+iCnt, d);
324 
325  WM.PutCoef(6+iCnt, 25, -d);
326  WM.PutCoef(18+iCnt, 25, d);
327 
328  d = Tmp2_2.dGet(iCnt);
329  WM.PutCoef(28, iCnt, -d);
330  WM.PutCoef(28, 12+iCnt, d);
331 
332  WM.PutCoef(6+iCnt, 26, -d);
333  WM.PutCoef(18+iCnt, 26, d);
334 
335  d = Tmp3_1.dGet(iCnt);
336  WM.PutCoef(27, 3+iCnt, d);
337 
338  d = Tmp3_2.dGet(iCnt);
339  WM.PutCoef(28, 3+iCnt, d);
340 
341  d = Tmp4_1.dGet(iCnt);
342  WM.PutCoef(9+iCnt, 25, d);
343 
344  d = Tmp4_2.dGet(iCnt);
345  WM.PutCoef(9+iCnt, 27, d);
346  }
347 
348  Mat3x3 MTmp(MatCross, FTmp);
349  WM.Add(1, 4, MTmp);
350  WM.Add(4, 13, MTmp);
351 
352  WM.Add(7, 10, MTmp);
353  WM.Add(10, 19, MTmp);
354 
355  WM.Sub(4, 1, MTmp);
356  WM.Sub(13, 4, MTmp);
357 
358  WM.Sub(19, 10, MTmp);
359  WM.Sub(10, 7, MTmp);
360 
361  MTmp = Mat3x3(MatCrossCross, x2mx1, FTmp);
362  WM.Add(4, 4, MTmp);
363 
364  WM.Add(10, 10, MTmp);
365 
366  MTmp = Mat3x3(MatCrossCross, Omega, FTmp) + Mat3x3(MatCross, FPrimeTmp);
367  WM.Add(7, 4, MTmp);
368  WM.Sub(19, 4, MTmp);
369 
370  MTmp = Mat3x3(MatCross, Omega.Cross(FTmp) + FPrimeTmp);
371  WM.Sub(10, 1, MTmp);
372  WM.Add(10, 13, MTmp);
373 
374  MTmp = Mat3x3((Mat3x3(MatCross, xp2mxp1) + Mat3x3(MatCrossCross, x2mx1, Omega))*Mat3x3(MatCross, FTmp)
375  + Mat3x3(MatCrossCross, x2mx1, FPrimeTmp));
376  WM.Add(10, 4, MTmp);
377 
378  return WorkMat;
379 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
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 StructNode * pNode2
Definition: inline.h:42
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const StructNode * pNode1
Definition: inline.h:41
Vec3 F
Definition: inline.h:47
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const Mat3x3 Rv
Definition: inline.h:44

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 384 of file inline.cc.

References VectorHandler::Add(), DEBUGCOUTFNAME, Vec3::Dot(), F, StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3x3::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), p, pNode1, pNode2, Vec3::Put(), VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), Rv, and VectorHandler::Sub().

386 {
387  DEBUGCOUTFNAME("InLineJoint::InitialAssRes");
388  WorkVec.ResizeReset(28);
389 
390  /* Indici gdl */
391  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
392  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
393  integer iFirstReactionIndex = iGetFirstIndex();
394  integer iReactionPrimeIndex = iFirstReactionIndex+2;
395 
396  /* Indici equazioni nodi */
397  for(int iCnt = 1; iCnt <= 12; iCnt++) {
398  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
399  WorkVec.PutRowIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
400  }
401 
402  /* Indici equazioni vincoli */
403  WorkVec.PutRowIndex(25, iFirstReactionIndex+1);
404  WorkVec.PutRowIndex(26, iFirstReactionIndex+2);
405  WorkVec.PutRowIndex(27, iReactionPrimeIndex+1);
406  WorkVec.PutRowIndex(28, iReactionPrimeIndex+2);
407 
408  /* Dati */
409  Vec3 x2mx1(pNode2->GetXCurr()-pNode1->GetXCurr());
410  Vec3 xp2mxp1(pNode2->GetVCurr()-pNode1->GetVCurr());
411  Mat3x3 RvTmp(pNode1->GetRCurr()*Rv);
412  Vec3 Omega(pNode1->GetWCurr());
413 
414  /* Aggiorna i dati propri */
415  F.Put(1, XCurr(iFirstReactionIndex+1));
416  F.Put(2, XCurr(iFirstReactionIndex+2));
417  Vec3 FPrime(XCurr(iReactionPrimeIndex+1),
418  XCurr(iReactionPrimeIndex+2),
419  0.);
420  Vec3 FTmp(RvTmp*F);
421  Vec3 FPrimeTmp(RvTmp*FPrime);
422  Vec3 Tmp(Omega.Cross(FTmp)+FPrimeTmp);
423 
424  WorkVec.Add(1, FTmp);
425  WorkVec.Add(4, x2mx1.Cross(FTmp)); /* ( = -p/\F) */
426  WorkVec.Add(7, Tmp);
427  WorkVec.Add(10, xp2mxp1.Cross(FTmp)+x2mx1.Cross(Tmp));
428  WorkVec.Sub(13, FTmp);
429  WorkVec.Sub(19, Tmp);
430 
431  WorkVec.PutCoef(25, Rv.GetVec(1).Dot(p)-RvTmp.GetVec(1).Dot(x2mx1));
432  WorkVec.PutCoef(26, Rv.GetVec(2).Dot(p)-RvTmp.GetVec(2).Dot(x2mx1));
433  WorkVec.PutCoef(27, x2mx1.Dot(RvTmp.GetVec(1).Cross(Omega))-RvTmp.GetVec(1).Dot(xp2mxp1));
434  WorkVec.PutCoef(28, x2mx1.Dot(RvTmp.GetVec(2).Cross(Omega))-RvTmp.GetVec(2).Dot(xp2mxp1));
435 
436  return WorkVec;
437 }
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
const Vec3 p
Definition: inline.h:45
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const StructNode * pNode2
Definition: inline.h:42
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const StructNode * pNode1
Definition: inline.h:41
Vec3 F
Definition: inline.h:47
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const Mat3x3 Rv
Definition: inline.h:44
void Put(unsigned short int iRow, const doublereal &dCoef)
Definition: matvec3.h:276

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 102 of file inline.h.

102  {
103  *piNumRows = 24+4;
104  *piNumCols = 24+4;
105  };
void InLineJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 204 of file inline.cc.

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

205 {
206  if (bToBeOutput()) {
207  Mat3x3 RvTmp(pNode1->GetRCurr()*Rv);
208 #ifdef USE_NETCDF
210  Var_F_local->put_rec(F.pGetVec(), OH.GetCurrentStep());
211  Var_M_local->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
212  Var_F_global->put_rec((RvTmp*F).pGetVec(), OH.GetCurrentStep());
213  Var_M_global->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
214  }
215 #endif // USE_NETCDF
216 
217 
218  if (OH.UseText(OutputHandler::JOINTS)) {
219 
220  Joint::Output(OH.Joints(), "inline", GetLabel(),
221  F, Zero3, RvTmp*F, Zero3) << std::endl;
222  // TODO: output relative position and orientation
223  }
224  }
225 }
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
long GetCurrentStep(void) const
Definition: output.h:116
std::ostream & Joints(void) const
Definition: output.h:443
const StructNode * pNode1
Definition: inline.h:41
Vec3 F
Definition: inline.h:47
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
const Mat3x3 Rv
Definition: inline.h:44
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

void InLineJoint::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 192 of file inline.cc.

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

193 {
194  if (bToBeOutput()) {
195 #ifdef USE_NETCDF
197  std::string name;
198  OutputPrepare_int("inline", OH, name);
199  }
200 #endif // USE_NETCDF
201  }
202 }
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:

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

Implements Elem.

Definition at line 65 of file inline.cc.

References Joint::Restart().

66 {
67  Joint::Restart(out) << ", in line, not implemented yet" << std::endl;
68  return out;
69 }
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195

Here is the call graph for this function:

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

Implements Elem.

Definition at line 74 of file inline.h.

74  {
75  *piNumRows = 12+2;
76  *piNumCols = 12+2;
77  };

Member Data Documentation

Vec3 InLineJoint::F
private

Definition at line 47 of file inline.h.

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

const Vec3 InLineJoint::p
private

Definition at line 45 of file inline.h.

Referenced by AssRes(), and InitialAssRes().

const StructNode* InLineJoint::pNode1
private

Definition at line 41 of file inline.h.

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

const StructNode* InLineJoint::pNode2
private

Definition at line 42 of file inline.h.

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

const Mat3x3 InLineJoint::Rv
private

Definition at line 44 of file inline.h.

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


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