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

#include <modalforce.h>

Inheritance diagram for ModalForce:
Collaboration diagram for ModalForce:

Public Member Functions

 ModalForce (unsigned int uL, const Modal *pmodal, const std::vector< unsigned int > &modeList, std::vector< DriveCaller * > &f, const Mat3xN *Mt, const Mat3xN *Mr, flag fOut)
 
virtual ~ModalForce (void)
 
virtual Force::Type GetForceType (void) const
 
void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Output (OutputHandler &OH) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual 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 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 DofOrder::Order GetEqType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
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 unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void 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 Force
 Force (unsigned int uL, flag fOut)
 
virtual ~Force (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetInitialNumDof (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)
 

Protected Attributes

const ModalpModal
 
std::vector< unsigned intmodeList
 
std::vector< DriveCaller * > f
 
const Mat3xNMt
 
const Mat3xNMr
 
Vec3 F
 
Vec3 M
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

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 Force
enum  Type {
  UNKNOWN = -1, ABSTRACTFORCE = 0, ABSTRACTINTERNALFORCE, ABSOLUTEDISPFORCE,
  ABSOLUTEINTERNALDISPFORCE, ABSOLUTEFORCE, FOLLOWERFORCE, ABSOLUTECOUPLE,
  FOLLOWERCOUPLE, ABSOLUTEINTERNALFORCE, FOLLOWERINTERNALFORCE, ABSOLUTEINTERNALCOUPLE,
  FOLLOWERINTERNALCOUPLE, TOTALFORCE, TOTALINTERNALFORCE, EXTERNALSTRUCTURAL,
  MODALFORCE, EXTERNALMODAL, LASTFORCETYPE
}
 

Detailed Description

Definition at line 44 of file modalforce.h.

Constructor & Destructor Documentation

ModalForce::ModalForce ( unsigned int  uL,
const Modal pmodal,
const std::vector< unsigned int > &  modeList,
std::vector< DriveCaller * > &  f,
const Mat3xN Mt,
const Mat3xN Mr,
flag  fOut 
)

Definition at line 43 of file modalforce.cc.

References ASSERT, and pModal.

50 : Elem(uL, fOut),
51 Force(uL, fOut),
52 pModal(pmodal),
54 f(f),
55 Mt(mt),
56 Mr(mr),
57 F(Zero3),
58 M(Zero3)
59 {
60  ASSERT(pModal != 0);
61 }
const Vec3 Zero3(0., 0., 0.)
std::vector< unsigned int > modeList
Definition: modalforce.h:47
const Modal * pModal
Definition: modalforce.h:46
Force(unsigned int uL, flag fOut)
Definition: force.h:87
const Mat3xN * Mt
Definition: modalforce.h:49
#define ASSERT(expression)
Definition: colamd.c:977
std::vector< DriveCaller * > f
Definition: modalforce.h:48
const Mat3xN * Mr
Definition: modalforce.h:50
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
ModalForce::~ModalForce ( void  )
virtual

Definition at line 63 of file modalforce.cc.

References f, Mr, and Mt.

64 {
65  if (!f.empty()) {
66  for (unsigned i = 0; i < f.size(); i++) {
67  delete f[i];
68  }
69  }
70 
71  if (Mt) {
72  delete Mt;
73  }
74 
75  if (Mr) {
76  delete Mr;
77  }
78 }
const Mat3xN * Mt
Definition: modalforce.h:49
std::vector< DriveCaller * > f
Definition: modalforce.h:48
const Mat3xN * Mr
Definition: modalforce.h:50

Member Function Documentation

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

Implements Elem.

Definition at line 81 of file modalforce.cc.

References f, F, StructNode::GetRCurr(), Mat3xN::GetVec(), StructDispNode::iGetFirstMomentumIndex(), Modal::iGetModalIndex(), M, modeList, Mr, Mt, Modal::pGetModalNode(), pModal, VectorHandler::Put(), SubVectorHandler::PutItem(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), Modal::uGetNModes(), WorkSpaceDim(), and Zero3.

85 {
86  integer iR, iC;
87  WorkSpaceDim(&iR, &iC);
88  WorkVec.ResizeReset(iR);
89 
90  integer iIdx = 1;
91  const StructNode *pNode = pModal->pGetModalNode();
92  integer iFirstIndex = 0;
93  if (pNode) {
94  iFirstIndex = pNode->iGetFirstMomentumIndex();
95 
96  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
97  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
98  }
99 
100  F = Zero3;
101  M = Zero3;
102 
103  iIdx += 6;
104 
105  }
106 
107  integer iModalIndex = pModal->iGetModalIndex() + pModal->uGetNModes();
108  for (unsigned iMode = 0; iMode < modeList.size(); iMode++) {
109  doublereal d = f[iMode]->dGet();
110  WorkVec.PutItem(iIdx + iMode, iModalIndex + modeList[iMode], d);
111  if (pNode) {
112  F += Mt->GetVec(iMode + 1)*d;
113  M += Mr->GetVec(iMode + 1)*d;
114  }
115  }
116 
117  if (pNode) {
118  WorkVec.Put(1, pNode->GetRCurr()*F);
119  WorkVec.Put(4, pNode->GetRCurr()*M);
120  }
121 
122  return WorkVec;
123 }
const ModalNode * pGetModalNode(void) const
Definition: modal.h:395
const Vec3 Zero3(0., 0., 0.)
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
std::vector< unsigned int > modeList
Definition: modalforce.h:47
integer uGetNModes(void) const
Definition: modal.h:363
const Modal * pModal
Definition: modalforce.h:46
const Mat3xN * Mt
Definition: modalforce.h:49
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Definition: submat.h:1445
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
virtual integer iGetFirstMomentumIndex(void) const =0
std::vector< DriveCaller * > f
Definition: modalforce.h:48
const Mat3xN * Mr
Definition: modalforce.h:50
integer iGetModalIndex(void) const
Definition: modal.h:391
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modalforce.h:70
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 109 of file modalforce.h.

References Modal::pGetModalNode(), and pModal.

109  {
110  if (pModal->pGetModalNode()) {
111  connectedNodes.resize(1);
112  connectedNodes[0] = pModal->pGetModalNode();
113  } else {
114  connectedNodes.resize(0);
115  }
116  };
const ModalNode * pGetModalNode(void) const
Definition: modal.h:395
const Modal * pModal
Definition: modalforce.h:46

Here is the call graph for this function:

virtual Force::Type ModalForce::GetForceType ( void  ) const
inlinevirtual

Implements Force.

Definition at line 66 of file modalforce.h.

References Force::MODALFORCE.

66  {
67  return Force::MODALFORCE;
68  };
virtual VariableSubMatrixHandler& ModalForce::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
inlinevirtual

Reimplemented from Force.

Definition at line 89 of file modalforce.h.

References VariableSubMatrixHandler::SetNullMatrix().

91  {
92  WorkMat.SetNullMatrix();
93  return WorkMat;
94  };
void SetNullMatrix(void)
Definition: submat.h:1159

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 98 of file modalforce.h.

References VectorHandler::ResizeReset().

100  {
101  WorkVec.ResizeReset(0);
102  return WorkVec;
103  };
virtual void ResizeReset(integer)
Definition: vh.cc:55

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 82 of file modalforce.h.

82  {
83  *piNumRows = 0;
84  *piNumCols = 0;
85  };
void ModalForce::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 126 of file modalforce.cc.

References ToBeOutput::bToBeOutput(), Vec3::dGet(), f, F, OutputHandler::Forces(), WithLabel::GetLabel(), M, Modal::pGetModalNode(), and pModal.

127 {
128  if (bToBeOutput()) {
129  std::ostream& out = OH.Forces();
130 
131  out << GetLabel();
132 
133  if (pModal->pGetModalNode()) {
134  out << " " << F << " " << M;
135  }
136 
137  for (std::vector<DriveCaller *>::const_iterator i = f.begin(); i != f.end(); ++i) {
138  out << " " << (*i)->dGet();
139  }
140  out << std::endl;
141  }
142 }
const ModalNode * pGetModalNode(void) const
Definition: modal.h:395
virtual bool bToBeOutput(void) const
Definition: output.cc:890
const Modal * pModal
Definition: modalforce.h:46
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
std::vector< DriveCaller * > f
Definition: modalforce.h:48
unsigned int GetLabel(void) const
Definition: withlab.cc:62
std::ostream & Forces(void) const
Definition: output.h:450

Here is the call graph for this function:

void ModalForce::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 70 of file modalforce.h.

References modeList, Modal::pGetModalNode(), and pModal.

Referenced by AssRes().

70  {
71  *piNumRows = (pModal->pGetModalNode() ? 6 : 0) + modeList.size();
72  *piNumCols = 1;
73  };
const ModalNode * pGetModalNode(void) const
Definition: modal.h:395
std::vector< unsigned int > modeList
Definition: modalforce.h:47
const Modal * pModal
Definition: modalforce.h:46

Here is the call graph for this function:

Member Data Documentation

std::vector<DriveCaller *> ModalForce::f
protected

Definition at line 48 of file modalforce.h.

Referenced by AssRes(), Output(), and ~ModalForce().

Vec3 ModalForce::F
protected

Definition at line 51 of file modalforce.h.

Referenced by AssRes(), and Output().

Vec3 ModalForce::M
protected

Definition at line 51 of file modalforce.h.

Referenced by AssRes(), and Output().

std::vector<unsigned int> ModalForce::modeList
protected

Definition at line 47 of file modalforce.h.

Referenced by AssRes(), and WorkSpaceDim().

const Mat3xN* ModalForce::Mr
protected

Definition at line 50 of file modalforce.h.

Referenced by AssRes(), and ~ModalForce().

const Mat3xN* ModalForce::Mt
protected

Definition at line 49 of file modalforce.h.

Referenced by AssRes(), and ~ModalForce().

const Modal* ModalForce::pModal
protected

Definition at line 46 of file modalforce.h.

Referenced by AssRes(), GetConnectedNodes(), ModalForce(), Output(), and WorkSpaceDim().


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