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

#include <body.h>

Inheritance diagram for Mass:
Collaboration diagram for Mass:

Public Member Functions

 Mass (unsigned int uL, const StructDispNode *pNode, doublereal dMassTmp, flag fOut)
 
virtual ~Mass (void)
 
doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
const StructDispNodepGetNode (void) const
 
virtual Elem::Type GetElemType (void) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
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 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
 
- 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 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
 
virtual std::ostream & Restart (std::ostream &out) const
 
void AssVecRBK_int (SubVectorHandler &WorkVec)
 
void AssMatsRBK_int (FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, const doublereal &dCoef)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Protected Attributes

const StructDispNodepNode
 
doublereal dMass
 
- 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.h.

Constructor & Destructor Documentation

Mass::Mass ( unsigned int  uL,
const StructDispNode pNode,
doublereal  dMassTmp,
flag  fOut 
)

Definition at line 44 of file body.cc.

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

48 : Elem(uL, fOut),
49 ElemGravityOwner(uL, fOut),
50 InitialAssemblyElem(uL, fOut),
51 pNode(pNode),
52 dMass(dMass)
53 {
54  ASSERT(pNode != NULL);
55  ASSERT(pNode->GetNodeType() == Node::STRUCTURAL);
56  ASSERT(dMass > 0.);
57 }
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
ElemGravityOwner(unsigned int uL, flag fOut)
Definition: gravity.cc:223
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
#define ASSERT(expression)
Definition: colamd.c:977
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:

Mass::~Mass ( void  )
virtual

Definition at line 61 of file body.cc.

References NO_OP.

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

Member Function Documentation

void Mass::AssMatsRBK_int ( FullSubMatrixHandler WMA,
FullSubMatrixHandler WMB,
const doublereal dCoef 
)
protected

Definition at line 204 of file body.cc.

References FullSubMatrixHandler::Add(), dMass, RigidBodyKinematics::GetW(), RigidBodyKinematics::GetWP(), MatCross, MatCrossCross, StructDispNode::pGetRBK(), and pNode.

Referenced by DynamicMass::AssMats(), and StaticMass::AssMats().

208 {
209  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
210 
211  integer iIdx = 0;
212  if (dynamic_cast<DynamicMass *>(this)) {
213  iIdx = 3;
214  }
215 
216  // f: delta x
217  Mat3x3 MTmp(MatCross, pRBK->GetWP());
218  MTmp += Mat3x3(MatCrossCross, pRBK->GetW(), pRBK->GetW());
219 
220  WMA.Add(iIdx + 1, 1, MTmp*(dMass*dCoef));
221 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
virtual const Vec3 & GetWP(void) const =0
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
virtual const Vec3 & GetW(void) const =0
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void Mass::AssVecRBK_int ( SubVectorHandler WorkVec)
protected

Definition at line 183 of file body.cc.

References dMass, StructDispNode::GetXCurr(), RigidBodyKinematics::GetXPP(), StructDispNode::pGetRBK(), pNode, and VectorHandler::Sub().

Referenced by DynamicMass::AssRes(), and StaticMass::AssRes().

184 {
185  const RigidBodyKinematics *pRBK = pNode->pGetRBK();
186 
187  Vec3 s0;
188 
189  integer iIdx = 0;
190  if (dynamic_cast<DynamicMass *>(this)) {
191  iIdx = 3;
192  }
193 
194  s0 = pNode->GetXCurr()*dMass;
195 
196  // force
197  Vec3 f;
198  f = pRBK->GetXPP()*dMass;
199 
200  WorkVec.Sub(iIdx + 1, f);
201 }
Definition: matvec3.h:98
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual const Vec3 & GetXPP(void) const =0
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
const RigidBodyKinematics * pGetRBK(void) const
Definition: strnode.cc:152
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

doublereal Mass::dGetM ( void  ) const
virtual

Reimplemented from ElemGravityOwner.

Definition at line 98 of file body.cc.

References dMass.

99 {
100  return dMass;
101 }
doublereal dMass
Definition: body.h:49
doublereal Mass::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 153 of file body.cc.

References GravityOwner::bGetGravity(), dMass, Vec3::Dot(), StructDispNode::GetVCurr(), StructDispNode::GetXCurr(), and pNode.

154 {
155  switch (i) {
156  case 1: {
157  // kinetic energy
158  const Vec3& Vn = pNode->GetVCurr();
159 
160  return Vn.Dot()*dMass;
161  }
162 
163  case 2: {
164  // potential energy
165  const Vec3& Xn = pNode->GetXCurr();
166 
167  Vec3 GravityAcceleration;
168  if (GravityOwner::bGetGravity(Xn, GravityAcceleration)) {
169  return -Xn.Dot(GravityAcceleration)*dMass;
170  }
171  break;
172  }
173 
174  case 3:
175  // mass
176  return dMass;
177  }
178 
179  return 0.;
180 }
Definition: matvec3.h:98
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual bool bGetGravity(const Vec3 &X, Vec3 &Acc) const
Definition: gravity.cc:208
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 107 of file body.h.

References pNode.

107  {
108  connectedNodes.resize(1);
109  connectedNodes[0] = pNode;
110  };
const StructDispNode * pNode
Definition: body.h:48
virtual Elem::Type Mass::GetElemType ( void  ) const
inlinevirtual

Implements Elem.

Definition at line 89 of file body.h.

References Elem::BODY.

89  {
90  return Elem::BODY;
91  };
Mat3x3 Mass::GetJ ( void  ) const

Definition at line 112 of file body.cc.

References GetJ_int().

113 {
114  return GetJ_int();
115 }
Mat3x3 GetJ_int(void) const
Definition: body.cc:77

Here is the call graph for this function:

Mat3x3 Mass::GetJ_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 77 of file body.cc.

References dMass, StructDispNode::GetXCurr(), MatCrossCross, and pNode.

Referenced by GetJ().

78 {
79  const Vec3& x = pNode->GetXCurr();
80 
81  return Mat3x3(MatCrossCross, x, x*(-dMass));
82 }
Definition: matvec3.h:98
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

Vec3 Mass::GetS ( void  ) const

Definition at line 105 of file body.cc.

References GetS_int().

106 {
107  return GetS_int();
108 }
Vec3 GetS_int(void) const
Definition: body.cc:69

Here is the call graph for this function:

Vec3 Mass::GetS_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 69 of file body.cc.

References dMass, StructDispNode::GetXCurr(), and pNode.

Referenced by GetS().

70 {
71  return pNode->GetXCurr()*dMass;
72 }
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 94 of file body.h.

94  {
95  return 0;
96  };
unsigned int Mass::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 126 of file body.cc.

127 {
128  return 3;
129 }
unsigned int Mass::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 132 of file body.cc.

133 {
134  if (s[1] == '\0') {
135  switch (s[0]) {
136  case 'E':
137  // kinetic energy
138  return 1;
139 
140  case 'V':
141  // potential energy
142  return 2;
143 
144  case 'm':
145  return 3;
146  }
147  }
148 
149  return 0;
150 }
const StructDispNode * Mass::pGetNode ( void  ) const

Definition at line 119 of file body.cc.

References pNode.

120 {
121  return pNode;
122 }
const StructDispNode * pNode
Definition: body.h:48
std::ostream & Mass::Restart ( std::ostream &  out) const
protectedvirtual

Implements Elem.

Definition at line 87 of file body.cc.

References dMass, WithLabel::GetLabel(), and pNode.

88 {
89  out << " body: " << GetLabel() << ", "
90  << pNode->GetLabel() << ", " << dMass << ';' << std::endl;
91 
92  return out;
93 }
const StructDispNode * pNode
Definition: body.h:48
doublereal dMass
Definition: body.h:49
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: