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

#include <body_vm.h>

Inheritance diagram for VariableBody:
Collaboration diagram for VariableBody:

Public Member Functions

 VariableBody (unsigned int uL, const StructNode *pNode, const DriveCaller *pDCMass, const TplDriveCaller< Vec3 > *pDCXgc, const TplDriveCaller< Mat3x3 > *pDCJgc_vm, const TplDriveCaller< Mat3x3 > *pDCJgc_vg, flag fOut)
 
virtual ~VariableBody (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
const StructNodepGetNode (void) const
 
virtual Elem::Type GetElemType (void) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
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 void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const =0
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
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
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) 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 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 OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
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 ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)=0
 
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 InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const =0
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)=0
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)=0
 

Protected Member Functions

Vec3 GetS_int (void) const
 
Mat3x3 GetJ_int (void) const
 
void AssVecRBK_int (SubVectorHandler &WorkVec)
 
void AssMatsRBK_int (FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, const doublereal &dCoef, const Vec3 &Sc)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Protected Attributes

const StructNodepNode
 
DriveOwner m_Mass
 
TplDriveOwner< Vec3m_Xgc
 
TplDriveOwner< Mat3x3m_Jgc_vm
 
TplDriveOwner< Mat3x3m_Jgc_vg
 
doublereal dMTmp
 
Vec3 STmp
 
Mat3x3 JTmp
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 

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 45 of file body_vm.h.

Constructor & Destructor Documentation

VariableBody::VariableBody ( unsigned int  uL,
const StructNode pNode,
const DriveCaller pDCMass,
const TplDriveCaller< Vec3 > *  pDCXgc,
const TplDriveCaller< Mat3x3 > *  pDCJgc_vm,
const TplDriveCaller< Mat3x3 > *  pDCJgc_vg,
flag  fOut 
)

Definition at line 43 of file body_vm.cc.

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

50 : Elem(uL, fOut),
51 ElemGravityOwner(uL, fOut),
52 InitialAssemblyElem(uL, fOut),
53 pNode(pNode),
54 m_Mass(pDCMass),
55 m_Xgc(pDCXgc),
56 m_Jgc_vm(pDCJgc_vm),
57 m_Jgc_vg(pDCJgc_vg)
58 {
59  ASSERT(pNode != 0);
60  ASSERT(pNode->GetNodeType() == Node::STRUCTURAL);
61 }
DriveOwner m_Mass
Definition: body_vm.h:50
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
ElemGravityOwner(unsigned int uL, flag fOut)
Definition: gravity.cc:223
TplDriveOwner< Mat3x3 > m_Jgc_vm
Definition: body_vm.h:52
TplDriveOwner< Mat3x3 > m_Jgc_vg
Definition: body_vm.h:53
#define ASSERT(expression)
Definition: colamd.c:977
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const StructNode * pNode
Definition: body_vm.h:48
InitialAssemblyElem(unsigned int uL, flag fOut)
Definition: elem.cc:233
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

VariableBody::~VariableBody ( void  )
virtual

Definition at line 65 of file body_vm.cc.

References NO_OP.

66 {
67  NO_OP;
68 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void VariableBody::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 105 of file body_vm.cc.

References DriveOwner::dGet(), dMTmp, TplDriveOwner< T >::Get(), StructNode::GetRRef(), JTmp, m_Jgc_vg, m_Jgc_vm, m_Mass, m_Xgc, MatCrossCross, pNode, R, and STmp.

106 {
107  const Mat3x3& R = pNode->GetRRef();
108 
109  dMTmp = m_Mass.dGet();
110  Vec3 x(m_Xgc.Get());
111  STmp = (R*x)*dMTmp;
112  JTmp = R*(m_Jgc_vm.Get() + m_Jgc_vg.Get() + Mat3x3(MatCrossCross, x, x*dMTmp)).MulMT(R);
113 }
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
DriveOwner m_Mass
Definition: body_vm.h:50
Mat3x3 JTmp
Definition: body_vm.h:57
TplDriveOwner< Mat3x3 > m_Jgc_vm
Definition: body_vm.h:52
doublereal dMTmp
Definition: body_vm.h:55
TplDriveOwner< Mat3x3 > m_Jgc_vg
Definition: body_vm.h:53
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
Vec3 STmp
Definition: body_vm.h:56
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
const StructNode * pNode
Definition: body_vm.h:48
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
Mat3x3 R

Here is the call graph for this function:

void VariableBody::AssMatsRBK_int ( FullSubMatrixHandler WMA,
FullSubMatrixHandler WMB,
const doublereal dCoef,
const Vec3 Sc 
)
protected

Definition at line 239 of file body_vm.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), dMTmp, StructDispNode::GetVCurr(), RigidBodyKinematics::GetW(), StructNode::GetWCurr(), RigidBodyKinematics::GetWP(), StructDispNode::GetXCurr(), RigidBodyKinematics::GetXPP(), JTmp, MatCross, MatCrossCross, StructDispNode::pGetRBK(), pNode, STmp, and FullSubMatrixHandler::Sub().

Referenced by DynamicVariableBody::AssMats(), and StaticVariableBody::AssMats().

244 {
245  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
246 
247  Mat3x3 MTmp;
248  Vec3 VTmp;
249 
250  integer iIdx = 0;
251  if (dynamic_cast<DynamicVariableBody *>(this)) {
252  iIdx = 6;
253  }
254 
255  // f: delta x
256  MTmp = Mat3x3(MatCross, pRBK->GetWP());
257  MTmp += Mat3x3(MatCrossCross, pRBK->GetW(), pRBK->GetW());
258 
259  WMA.Add(iIdx + 1, 1, MTmp*(dMTmp*dCoef));
260 
261 
262  // f: theta delta
263 
264  WMA.Sub(iIdx + 1, 3 + 1, MTmp*Mat3x3(MatCross, Sc));
265 
266 
267  // m: delta x
268  MTmp = Mat3x3(MatCrossCross, Sc, pRBK->GetWP());
269  MTmp += Sc.Cross(Mat3x3(MatCrossCross, pRBK->GetW(), pRBK->GetW()));
270 
271  WMA.Add(iIdx + 3 + 1, 1, MTmp);
272 
273 
274  // m: theta delta
275 
276  VTmp = pRBK->GetXPP();
277  VTmp += pRBK->GetWP().Cross(pNode->GetXCurr());
278  VTmp += pRBK->GetW().Cross(pRBK->GetW().Cross(pNode->GetXCurr()));
279  VTmp += pRBK->GetW().Cross(pNode->GetVCurr());
280 
281  MTmp = Mat3x3(MatCrossCross, VTmp, Sc);
282 
283  VTmp = (pRBK->GetW() + pNode->GetWCurr())*dCoef;
284 
285  Mat3x3 MTmp2(JTmp*Mat3x3(MatCross, pRBK->GetW()) - Mat3x3(MatCross, JTmp*pRBK->GetW()));
286  MTmp += VTmp.Cross(MTmp2);
287 
288  VTmp = (pRBK->GetWP() + pRBK->GetW().Cross(pNode->GetWCurr()))*dCoef;
289 
290  MTmp += JTmp*Mat3x3(MatCross, VTmp);
291  MTmp -= Mat3x3(MatCross, JTmp*VTmp);
292 
293  MTmp -= pNode->GetVCurr().Cross(Mat3x3(MatCrossCross, pRBK->GetW(), Sc));
294 
295  WMA.Add(iIdx + 3 + 1, 3 + 1, MTmp);
296 
297 
298  // m: delta dot x
299  MTmp = Mat3x3(MatCrossCross, STmp, pRBK->GetW());
300  MTmp -= Mat3x3(MatCross, pRBK->GetW().Cross(STmp));
301 
302  WMB.Add(iIdx + 3 + 1, 1, MTmp);
303 
304  // m: delta omega
305  WMB.Add(iIdx + 3 + 1, 3 + 1, MTmp2);
306 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
Mat3x3 JTmp
Definition: body_vm.h:57
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual const Vec3 & GetXPP(void) const =0
doublereal dMTmp
Definition: body_vm.h:55
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
Vec3 STmp
Definition: body_vm.h:56
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual const Vec3 & GetWP(void) const =0
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
const StructNode * pNode
Definition: body_vm.h:48
virtual const Vec3 & GetW(void) const =0
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void VariableBody::AssVecRBK_int ( SubVectorHandler WorkVec)
protected

Definition at line 197 of file body_vm.cc.

References a, Vec3::Cross(), DriveOwner::dGet(), dMTmp, StructDispNode::GetVCurr(), RigidBodyKinematics::GetW(), StructNode::GetWCurr(), RigidBodyKinematics::GetWP(), StructDispNode::GetXCurr(), RigidBodyKinematics::GetXPP(), JTmp, m_Mass, StructDispNode::pGetRBK(), pNode, STmp, and VectorHandler::Sub().

Referenced by DynamicVariableBody::AssRes(), and StaticVariableBody::AssRes().

198 {
199  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
200 
201  // NOTE: dMTmp, STmp, JTmp updated earlier
202 
203  Vec3 s0;
204 
205  integer iIdx = 0;
206  if (dynamic_cast<DynamicVariableBody *>(this)) {
207  iIdx = 6;
208  }
209 
210  s0 = pNode->GetXCurr()*m_Mass.dGet() + STmp;
211 
212  // force
213  Vec3 f;
214  f = pRBK->GetXPP()*dMTmp;
215  f += pRBK->GetWP().Cross(s0);
216  f += pRBK->GetW().Cross(pRBK->GetW().Cross(s0));
217 
218  WorkVec.Sub(iIdx + 1, f);
219 
220  // moment
221  Vec3 a;
222  a = pRBK->GetXPP();
223  a += pRBK->GetWP().Cross(pNode->GetXCurr());
224  a += pRBK->GetW().Cross(pRBK->GetW().Cross(pNode->GetXCurr()));
225  a += pRBK->GetW().Cross(pNode->GetVCurr());
226 
227  Vec3 m;
228  m = STmp.Cross(a);
229  m += pRBK->GetW().Cross(JTmp*pRBK->GetW());
230  m += JTmp*pRBK->GetWP();
231  m += pNode->GetWCurr().Cross(JTmp*pRBK->GetW());
232  m -= JTmp*(pNode->GetWCurr().Cross(pRBK->GetW()));
233  m += pNode->GetVCurr().Cross(pRBK->GetW().Cross(STmp));
234 
235  WorkVec.Sub(iIdx + 3 + 1, m);
236 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
DriveOwner m_Mass
Definition: body_vm.h:50
Mat3x3 JTmp
Definition: body_vm.h:57
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual const Vec3 & GetXPP(void) const =0
doublereal dMTmp
Definition: body_vm.h:55
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
Vec3 STmp
Definition: body_vm.h:56
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual const Vec3 & GetWP(void) const =0
const StructNode * pNode
Definition: body_vm.h:48
virtual const Vec3 & GetW(void) const =0
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
static const doublereal a
Definition: hfluid_.h:289
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

doublereal VariableBody::dGetM ( void  ) const
virtual

Reimplemented from ElemGravityOwner.

Definition at line 117 of file body_vm.cc.

References DriveOwner::dGet(), and m_Mass.

118 {
119  return m_Mass.dGet();
120 }
DriveOwner m_Mass
Definition: body_vm.h:50
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

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

Reimplemented from SimulationEntity.

Definition at line 167 of file body_vm.cc.

References GravityOwner::bGetGravity(), Vec3::Cross(), DriveOwner::dGet(), Vec3::Dot(), TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), m_Jgc_vg, m_Jgc_vm, m_Mass, m_Xgc, and pNode.

168 {
169  if (i == 1) {
170  // kinetic energy
171  const Mat3x3& Rn = pNode->GetRCurr();
172  const Vec3& Vn = pNode->GetVCurr();
173  const Vec3& Wn = pNode->GetWCurr();
174 
175  Vec3 DXgc = Rn*m_Xgc.Get();
176  Vec3 V = Vn + Wn.Cross(DXgc);
177  Vec3 W = Rn*Wn;
178 
179  return ((V*V)*m_Mass.dGet() + W*((m_Jgc_vm.Get() + m_Jgc_vg.Get())*W))/2.;
180  }
181 
182  if (i == 2) {
183  // potential energy
184  // NOTE: it is only valid for uniform gravity field
185  Vec3 Xgc = pNode->GetXCurr() + pNode->GetRCurr()*m_Xgc.Get();
186 
187  Vec3 GravityAcceleration;
188  if (GravityOwner::bGetGravity(Xgc, GravityAcceleration)) {
189  return -Xgc.Dot(GravityAcceleration)*m_Mass.dGet();
190  }
191  }
192 
193  return 0.;
194 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
DriveOwner m_Mass
Definition: body_vm.h:50
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual bool bGetGravity(const Vec3 &X, Vec3 &Acc) const
Definition: gravity.cc:208
TplDriveOwner< Mat3x3 > m_Jgc_vm
Definition: body_vm.h:52
TplDriveOwner< Mat3x3 > m_Jgc_vg
Definition: body_vm.h:53
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const StructNode * pNode
Definition: body_vm.h:48
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

virtual Elem::Type VariableBody::GetElemType ( void  ) const
inlinevirtual

Implements Elem.

Definition at line 102 of file body_vm.h.

References Elem::BODY.

102  {
103  return Elem::BODY;
104  };
Mat3x3 VariableBody::GetJ ( void  ) const

Definition at line 131 of file body_vm.cc.

References GetJ_int().

132 {
133  return GetJ_int();
134 }
Mat3x3 GetJ_int(void) const
Definition: body_vm.cc:81

Here is the call graph for this function:

Mat3x3 VariableBody::GetJ_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 81 of file body_vm.cc.

References DriveOwner::dGet(), TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), m_Jgc_vg, m_Jgc_vm, m_Mass, m_Xgc, MatCrossCross, and pNode.

Referenced by GetJ().

82 {
83  Vec3 x = pNode->GetXCurr() + pNode->GetRCurr()*m_Xgc.Get();
84 
85  return pNode->GetRCurr()*(m_Jgc_vm.Get() + m_Jgc_vg.Get()).MulMT(pNode->GetRCurr())
86  - Mat3x3(MatCrossCross, x, x*m_Mass.dGet());
87 }
Definition: matvec3.h:98
DriveOwner m_Mass
Definition: body_vm.h:50
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
TplDriveOwner< Mat3x3 > m_Jgc_vm
Definition: body_vm.h:52
TplDriveOwner< Mat3x3 > m_Jgc_vg
Definition: body_vm.h:53
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
const StructNode * pNode
Definition: body_vm.h:48
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

Vec3 VariableBody::GetS ( void  ) const

Definition at line 124 of file body_vm.cc.

References GetS_int().

125 {
126  return GetS_int();
127 }
Vec3 GetS_int(void) const
Definition: body_vm.cc:73

Here is the call graph for this function:

Vec3 VariableBody::GetS_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 73 of file body_vm.cc.

References DriveOwner::dGet(), TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), m_Mass, m_Xgc, and pNode.

Referenced by GetS().

74 {
75  return (pNode->GetXCurr() + pNode->GetRCurr()*m_Xgc.Get())*m_Mass.dGet();
76 }
DriveOwner m_Mass
Definition: body_vm.h:50
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const StructNode * pNode
Definition: body_vm.h:48
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

virtual unsigned int VariableBody::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 107 of file body_vm.h.

107  {
108  return 0;
109  };
unsigned int VariableBody::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 145 of file body_vm.cc.

146 {
147  return 1;
148 }
unsigned int VariableBody::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 151 of file body_vm.cc.

152 {
153  if (strcmp(s, "E") == 0) {
154  // kinetic energy
155  return 1;
156  }
157 
158  if (strcmp(s, "V") == 0) {
159  // potential energy
160  return 2;
161  }
162 
163  return 0;
164 }
const StructNode * VariableBody::pGetNode ( void  ) const

Definition at line 138 of file body_vm.cc.

References pNode.

139 {
140  return pNode;
141 }
const StructNode * pNode
Definition: body_vm.h:48
std::ostream & VariableBody::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 92 of file body_vm.cc.

References WithLabel::GetLabel(), m_Jgc_vg, m_Jgc_vm, m_Mass, m_Xgc, TplDriveOwner< T >::pGetDriveCaller(), DriveOwner::pGetDriveCaller(), pNode, TplDriveCaller< T >::Restart(), and DriveCaller::Restart().

93 {
94  out << " body: " << GetLabel() << ", "
95  << pNode->GetLabel() << ", variable mass, ", m_Mass.pGetDriveCaller()->Restart(out) << ", "
96  << "reference, node, ", m_Xgc.pGetDriveCaller()->Restart(out) << ", "
97  << "reference, node, ", m_Jgc_vm.pGetDriveCaller()->Restart(out) << ", "
98  << "reference, node, ", m_Jgc_vg.pGetDriveCaller()->Restart(out) << ";" << std::endl;
99 
100  return out;
101 }
DriveOwner m_Mass
Definition: body_vm.h:50
TplDriveOwner< Mat3x3 > m_Jgc_vm
Definition: body_vm.h:52
virtual std::ostream & Restart(std::ostream &out) const =0
TplDriveCaller< T > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
TplDriveOwner< Mat3x3 > m_Jgc_vg
Definition: body_vm.h:53
virtual std::ostream & Restart(std::ostream &out) const =0
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
TplDriveOwner< Vec3 > m_Xgc
Definition: body_vm.h:51
const StructNode * pNode
Definition: body_vm.h:48
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Member Data Documentation


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