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

#include <genj.h>

Inheritance diagram for DistanceJoint:
Collaboration diagram for DistanceJoint:

Public Member Functions

 DistanceJoint (unsigned int uL, const DofOwner *pDO, const StructDispNode *pN1, const StructDispNode *pN2, const DriveCaller *pDC, flag fOut)
 
 ~DistanceJoint (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 DofOrder::Order GetEqType (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)
 
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 SetInitialValue (VectorHandler &X)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & 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 std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Joint
 Joint (unsigned int uL, const DofOwner *pD, flag fOut)
 
virtual ~Joint (void)
 
virtual Elem::Type GetElemType (void) const
 
std::ostream & Output (std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
 
virtual void 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
 

Private Attributes

const StructDispNodepNode1
 
const StructDispNodepNode2
 
Vec3 v
 
doublereal dAlpha
 

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
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 

Detailed Description

Definition at line 44 of file genj.h.

Constructor & Destructor Documentation

DistanceJoint::DistanceJoint ( unsigned int  uL,
const DofOwner pDO,
const StructDispNode pN1,
const StructDispNode pN2,
const DriveCaller pDC,
flag  fOut 
)

Definition at line 49 of file genj.cc.

References NO_OP.

52 : Elem(uL, fOut),
53 Joint(uL, pDO, fOut),
54 DriveOwner(pDC),
55 pNode1(pN1), pNode2(pN2), v(Zero3), dAlpha(0.)
56 {
57  NO_OP;
58 }
const Vec3 Zero3(0., 0., 0.)
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
#define NO_OP
Definition: myassert.h:74
doublereal dAlpha
Definition: genj.h:49
const StructDispNode * pNode1
Definition: genj.h:46
Vec3 v
Definition: genj.h:48
const StructDispNode * pNode2
Definition: genj.h:47
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
DistanceJoint::~DistanceJoint ( void  )

Definition at line 62 of file genj.cc.

References NO_OP.

63 {
64  NO_OP;
65 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 111 of file genj.cc.

References ASSERT, dAlpha, DEBUGCOUT, Vec3::dGet(), DriveCaller::dGet(), Vec3::Dot(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), DriveOwner::pGetDriveCaller(), pNode1, pNode2, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetSparse(), grad::sqrt(), and v.

115 {
116  DEBUGCOUT("Entering DistanceJoint::AssJac()" << std::endl);
117 
118  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
119 
120  /* Dimensiona e resetta la matrice di lavoro */
121  doublereal dDistance = pGetDriveCaller()->dGet();
122 
123  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
124  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
125  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
126  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
127  integer iFirstReactionIndex = iGetFirstIndex();
128 
129  /*
130  * forza: dAlpha*v
131  * distanza: x2 - x1 = d*v
132  * equazione di normalizzazione di v:
133  * (v^T*v)^1/2 = 1
134  *
135  *
136  * x1 Q1 x2 Q2 v a
137  *
138  * x1 | 0 0 0 0 0 0 |
139  * Q1 | 0 0 0 0 -a*I -v |
140  * x2 | 0 0 0 0 0 0 |
141  * Q2 | 0 0 0 0 a*I v |
142  * v | -c*I 0 c*I 0 -d*I 0 |
143  * a | 0 0 0 0 v^T 0 |
144  * ----------
145  * (vT*v)^1/2
146  *
147  * con c = dCoef, a = dAlpha
148  */
149 
150  WM.ResizeReset(24, 0);
151 
152  /* Nota: la direzione della reazione, v,
153  * ed il coefficiente di amplificazione dAlpha
154  * sono stati aggiornati durante il calcolo del residuo */
155 
156  for (int iCnt = 1; iCnt <= 3; iCnt++) {
157  /* termini di Delta_x1 */
158  WM.PutItem(iCnt, iFirstReactionIndex+iCnt,
159  iNode1FirstPosIndex+iCnt, -dCoef);
160 
161  /* termini di Delta_x2 */
162  WM.PutItem(3+iCnt, iFirstReactionIndex+iCnt,
163  iNode2FirstPosIndex+iCnt, dCoef);
164 
165  /* termini di Delta_F sul nodo 1 */
166  WM.PutItem(6+iCnt, iNode1FirstMomIndex+iCnt,
167  iFirstReactionIndex+iCnt, -dAlpha);
168 
169  /* termini di Delta_F sul nodo 2 */
170  WM.PutItem(9+iCnt, iNode2FirstMomIndex+iCnt,
171  iFirstReactionIndex+iCnt, dAlpha);
172 
173  /* termini diagonali di Delta_v */
174  WM.PutItem(12+iCnt, iFirstReactionIndex+iCnt,
175  iFirstReactionIndex+iCnt, -dDistance);
176 
177  /* termini di Delta_alpha sul nodo 1 */
178  WM.PutItem(15+iCnt, iNode1FirstMomIndex+iCnt,
179  iFirstReactionIndex+4, -v.dGet(iCnt));
180 
181  /* termini di Delta_alpha sul nodo 2 */
182  WM.PutItem(18+iCnt, iNode2FirstMomIndex+iCnt,
183  iFirstReactionIndex+4, v.dGet(iCnt));
184  }
185 
186  doublereal d = v.Dot();
187  ASSERT(d > std::numeric_limits<doublereal>::epsilon());
188  if (d > std::numeric_limits<doublereal>::epsilon()) {
189  d = std::sqrt(d);
190  /* termini di Delta_v su alpha */
191  for (int iCnt = 3; iCnt > 0; iCnt--) {
192  WM.PutItem(21+iCnt, iFirstReactionIndex+4,
193  iFirstReactionIndex+iCnt, v.dGet(iCnt)/d);
194  }
195  }
196 
197  return WorkMat;
198 }
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
doublereal dAlpha
Definition: genj.h:49
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const StructDispNode * pNode1
Definition: genj.h:46
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: genj.h:48
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGet(const doublereal &dVar) const =0
const StructDispNode * pNode2
Definition: genj.h:47
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

Here is the call graph for this function:

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

Implements Elem.

Definition at line 202 of file genj.cc.

References VectorHandler::Add(), ASSERT, dAlpha, DEBUGCOUT, DriveCaller::dGet(), grad::fabs(), WithLabel::GetLabel(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), MBDYN_EXCEPT_ARGS, DriveOwner::pGetDriveCaller(), pNode1, pNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), grad::sqrt(), VectorHandler::Sub(), v, and WorkSpaceDim().

206 {
207  DEBUGCOUT("Entering DistanceJoint::AssRes()" << std::endl);
208 
209  /* Dimensiona e resetta la matrice di lavoro */
210  integer iNumRows = 0;
211  integer iNumCols = 0;
212  WorkSpaceDim(&iNumRows, &iNumCols);
213  WorkVec.ResizeReset(iNumRows);
214 
215  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
216  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
217  integer iFirstReactionIndex = iGetFirstIndex();
218 
219  for (int iCnt = 1; iCnt <= 3; iCnt++) {
220  /* Indici del nodo 1 */
221  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
222 
223  /* Indici del nodo 2 */
224  WorkVec.PutRowIndex(3+iCnt, iNode2FirstMomIndex+iCnt);
225  }
226 
227  /* Indici del vincolo */
228  for (int iCnt = 1; iCnt <= 4; iCnt++) {
229  WorkVec.PutRowIndex(6+iCnt, iFirstReactionIndex+iCnt);
230  }
231 
232  Vec3 x1(pNode1->GetXCurr());
233  Vec3 x2(pNode2->GetXCurr());
234 
235  /* Aggiorna i dati propri */
236  v = Vec3(XCurr, iFirstReactionIndex+1);
237  dAlpha = XCurr(iFirstReactionIndex+4);
238 
239  doublereal dDistance = pGetDriveCaller()->dGet();
240 
241  /* Distanza nulla */
242  if (fabs(dDistance) <= std::numeric_limits<doublereal>::epsilon()) {
243  silent_cerr("DistanceJoint(" << GetLabel() << "): "
244  "near-zero distance" << std::endl);
246  }
247 
248  Vec3 TmpVec(v*dAlpha);
249  WorkVec.Add(1, TmpVec);
250  WorkVec.Sub(4, TmpVec);
251 
252  WorkVec.Add(7, x1-x2+v*dDistance);
253 
254  doublereal d = v.Dot();
255  ASSERT(d > std::numeric_limits<doublereal>::epsilon());
256  if (d > std::numeric_limits<doublereal>::epsilon()) {
257  d = std::sqrt(d);
258  } else {
259  d = 0.;
260  }
261 
262  WorkVec.PutCoef(10, 1.-d);
263 
264  return WorkVec;
265 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: genj.h:81
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
doublereal dAlpha
Definition: genj.h:49
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructDispNode * pNode1
Definition: genj.h:46
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: genj.h:48
virtual integer iGetFirstMomentumIndex(void) const =0
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
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
virtual doublereal dGet(const doublereal &dVar) const =0
const StructDispNode * pNode2
Definition: genj.h:47
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:

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

Reimplemented from SimulationEntity.

Definition at line 88 of file genj.cc.

References ASSERT, DriveOwner::dGet(), and MBDYN_EXCEPT_ARGS.

89 {
90  ASSERT(i == 1);
91 
92  if (i == 1) {
93  return dGet();
94  }
95 
97 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal dGet(void) const
Definition: drive.cc:671
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 125 of file genj.h.

References pNode1, and pNode2.

125  {
126  connectedNodes.resize(2);
127  connectedNodes[0] = pNode1;
128  connectedNodes[1] = pNode2;
129  };
const StructDispNode * pNode1
Definition: genj.h:46
const StructDispNode * pNode2
Definition: genj.h:47
virtual DofOrder::Order DistanceJoint::GetDofType ( unsigned int  i) const
inlinevirtual

Reimplemented from Elem.

Definition at line 70 of file genj.h.

References DofOrder::ALGEBRAIC, and ASSERT.

71  {
72  ASSERT(i >= 0 && i < 4);
73  return DofOrder::ALGEBRAIC;
74  };
#define ASSERT(expression)
Definition: colamd.c:977
virtual DofOrder::Order DistanceJoint::GetEqType ( unsigned int  i) const
inlinevirtual

Reimplemented from SimulationEntity.

Definition at line 76 of file genj.h.

References DofOrder::DIFFERENTIAL.

77  {
79  };
virtual Joint::Type DistanceJoint::GetJointType ( void  ) const
inlinevirtual

Implements Joint.

Definition at line 60 of file genj.h.

References Joint::DISTANCE.

60  {
61  return Joint::DISTANCE;
62  };
virtual unsigned int DistanceJoint::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 98 of file genj.h.

98 { return 8; };
virtual unsigned int DistanceJoint::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 67 of file genj.h.

67  {
68  return 4;
69  };
unsigned int DistanceJoint::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 70 of file genj.cc.

71 {
72  return 1;
73 }
unsigned int DistanceJoint::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 76 of file genj.cc.

References ASSERT.

77 {
78  ASSERT(s != NULL);
79 
80  if (strcmp(s, "d") == 0) {
81  return 1;
82  }
83 
84  return 0;
85 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & DistanceJoint::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 290 of file genj.cc.

References ASSERT, dAlpha, DEBUGCOUT, Vec3::dGet(), DriveCaller::dGet(), Vec3::Dot(), StructDispNode::GetVCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), DriveOwner::pGetDriveCaller(), pNode1, pNode2, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetSparse(), grad::sqrt(), and v.

292 {
293  DEBUGCOUT("Entering DistanceJoint::InitialAssJac()" << std::endl);
294 
295  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
296 
297  /* Dimensiona e resetta la matrice di lavoro */
298  doublereal dDistance = pGetDriveCaller()->dGet();
299 
300  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
301  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
302  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
303  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
304  integer iFirstReactionIndex = iGetFirstIndex();
305  integer iReactionPrimeIndex = iFirstReactionIndex+4;
306 
307  /* Distanza nulla */
308  /*
309  * forza: dAlpha*v
310  * distanza: x2 - x1 = d*v
311  * equazione di normalizzazione di v:
312  * (v^T*v)^1/2 = 1
313  *
314  *
315  * x1 x1P x2 x2P v a w b
316  *
317  * x1 | 0 0 0 0 -a*I -v 0 0 |
318  * x1P | 0 0 0 0 0 0 -b*I -w |
319  * x2 | 0 0 0 0 a*I v 0 0 |
320  * x2P | 0 0 0 0 0 0 b*I w |
321  * v | -I 0 I 0 -d*I 0 0 0 |
322  * a | 0 0 0 0 r 0 0 0 |
323  * w | 0 0 0 0 -I 0 I 0 |
324  * b | 0 -w^T 0 w^T 0 0 s 0 |
325  *
326  * v^T
327  * r = ----------
328  * (vT*v)^1/2
329  *
330  * s = (x2P - x1P)^T
331  *
332  * a = dAlpha
333  */
334 
335  WM.ResizeReset(51, 1);
336 
337  /* Nota: la direzione della reazione, v,
338  * ed il coefficiente di amplificazione dAlpha
339  * sono stati aggiornati durante il calcolo del residuo */
340 
341  dAlpha = XCurr(iFirstReactionIndex+4);
342  doublereal dBeta = XCurr(iReactionPrimeIndex+4);
343  v = Vec3(XCurr, iFirstReactionIndex+1);
344  Vec3 w(XCurr, iReactionPrimeIndex+1);
345  Vec3 deltaXP(pNode2->GetVCurr()-pNode1->GetVCurr());
346 
347  for (int iCnt = 1; iCnt <= 3; iCnt++) {
348  doublereal d;
349 
350  d = dAlpha;
351  /* termini di Delta_v sul nodo 1 */
352  WM.PutItem(6+iCnt, iNode1FirstPosIndex+iCnt,
353  iFirstReactionIndex+iCnt, -d);
354 
355  /* termini di Delta_v sul nodo 2 */
356  WM.PutItem(9+iCnt, iNode2FirstPosIndex+iCnt,
357  iFirstReactionIndex+iCnt, d);
358 
359  d = v.dGet(iCnt);
360  /* termini di Delta_alpha sul nodo 1 */
361  WM.PutItem(12+iCnt, iNode1FirstPosIndex+iCnt,
362  iFirstReactionIndex+4, -d);
363 
364  /* termini di Delta_alpha sul nodo 2 */
365  WM.PutItem(15+iCnt, iNode2FirstPosIndex+iCnt,
366  iFirstReactionIndex+4, d);
367 
368  d = dBeta;
369  /* termini di Delta_w sul nodo 1 */
370  WM.PutItem(18+iCnt, iNode1FirstVelIndex+iCnt,
371  iReactionPrimeIndex+iCnt, -d);
372 
373  /* termini di Delta_w sul nodo 2 */
374  WM.PutItem(21+iCnt, iNode2FirstVelIndex+iCnt,
375  iReactionPrimeIndex+iCnt, d);
376 
377  d = w.dGet(iCnt);
378  /* termini di Delta_beta sul nodo 1 */
379  WM.PutItem(24+iCnt, iNode1FirstVelIndex+iCnt,
380  iReactionPrimeIndex+4, -d);
381 
382  /* termini di Delta_beta sul nodo 2 */
383  WM.PutItem(27+iCnt, iNode2FirstVelIndex+iCnt,
384  iReactionPrimeIndex+4, d);
385 
386  d = dDistance;
387  /* termini diagonali di Delta_v */
388  WM.PutItem(30+iCnt, iFirstReactionIndex+iCnt,
389  iFirstReactionIndex+iCnt, -d);
390 
391  /* termini diagonali di Delta_w */
392  WM.PutItem(33+iCnt, iReactionPrimeIndex+iCnt,
393  iReactionPrimeIndex+iCnt, 1.);
394 
395  /* termini incrociati di Delta_w Delta_v */
396  WM.PutItem(36+iCnt, iReactionPrimeIndex+iCnt,
397  iFirstReactionIndex+iCnt, -1.);
398 
399  d = w.dGet(iCnt);
400  /* termini di beta per Delta_x1P: w^T */
401  WM.PutItem(39+iCnt, iReactionPrimeIndex+4,
402  iNode1FirstVelIndex+iCnt, -d);
403 
404  /* termini di beta per Delta_x2P: w^T */
405  WM.PutItem(42+iCnt, iReactionPrimeIndex+4,
406  iNode2FirstVelIndex+iCnt, d);
407 
408  d = deltaXP.dGet(iCnt);
409  /* termini di beta per Delta_w: (x2P-x1P)^T */
410  WM.PutItem(45+iCnt, iReactionPrimeIndex+4,
411  iReactionPrimeIndex+iCnt, d);
412  }
413 
414 
415  /* termini di Delta_v su alpha */
416  doublereal d = v.Dot();
417  ASSERT(d > std::numeric_limits<doublereal>::epsilon());
418  if (d > std::numeric_limits<doublereal>::epsilon()) {
419  d = std::sqrt(d);
420  for (int iCnt = 1; iCnt <= 3; iCnt++) {
421  WM.PutItem(48+iCnt, iFirstReactionIndex+4,
422  iFirstReactionIndex+iCnt, v.dGet(iCnt)/d);
423  }
424  } else {
425  for (int iCnt = 1; iCnt <= 3; iCnt++) {
426  WM.PutItem(48+iCnt, iFirstReactionIndex+4,
427  iFirstReactionIndex+iCnt, 0.);
428  }
429  }
430 
431  for (int iCnt = 1; iCnt <= 3; iCnt++) {
432  /* termini di Delta_x1 */
433  WM.PutItem(iCnt, iFirstReactionIndex+iCnt,
434  iNode1FirstPosIndex+iCnt, -1.);
435 
436  /* termini di Delta_x2 */
437  WM.PutItem(iCnt+3, iFirstReactionIndex+iCnt,
438  iNode2FirstPosIndex+iCnt, 1.);
439  }
440 
441  return WorkMat;
442 }
Definition: matvec3.h:98
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
doublereal dAlpha
Definition: genj.h:49
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const StructDispNode * pNode1
Definition: genj.h:46
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: genj.h:48
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGet(const doublereal &dVar) const =0
const StructDispNode * pNode2
Definition: genj.h:47
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
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

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 447 of file genj.cc.

References VectorHandler::Add(), ASSERT, dAlpha, DEBUGCOUT, DriveCaller::dGet(), grad::Dot(), grad::fabs(), WithLabel::GetLabel(), StructDispNode::GetVCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstPositionIndex(), MBDYN_EXCEPT_ARGS, DriveOwner::pGetDriveCaller(), pNode1, pNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), grad::sqrt(), and v.

449 {
450  DEBUGCOUT("Entering DistanceJoint::InitialAssRes()" << std::endl);
451 
452  /* Dimensiona e resetta la matrice di lavoro */
453  WorkVec.ResizeReset(20);
454 
455  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
456  integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
457  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
458  integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
459  integer iFirstReactionIndex = iGetFirstIndex();
460  integer iReactionPrimeIndex = iFirstReactionIndex+4;
461 
462  for (int iCnt = 1; iCnt <= 3; iCnt++) {
463  /* Indici del nodo 1, posizione */
464  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
465 
466  /* Indici del nodo 1, velocita' */
467  WorkVec.PutRowIndex(3+iCnt, iNode1FirstVelIndex+iCnt);
468 
469  /* Indici del nodo 2, posizione */
470  WorkVec.PutRowIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
471 
472  /* Indici del nodo 2, velocita' */
473  WorkVec.PutRowIndex(9+iCnt, iNode2FirstVelIndex+iCnt);
474  }
475 
476  /* Indici del vincolo */
477  for (int iCnt = 1; iCnt <= 8; iCnt++) {
478  WorkVec.PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
479  }
480 
481  Vec3 x1(pNode1->GetXCurr());
482  Vec3 x2(pNode2->GetXCurr());
483  Vec3 x1P(pNode1->GetVCurr());
484  Vec3 x2P(pNode2->GetVCurr());
485  v = Vec3(XCurr, iFirstReactionIndex+1);
486  Vec3 w(XCurr, iReactionPrimeIndex+1);
487  dAlpha = XCurr(iFirstReactionIndex+4);
488  doublereal dBeta = XCurr(iReactionPrimeIndex+4);
489 
490  doublereal dDistance = pGetDriveCaller()->dGet();
491 
492  /* Distanza nulla */
493  if (fabs(dDistance) <= std::numeric_limits<doublereal>::epsilon()) {
494  silent_cerr("DistanceJoint(" << GetLabel() << "): "
495  "near-zero distance" << std::endl);
497  }
498  WorkVec.Add(0+1, v*dAlpha);
499  WorkVec.Add(3+1, w*dBeta);
500  WorkVec.Add(6+1, -v*dAlpha);
501  WorkVec.Add(9+1, -w*dBeta);
502  WorkVec.Add(12+1, x1-x2+v*dDistance);
503 
504  doublereal d = v.Dot();
505  ASSERT(d > std::numeric_limits<doublereal>::epsilon());
506  if(d > std::numeric_limits<doublereal>::epsilon()) {
507  d = std::sqrt(d);
508  } else {
509  d = 0.;
510  }
511 
512  WorkVec.PutCoef(15+1, 1.-d);
513 
514  WorkVec.Add(16+1, v-w);
515  WorkVec.PutCoef(19+1, (x1P-x2P).Dot(w));
516 
517  return WorkVec;
518 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
doublereal dAlpha
Definition: genj.h:49
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructDispNode * pNode1
Definition: genj.h:46
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: genj.h:48
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
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
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
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
virtual doublereal dGet(const doublereal &dVar) const =0
const StructDispNode * pNode2
Definition: genj.h:47
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
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:

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

Implements SubjectToInitialAssembly.

Definition at line 99 of file genj.h.

101  { *piNumRows = 20; *piNumCols = 20; };
void DistanceJoint::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 268 of file genj.cc.

References ToBeOutput::bToBeOutput(), dAlpha, DriveOwner::dGet(), grad::fabs(), WithLabel::GetLabel(), OutputHandler::Joints(), Joint::Output(), v, and Zero3.

269 {
270  if(bToBeOutput()) {
271  doublereal d = dGet();
272  Vec3 vTmp;
273  if (fabs(d) > std::numeric_limits<doublereal>::epsilon()) {
274  vTmp = Vec3(dAlpha, 0., 0.);
275  } else {
276  vTmp = v;
277  }
278  Joint::Output(OH.Joints(), "Distance", GetLabel(),
279  vTmp, Zero3, v*dAlpha, Zero3)
280  << " " << v << " " << d << std::endl;
281  }
282 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
doublereal dGet(void) const
Definition: drive.cc:671
doublereal dAlpha
Definition: genj.h:49
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Vec3 v
Definition: genj.h:48
std::ostream & Joints(void) const
Definition: output.h:443
double doublereal
Definition: colamd.c:52
std::ostream & Output(std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
Definition: joint.cc:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Definition at line 100 of file genj.cc.

References WithLabel::GetLabel(), DriveOwner::pGetDriveCaller(), pNode1, pNode2, Joint::Restart(), and DriveCaller::Restart().

101 {
102  Joint::Restart(out) << ", distance, "
103  << pNode1->GetLabel() << ", "
104  << pNode2->GetLabel() << ", ";
105  return pGetDriveCaller()->Restart(out) << ';' << std::endl;
106 }
virtual std::ostream & Restart(std::ostream &out) const =0
const StructDispNode * pNode1
Definition: genj.h:46
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const StructDispNode * pNode2
Definition: genj.h:47
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void DistanceJoint::SetInitialValue ( VectorHandler X)
virtual

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

Reimplemented from Joint.

Definition at line 521 of file genj.cc.

References DriveCaller::dGet(), Vec3::Dot(), grad::fabs(), WithLabel::GetLabel(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), MBDYN_EXCEPT_ARGS, DriveOwner::pGetDriveCaller(), pNode1, pNode2, VectorHandler::Put(), grad::sqrt(), and v.

522 {
523  integer iFirstIndex = iGetFirstIndex();
524 
525  doublereal dDistance = pGetDriveCaller()->dGet();
526  if (fabs(dDistance) <= std::numeric_limits<doublereal>::epsilon()) {
527  silent_cerr("DistanceJoint(" << GetLabel() << "): "
528  "near-zero distance" << std::endl);
530  }
531 
532  v = ((pNode2->GetXCurr())-(pNode1->GetXCurr()));
533  doublereal d = v.Dot();
534  if (d < std::numeric_limits<doublereal>::epsilon()) {
535  silent_cerr("DistanceJoint(" << GetLabel() << "): "
536  "initial length is null" << std::endl);
538  }
539  v /= std::sqrt(d);
540 
541  X.Put(iFirstIndex+1, v);
542  X.Put(iFirstIndex+4+1, v);
543 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
const StructDispNode * pNode1
Definition: genj.h:46
Vec3 v
Definition: genj.h:48
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual doublereal dGet(const doublereal &dVar) const =0
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
const StructDispNode * pNode2
Definition: genj.h:47
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:

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

Reimplemented from Joint.

Definition at line 547 of file genj.cc.

References DriveCaller::dGet(), Vec3::Dot(), grad::fabs(), WithLabel::GetLabel(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), MBDYN_EXCEPT_ARGS, DriveHint::pCreateDrive(), DriveOwner::pGetDriveCaller(), pNode1, pNode2, VectorHandler::Put(), DriveOwner::Set(), grad::sqrt(), WithLabel::uLabel, and v.

550 {
551  if (ph) {
552  for (unsigned i = 0; i < ph->size(); i++) {
553  DriveHint *pdh = dynamic_cast<DriveHint *>((*ph)[i]);
554 
555  if (pdh) {
556  pedantic_cout("DistanceJoint(" << uLabel << "): "
557  "creating drive from hint[" << i << "]..." << std::endl);
558 
559  DriveCaller *pDC = pdh->pCreateDrive(pDM);
560  if (pDC == 0) {
561  silent_cerr("DistanceJoint(" << uLabel << "): "
562  "unable to create drive after hint "
563  "#" << i << std::endl);
565  }
566 
567  DriveOwner::Set(pDC);
568  continue;
569  }
570  }
571  }
572 
573  doublereal dDistance = pGetDriveCaller()->dGet();
574 
575  /* Setta a 1 dAlpha, che e' indipendente dalle altre variabili
576  * in caso di distanza nulla */
577  if (fabs(dDistance) <= std::numeric_limits<doublereal>::epsilon()) {
578  silent_cerr("DistanceJoint(" << uLabel << "): "
579  "near-zero distance" << std::endl);
581  }
582 
583  /* Scrive la direzione della distanza. Se e' stata ottenuta con
584  * l'assemblaggio iniziale bene, se no' la calcola */
585  v = pNode2->GetXCurr() - pNode1->GetXCurr();
586  doublereal d = v.Dot();
587  if (d <= std::numeric_limits<doublereal>::epsilon()) {
588  silent_cerr("DistanceJoint(" << uLabel << ") "
589  "linked to nodes " << pNode1->GetLabel()
590  << " and " << pNode2->GetLabel() << ": "
591  "nodes are coincident;" << std::endl
592  << "initial joint assembly is recommended"
593  << std::endl);
595  }
596  v /= std::sqrt(d);
597 
598  /* Scrittura sul vettore soluzione */
599  X.Put(iGetFirstIndex() + 1, v);
600 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
const StructDispNode * pNode1
Definition: genj.h:46
Vec3 v
Definition: genj.h:48
unsigned int uLabel
Definition: withlab.h:44
DriveCaller * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.cc:117
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual doublereal dGet(const doublereal &dVar) const =0
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
const StructDispNode * pNode2
Definition: genj.h:47
void Set(const DriveCaller *pDC)
Definition: drive.cc:647
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
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 DistanceJoint::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 81 of file genj.h.

Referenced by AssRes().

82  { *piNumRows = 10; *piNumCols = 10; };

Member Data Documentation

doublereal DistanceJoint::dAlpha
private

Definition at line 49 of file genj.h.

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

const StructDispNode* DistanceJoint::pNode1
private
const StructDispNode* DistanceJoint::pNode2
private
Vec3 DistanceJoint::v
mutableprivate

Definition at line 48 of file genj.h.

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


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