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

#include <autostr.h>

Inheritance diagram for AutomaticStructElem:
Collaboration diagram for AutomaticStructElem:

Public Member Functions

 AutomaticStructElem (const DynamicStructNode *pN)
 
virtual ~AutomaticStructElem (void)
 
void Init (const Vec3 &b, const Vec3 &g, const Vec3 &bp, const Vec3 &gp)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void AddInertia (const doublereal &dm, const Vec3 &dS, const Mat3x3 &dJ)
 
virtual const Vec3GetS (void) const
 
virtual const Mat3x3GetJ (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
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 DofOrder::Order GetEqType (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 Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
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 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 AutomaticStructDispElem
 AutomaticStructDispElem (const DynamicStructDispNode *pN)
 
virtual ~AutomaticStructDispElem (void)
 
void Init (const Vec3 &b, const Vec3 &bp)
 
virtual Elem::Type GetElemType (void) const
 
virtual void AddInertia (const doublereal &dm)
 
virtual doublereal dGetM (void) const
 

Protected Member Functions

virtual const Vec3GetGCurr (void) const
 
virtual const Vec3GetGPCurr (void) const
 
virtual void ComputeAccelerations (Vec3 &XPP, Vec3 &WP) const
 
- Protected Member Functions inherited from AutomaticStructDispElem
virtual const Vec3GetBCurr (void) const
 
virtual const Vec3GetBPCurr (void) const
 
virtual void ComputeAccelerations (Vec3 &XPP) const
 

Protected Attributes

Vec3 G
 
Vec3 GP
 
Vec3 S
 
Mat3x3 J
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from AutomaticStructDispElem
DynamicStructDispNodepNode
 
Vec3 B
 
Vec3 BP
 
doublereal m
 

Friends

class DynamicStructNode
 

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 }
 

Detailed Description

Definition at line 184 of file autostr.h.

Constructor & Destructor Documentation

AutomaticStructElem::AutomaticStructElem ( const DynamicStructNode pN)

Definition at line 389 of file autostr.cc.

References ASSERT, AutomaticStructDispElem::pNode, and DynamicStructDispNode::SetAutoStr().

392 G(Zero3), GP(Zero3),
393 S(Zero3), J(Zero3x3)
394 {
395  ASSERT(dynamic_cast<const DynamicStructNode *>(pNode) != 0);
396  pNode->SetAutoStr(this);
397 }
const Vec3 Zero3(0., 0., 0.)
AutomaticStructDispElem(const DynamicStructDispNode *pN)
Definition: autostr.cc:42
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual void SetAutoStr(const AutomaticStructDispElem *p)
Definition: strnode.h:582
#define ASSERT(expression)
Definition: colamd.c:977
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual flag fToBeOutput(void) const
Definition: output.cc:884
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

virtual AutomaticStructElem::~AutomaticStructElem ( void  )
inlinevirtual

Definition at line 203 of file autostr.h.

References NO_OP.

203  {
204  NO_OP;
205  };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void AutomaticStructElem::AddInertia ( const doublereal dm,
const Vec3 dS,
const Mat3x3 dJ 
)
virtual

Definition at line 418 of file autostr.cc.

References dS, J, AutomaticStructDispElem::m, and S.

420 {
421  m += dm;
422  S += dS;
423  J += dJ;
424 }
const doublereal dS
Definition: beamslider.cc:71
VariableSubMatrixHandler & AutomaticStructElem::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 454 of file autostr.cc.

References AutomaticStructDispElem::B, DEBUGCOUTFNAME, StructDispNode::GetVCurr(), RigidBodyKinematics::GetW(), DynamicStructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), StructDispNode::pGetRBK(), AutomaticStructDispElem::pNode, SparseSubMatrixHandler::PutCross(), SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

458 {
459  DEBUGCOUTFNAME("AutomaticStructElem::AssJac");
460 
461  /* Casting di WorkMat */
462  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
463 
464  /* Dimensiona e resetta la matrice di lavoro */
465  integer iCoefs = 24;
466  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
467  if (pRBK) {
468  iCoefs += 12;
469  }
470  WM.ResizeReset(iCoefs, 0);
471 
472  /* Setta gli indici della matrice - le incognite sono ordinate come:
473  * - posizione (3)
474  * - parametri di rotazione (3)
475  * - quantita' di moto (3)
476  * - momento della quantita' di moto
477  * e gli indici sono consecutivi. La funzione pGetFirstPositionIndex()
478  * ritorna il valore del primo indice -1, in modo che l'indice i-esimo
479  * e' dato da iGetFirstPositionIndex()+i
480  */
481  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
482  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
483 
484  for (int iCnt = 1; iCnt <= 6; iCnt++) {
485  WM.PutItem(iCnt, iFirstPositionIndex + iCnt,
486  iFirstMomentumIndex + iCnt, -dCoef);
487  WM.PutItem(6+iCnt, iFirstMomentumIndex + iCnt,
488  iFirstMomentumIndex + iCnt, 1.);
489  }
490 
491  WM.PutCross(13, iFirstMomentumIndex + 3,
492  iFirstMomentumIndex, pNode->GetVCurr()*dCoef);
493  WM.PutCross(19, iFirstMomentumIndex + 3,
494  iFirstPositionIndex, -B);
495 
496  // relative frame dynamics contribution
497  // (see tecman, "Dynamics in a Relative Reference Frame")
498  if (pRBK) {
499  const Vec3& W0 = pRBK->GetW();
500 
501  WM.PutCross(25, iFirstMomentumIndex,
502  iFirstMomentumIndex, W0*(2.*dCoef));
503  WM.PutCross(31, iFirstMomentumIndex + 3,
504  iFirstMomentumIndex + 3, W0*dCoef);
505  }
506 
507  return WorkMat;
508 }
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
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual const Vec3 & GetW(void) const =0
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
long int integer
Definition: colamd.c:51
virtual integer iGetFirstMomentumIndex(void) const
Definition: strnode.h:602

Here is the call graph for this function:

void AutomaticStructElem::AssMats ( VariableSubMatrixHandler WorkMatA,
VariableSubMatrixHandler WorkMatB,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Reimplemented from Elem.

Definition at line 513 of file autostr.cc.

References AutomaticStructDispElem::B, DEBUGCOUTFNAME, StructDispNode::GetVCurr(), DynamicStructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), AutomaticStructDispElem::pNode, SparseSubMatrixHandler::PutCross(), SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

517 {
518  DEBUGCOUTFNAME("AutomaticStructElem::AssMats");
519 
520  /* Casting di WorkMat */
521  SparseSubMatrixHandler& WMA = WorkMatA.SetSparse();
522  SparseSubMatrixHandler& WMB = WorkMatB.SetSparse();
523 
524  /* Dimensiona e resetta la matrice di lavoro */
525  WMA.ResizeReset(12, 0);
526  WMB.ResizeReset(12, 0);
527 
528  /* Setta gli indici della matrice - le incognite sono ordinate come:
529  * - posizione (3)
530  * - parametri di rotazione (3)
531  * - quantita' di moto (3)
532  * - momento della quantita' di moto
533  * e gli indici sono consecutivi. La funzione pGetFirstPositionIndex()
534  * ritorna il valore del primo indice -1, in modo che l'indice i-esimo
535  * e' dato da iGetFirstPositionIndex()+i
536  */
537  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
538  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
539 
540  for (int iCnt = 1; iCnt <= 6; iCnt++) {
541  WMA.PutItem(iCnt, iFirstPositionIndex + iCnt,
542  iFirstMomentumIndex + iCnt, -1.);
543  WMB.PutItem(iCnt, iFirstMomentumIndex + iCnt,
544  iFirstMomentumIndex + iCnt, 1.);
545  }
546 
547  WMA.PutCross(7, iFirstMomentumIndex + 3, iFirstMomentumIndex,
548  pNode->GetVCurr());
549  WMB.PutCross(7, iFirstMomentumIndex + 3, iFirstPositionIndex, -B);
550 }
#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
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
long int integer
Definition: colamd.c:51
virtual integer iGetFirstMomentumIndex(void) const
Definition: strnode.h:602

Here is the call graph for this function:

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

Implements Elem.

Definition at line 555 of file autostr.cc.

References VectorHandler::Add(), AutomaticStructDispElem::B, AutomaticStructDispElem::BP, Vec3::Cross(), DEBUGCOUTFNAME, G, StructDispNode::GetVCurr(), RigidBodyKinematics::GetW(), GP, DynamicStructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), J, AutomaticStructDispElem::m, StructDispNode::pGetRBK(), AutomaticStructDispElem::pNode, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), S, VectorHandler::Sub(), Zero3, and Zero3x3.

559 {
560  DEBUGCOUTFNAME("AutomaticStructElem::AssRes");
561 
562  WorkVec.ResizeReset(12);
563 
564  integer iFirstPositionIndex = pNode->iGetFirstPositionIndex();
565  integer iFirstMomentumIndex = pNode->iGetFirstMomentumIndex();
566  for (integer iCnt = 1; iCnt <= 12; iCnt++) {
567  WorkVec.PutRowIndex(iCnt, iFirstPositionIndex + iCnt);
568  }
569 
570  /* Collects data */
571  B = Vec3(XCurr, iFirstMomentumIndex + 1);
572  G = Vec3(XCurr, iFirstMomentumIndex + 4);
573  BP = Vec3(XPrimeCurr, iFirstMomentumIndex + 1);
574  GP = Vec3(XPrimeCurr, iFirstMomentumIndex + 4);
575 
576  /*
577  * Momentum and momenta moment (about node):
578  *
579  * B = m V + W /\ S
580  *
581  * G = S /\ V + J W
582  *
583  * Bp = F
584  *
585  * Gp + V /\ B = M
586  */
587  WorkVec.Add(1, B);
588  WorkVec.Add(4, G);
589  WorkVec.Sub(7, BP);
590  WorkVec.Sub(10, GP + pNode->GetVCurr().Cross(B));
591 
592  // relative frame dynamics contribution
593  // (see tecman, "Dynamics in a Relative Reference Frame")
594  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
595  if (pRBK) {
596  const Vec3& W0 = pRBK->GetW();
597 
598  WorkVec.Sub(7, W0.Cross(B*2.));
599  WorkVec.Sub(10, W0.Cross(G));
600  }
601 
602  // reset instantaneous inertia properties
603  m = 0.;
604  S = Zero3;
605  J = Zero3x3;
606 
607  return WorkVec;
608 }
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual const Vec3 & GetW(void) const =0
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
long int integer
Definition: colamd.c:51
virtual integer iGetFirstMomentumIndex(void) const
Definition: strnode.h:602

Here is the call graph for this function:

void AutomaticStructElem::ComputeAccelerations ( Vec3 XPP,
Vec3 WP 
) const
protectedvirtual

Definition at line 400 of file autostr.cc.

References ASSERT, AutomaticStructDispElem::B, AutomaticStructDispElem::BP, Vec3::Cross(), StructDispNode::GetVCurr(), GP, Mat3x3::IsSymmetric(), J, Mat3x3::LDLSolve(), AutomaticStructDispElem::m, MatCrossCross, AutomaticStructDispElem::pNode, S, and Zero3.

401 {
402  if (m == 0.) {
403  XPP = Zero3;
404  WP = Zero3;
405  return;
406  }
407 
408  Vec3 Xcg = S/m;
409  Mat3x3 Jcg = J + Mat3x3(MatCrossCross, Xcg, S);
410  const Vec3& V = pNode->GetVCurr();
411  const Vec3& W = dynamic_cast<const DynamicStructNode *>(pNode)->GetWCurr();
412  ASSERT(Jcg.IsSymmetric()); // NOTE: should be a run time test
413  WP = Jcg.LDLSolve(GP - Xcg.Cross(BP) - W.Cross(Jcg*W) + V.Cross(B));
414  XPP = (BP - WP.Cross(S) - W.Cross(W.Cross(S)))/m;
415 }
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
#define ASSERT(expression)
Definition: colamd.c:977
DynamicStructDispNode * pNode
Definition: autostr.h:48
Vec3 LDLSolve(const Vec3 &v) const
Definition: matvec3.cc:199
bool IsSymmetric(void) const
Definition: matvec3.h:1260
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

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

Reimplemented from AutomaticStructDispElem.

Definition at line 740 of file autostr.cc.

References AutomaticStructDispElem::B, AutomaticStructDispElem::BP, G, StructDispNode::GetVCurr(), StructNode::GetWCurr(), GP, and AutomaticStructDispElem::pNode.

741 {
742  if (i == 13) {
743  const StructNode *pSN = dynamic_cast<const StructNode *>(pNode);
744  return (B*pSN->GetVCurr() + G*pSN->GetWCurr())/2;
745  }
746 
747  unsigned int der = (i - 1)/6;
748  i -= 6*der;
749  unsigned int type = (i - 1)/3;
750  i -= 3*type;
751 
752  if (der) {
753  if (type) {
754  return GP(i);
755  }
756  return BP(i);
757 
758  } else {
759  if (type) {
760  return G(i);
761  }
762  return B(i);
763  }
764 }
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 283 of file autostr.h.

References AutomaticStructDispElem::pNode.

283  {
284  connectedNodes.resize(1);
285  connectedNodes[0] = pNode;
286  };
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual const Vec3& AutomaticStructElem::GetGCurr ( void  ) const
inlineprotectedvirtual

Reimplemented from AutomaticStructDispElem.

Definition at line 192 of file autostr.h.

References G.

192 { return G; };
virtual const Vec3& AutomaticStructElem::GetGPCurr ( void  ) const
inlineprotectedvirtual

Reimplemented from AutomaticStructDispElem.

Definition at line 193 of file autostr.h.

193 { return GP; };
virtual const Mat3x3& AutomaticStructElem::GetJ ( void  ) const
inlinevirtual

Reimplemented from AutomaticStructDispElem.

Definition at line 220 of file autostr.h.

References J.

220  {
221  return J;
222  };
virtual const Vec3& AutomaticStructElem::GetS ( void  ) const
inlinevirtual

Reimplemented from AutomaticStructDispElem.

Definition at line 216 of file autostr.h.

References S.

216  {
217  return S;
218  };
unsigned int AutomaticStructElem::iGetNumPrivData ( void  ) const
virtual

Reimplemented from AutomaticStructDispElem.

Definition at line 672 of file autostr.cc.

673 {
674  return 13;
675 }
unsigned int AutomaticStructElem::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from AutomaticStructDispElem.

Definition at line 678 of file autostr.cc.

References STRLENOF.

679 {
680  /*
681  * beta[1]
682  * beta[2]
683  * beta[3]
684  * gamma[1]
685  * gamma[2]
686  * gamma[3]
687  * betaP[1]
688  * betaP[2]
689  * betaP[3]
690  * gammaP[1]
691  * gammaP[2]
692  * gammaP[3]
693  * KE
694  */
695  unsigned int idx = 0;
696  if (strcmp(s, "KE") == 0) {
697  return 13;
698 
699  } else if (strncmp(s, "beta", STRLENOF("beta")) == 0) {
700  s += STRLENOF("beta");
701 
702  } else if (strncmp(s, "gamma", STRLENOF("gamma")) == 0) {
703  s += STRLENOF("gamma");
704  idx += 3;
705 
706  } else {
707  return 0;
708  }
709 
710  if (s[0] == 'P') {
711  s++;
712  idx += 6;
713  }
714 
715  if (s[0] != '[') {
716  return 0;
717  }
718  s++;
719 
720  switch (s[0]) {
721  case '1':
722  case '2':
723  case '3':
724  idx += s[0] - '0';
725  s++;
726  break;
727 
728  default:
729  return 0;
730  }
731 
732  if (s[0] != ']' && s[1] != '\0') {
733  return 0;
734  }
735 
736  return idx;
737 }
#define STRLENOF(s)
Definition: mbdyn.h:166
void AutomaticStructElem::Init ( const Vec3 b,
const Vec3 g,
const Vec3 bp,
const Vec3 gp 
)

Definition at line 428 of file autostr.cc.

References AutomaticStructDispElem::B, AutomaticStructDispElem::BP, G, and GP.

Referenced by DataManager::ReadElems().

430 {
431  B = b;
432  G = g;
433  BP = bp;
434  GP = gp;
435 }
void AutomaticStructElem::Output ( OutputHandler OH) const
virtual

Reimplemented from AutomaticStructDispElem.

Definition at line 634 of file autostr.cc.

References AutomaticStructDispElem::B, AutomaticStructDispElem::BP, ToBeOutput::bToBeOutput(), G, OutputHandler::GetCurrentStep(), WithLabel::GetLabel(), GP, OutputHandler::INERTIA, OutputHandler::Inertia(), Vec3::pGetVec(), OutputHandler::UseNetCDF(), and OutputHandler::UseText().

635 {
636  if (bToBeOutput()) {
637 #ifdef USE_NETCDF
639  Var_B->put_rec(B.pGetVec(), OH.GetCurrentStep());
640  Var_G->put_rec(G.pGetVec(), OH.GetCurrentStep());
641  Var_BP->put_rec(BP.pGetVec(), OH.GetCurrentStep());
642  Var_GP->put_rec(GP.pGetVec(), OH.GetCurrentStep());
643  }
644 #endif /* USE_NETCDF */
645 
647  OH.Inertia() << std::setw(8) << GetLabel()
648  << " " << B
649  << " " << G
650  << " " << BP
651  << " " << GP
652  << std::endl;
653  }
654  }
655 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
bool UseNetCDF(int out) const
Definition: output.cc:491
std::ostream & Inertia(void) const
Definition: output.h:436
long GetCurrentStep(void) const
Definition: output.h:116
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
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 AutomaticStructElem::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from AutomaticStructDispElem.

Definition at line 612 of file autostr.cc.

References ASSERT, ToBeOutput::bToBeOutput(), WithLabel::GetLabel(), OutputHandler::INERTIA, OutputHandler::IsOpen(), OutputHandler::NETCDF, and OutputHandler::UseNetCDF().

613 {
614  if (bToBeOutput()) {
615 #ifdef USE_NETCDF
618 
619  std::ostringstream os;
620  os << "node.struct." << GetLabel() << ".";
621 
622  std::string name(os.str());
623 
624  Var_B = OH.CreateVar<Vec3>(name + "B", "kg m/s", "momentum (X, Y, Z)");
625  Var_G = OH.CreateVar<Vec3>(name + "G", "kg m^2/s", "momenta moment (X, Y, Z)");
626  Var_BP = OH.CreateVar<Vec3>(name + "BP", "kg m/s^2", "momentum derivative (X, Y, Z)");
627  Var_GP = OH.CreateVar<Vec3>(name + "GP", "kg m^2/s^2", "momenta moment derivative (X, Y, Z)");
628  }
629 #endif // USE_NETCDF
630  }
631 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Definition at line 440 of file autostr.cc.

References AutomaticStructDispElem::B, AutomaticStructDispElem::BP, G, WithLabel::GetLabel(), GP, and Vec3::Write().

441 {
442  out << "automatic structural: " << GetLabel() << ", "
443  "reference, global, ", B.Write(out, ", ") << ", "
444  "reference, global, ", G.Write(out, ", ") << ", "
445  "reference, global, ", BP.Write(out, ", ") << ", "
446  "reference, global, ", GP.Write(out, ", ") << ";" << std::endl;
447 
448  return out;
449 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Reimplemented from AutomaticStructDispElem.

Definition at line 660 of file autostr.cc.

References AutomaticStructDispElem::BP, GP, DynamicStructDispNode::iGetFirstMomentumIndex(), AutomaticStructDispElem::pNode, and VectorHandler::Put().

663 {
665 
666  XP.Put(iIndex + 1, BP);
667  XP.Put(iIndex + 4, GP);
668 }
DynamicStructDispNode * pNode
Definition: autostr.h:48
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
long int integer
Definition: colamd.c:51
virtual integer iGetFirstMomentumIndex(void) const
Definition: strnode.h:602

Here is the call graph for this function:

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

Implements Elem.

Definition at line 244 of file autostr.h.

244  {
245  *piNumRows = 12;
246  *piNumCols = 6;
247  };

Friends And Related Function Documentation

friend class DynamicStructNode
friend

Definition at line 185 of file autostr.h.

Member Data Documentation

Vec3 AutomaticStructElem::G
protected

Definition at line 188 of file autostr.h.

Referenced by AssRes(), dGetPrivData(), GetGCurr(), Init(), Output(), and Restart().

Vec3 AutomaticStructElem::GP
protected

Definition at line 189 of file autostr.h.

Referenced by AssRes(), ComputeAccelerations(), dGetPrivData(), Init(), Output(), Restart(), and SetValue().

Mat3x3 AutomaticStructElem::J
mutableprotected

Definition at line 196 of file autostr.h.

Referenced by AddInertia(), AssRes(), ComputeAccelerations(), and GetJ().

Vec3 AutomaticStructElem::S
mutableprotected

Definition at line 193 of file autostr.h.

Referenced by AddInertia(), AssRes(), ComputeAccelerations(), and GetS().


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