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

#include <modalmappingext.h>

Inheritance diagram for ModalMappingExt:
Collaboration diagram for ModalMappingExt:

Classes

struct  NodeData
 

Public Member Functions

 ModalMappingExt (unsigned int uL, DataManager *pDM, const StructNode *pRefNode, std::vector< const StructNode * > &n, SpMapMatrixHandler *pH, bool bOutputAccelerations, ExtFileHandlerBase *pEFH, ExtModalForceBase *pEMF, bool bSendAfterPredict, int iCoupling, ExtModalForceBase::BitMask bm, bool bUseReferenceNodeForces, bool bRotateReferenceNodeForces, flag fOut)
 
virtual ~ModalMappingExt (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 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 HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
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, 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 ExtForce
 ExtForce (unsigned int uL, DataManager *pDM, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, flag fOut)
 
virtual ~ExtForce (void)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
- 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 Member Functions

bool Prepare (ExtFileHandlerBase *pEFH)
 
void Send (ExtFileHandlerBase *pEFH, ExtFileHandlerBase::SendWhen when)
 
void Recv (ExtFileHandlerBase *pEFH)
 
- Protected Member Functions inherited from ExtForce
void Send (ExtFileHandlerBase::SendWhen when)
 
void Recv (void)
 

Protected Attributes

ExtModalForceBasepEMF
 
unsigned uFlags
 
bool bOutputAccelerations
 
bool bUseReferenceNodeForces
 
bool bRotateReferenceNodeForces
 
const StructNodepRefNode
 
SpMapMatrixHandlerpH
 
std::vector< NodeDataNodes
 
Vec3 F0
 
Vec3 M0
 
Vec3 F1
 
Vec3 M1
 
Vec3 F2
 
Vec3 M2
 
STLVectorHandler f
 
STLVectorHandler p
 
STLVectorHandler x
 
STLVectorHandler xP
 
STLVectorHandler q
 
STLVectorHandler qP
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from ExtForce
Converged c
 
ExtFileHandlerBasepEFH
 
bool bSendAfterPredict
 
int iCoupling
 
int iCouplingCounter
 
bool bFirstSend
 
bool bFirstRecv
 

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 ExtForce
enum  { COUPLING_NONE = -2, COUPLING_STAGGERED = -1, COUPLING_LOOSE = 0, COUPLING_TIGHT = 1 }
 
- 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 46 of file modalmappingext.h.

Constructor & Destructor Documentation

ModalMappingExt::ModalMappingExt ( unsigned int  uL,
DataManager pDM,
const StructNode pRefNode,
std::vector< const StructNode * > &  n,
SpMapMatrixHandler pH,
bool  bOutputAccelerations,
ExtFileHandlerBase pEFH,
ExtModalForceBase pEMF,
bool  bSendAfterPredict,
int  iCoupling,
ExtModalForceBase::BitMask  bm,
bool  bUseReferenceNodeForces,
bool  bRotateReferenceNodeForces,
flag  fOut 
)

Definition at line 42 of file modalmappingext.cc.

References ASSERT, ExtModalForceBase::EMF_ALL, ExtModalForceBase::EMF_MODAL, ExtModalForceBase::EMF_RIGID, f, StructNode::GetRCurr(), StructDispNode::GetXCurr(), SparseMatrixHandler::iGetNumRows(), Mat3x3::MulTM(), Mat3x3::MulTV(), Nodes, p, q, qP, uFlags, x, xP, and Zero3.

56 : Elem(uL, fOut),
57 ExtForce(uL, pDM, pEFH, bSendAfterPredict, iCoupling, fOut),
58 pEMF(pEMF),
63 pRefNode(pRefNode),
64 pH(pH),
65 F0(Zero3), M0(Zero3),
66 F1(Zero3), M1(Zero3),
67 F2(Zero3), M2(Zero3)
68 {
69  ASSERT(pEMF != 0);
70 
71  ASSERT(pH != 0);
72 
74  ASSERT((bm & ~ExtModalForceBase::EMF_ALL) == 0);
75 
76  ASSERT(n.size() > 0);
77 
79  f.resize(6*n.size());
80  fill(f.begin(), f.end(), 0.);
81  p.resize(pH->iGetNumRows());
82  fill(p.begin(), p.end(), 0.);
83 
84  x.resize(6*n.size());
85  fill(x.begin(), x.end(), 0.);
86  xP.resize(6*n.size());
87  fill(xP.begin(), xP.end(), 0.);
88  q.resize(pH->iGetNumRows());
89  fill(q.begin(), q.end(), 0.);
90  qP.resize(pH->iGetNumRows());
91  fill(qP.begin(), qP.end(), 0.);
92 
94 
95  } else {
96  f.resize(0);
97  p.resize(0);
98 
99  x.resize(0);
100  xP.resize(0);
101  q.resize(0);
102  qP.resize(0);
103  }
104 
105  if (bm & ExtModalForceBase::EMF_RIGID) {
106  ASSERT(pRefNode != 0);
108  }
109 
110  Nodes.resize(n.size());
111  for (unsigned i = 0; i < n.size(); i++) {
112  Nodes[i].pNode = n[i];
113  ASSERT(Nodes[i].pNode != 0);
114 
115  if (pRefNode) {
116  Nodes[i].X0 = pRefNode->GetRCurr().MulTV(Nodes[i].pNode->GetXCurr() - pRefNode->GetXCurr());
117  Nodes[i].R0 = pRefNode->GetRCurr().MulTM(Nodes[i].pNode->GetRCurr());
118 
119  } else {
120  Nodes[i].X0 = Nodes[i].pNode->GetXCurr();
121  Nodes[i].R0 = Nodes[i].pNode->GetRCurr();
122  }
123 
124  Nodes[i].F = Zero3;
125  Nodes[i].M = Zero3;
126  }
127 }
SpMapMatrixHandler * pH
const Vec3 Zero3(0., 0., 0.)
bool bUseReferenceNodeForces
STLVectorHandler x
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
bool bSendAfterPredict
Definition: extforce.h:196
integer iGetNumRows(void) const
Definition: spmh.h:113
ExtModalForceBase * pEMF
STLVectorHandler p
ExtForce(unsigned int uL, DataManager *pDM, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, flag fOut)
Definition: extforce.cc:677
STLVectorHandler q
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
#define ASSERT(expression)
Definition: colamd.c:977
STLVectorHandler f
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pRefNode
bool bRotateReferenceNodeForces
std::vector< NodeData > Nodes
STLVectorHandler qP
STLVectorHandler xP
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

ModalMappingExt::~ModalMappingExt ( void  )
virtual

Definition at line 129 of file modalmappingext.cc.

References pEMF, pH, and SAFEDELETE.

130 {
131  if (pEMF) {
132  SAFEDELETE(pEMF);
133  }
134 
135  if (pH) {
136  SAFEDELETE(pH);
137  }
138 }
SpMapMatrixHandler * pH
ExtModalForceBase * pEMF
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 282 of file modalmappingext.cc.

References ExtForce::COUPLING_NONE, ExtModalForceBase::EMF_MODAL, ExtModalForceBase::EMF_RIGID, F1, ExtForce::iCoupling, StructDispNode::iGetFirstMomentumIndex(), M1, Nodes, pRefNode, VectorHandler::Put(), SubVectorHandler::PutRowIndex(), ExtForce::Recv(), VectorHandler::Resize(), VectorHandler::ResizeReset(), uFlags, and WorkSpaceDim().

286 {
287  ExtForce::Recv();
288 
289  if (iCoupling == COUPLING_NONE) {
290  WorkVec.Resize(0);
291  return WorkVec;
292  }
293 
294  integer iR, iC;
295  WorkSpaceDim(&iR, &iC);
296  WorkVec.ResizeReset(iR);
297 
298  integer iIdx = 0;
300  integer iFirstIndex = pRefNode->iGetFirstMomentumIndex();
301 
302  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
303  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
304  }
305 
306  WorkVec.Put(1, F1);
307  WorkVec.Put(4, M1);
308  }
309 
310  if (pRefNode) {
311  iIdx += 6;
312  }
313 
315  for (unsigned i = 0; i < Nodes.size(); i++) {
316  integer iIndex = Nodes[i].pNode->iGetFirstMomentumIndex();
317  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
318  WorkVec.PutRowIndex(iIdx + iCnt, iIndex + iCnt);
319  }
320 
321  WorkVec.Put(iIdx + 1, Nodes[i].F);
322  WorkVec.Put(iIdx + 4, Nodes[i].M);
323 
324  iIdx += 6;
325  }
326  }
327 
328  return WorkVec;
329 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
void Recv(void)
Definition: extforce.cc:798
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual integer iGetFirstMomentumIndex(void) const =0
const StructNode * pRefNode
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
std::vector< NodeData > Nodes
int iCoupling
Definition: extforce.h:212
long int integer
Definition: colamd.c:51
virtual void Resize(integer iNewSize)=0

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 383 of file modalmappingext.cc.

References Nodes, and pRefNode.

384 {
385  unsigned iOff = 0;
386  if (pRefNode) {
387  iOff = 1;
388  }
389 
390  connectedNodes.resize(iOff + Nodes.size());
391 
392  if (iOff) {
393  connectedNodes[0] = pRefNode;
394  }
395 
396  for (unsigned i = 0; i < Nodes.size(); i++) {
397  connectedNodes[iOff + i] = Nodes[i].pNode;
398  }
399 }
const StructNode * pRefNode
std::vector< NodeData > Nodes
Force::Type ModalMappingExt::GetForceType ( void  ) const
virtual

Implements Force.

Definition at line 263 of file modalmappingext.cc.

References Force::EXTERNALMODAL.

264 {
265  return Force::EXTERNALMODAL;
266 }
void ModalMappingExt::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 332 of file modalmappingext.cc.

References ToBeOutput::bToBeOutput(), ExtModalForceBase::EMF_MODAL, ExtModalForceBase::EMF_RIGID, F0, F1, F2, OutputHandler::FORCES, OutputHandler::Forces(), WithLabel::GetLabel(), M0, M1, M2, Nodes, p, pRefNode, q, qP, uFlags, OutputHandler::UseText(), x, and xP.

333 {
334  if (bToBeOutput()) {
335  if (OH.UseText(OutputHandler::FORCES)) {
336  std::ostream& out = OH.Forces();
337 
339  out << GetLabel() << "@" << pRefNode->GetLabel()
340  << " " << F0 << " " << M0
341  << " " << F1 << " " << M1
342  << " " << F2 << " " << M2
343  << std::endl;
344  }
345 
347  for (unsigned i = 0; i < p.size(); i++) {
348  out << GetLabel() << '.' << i + 1
349  << " " << p[i]
350  << " " << q[i]
351  << " " << qP[i]
352  << std::endl;
353  }
354 
355  for (unsigned i = 0; i < Nodes.size(); i++) {
356  const double *px = &x[6*i];
357  const double *pxP = &xP[6*i];
358  out << GetLabel() << '#' << Nodes[i].pNode->GetLabel()
359  << " " << Nodes[i].F
360  << " " << Nodes[i].M
361  << " " << px[0]
362  << " " << px[1]
363  << " " << px[2]
364  << " " << px[3]
365  << " " << px[4]
366  << " " << px[5]
367  << " " << pxP[0]
368  << " " << pxP[1]
369  << " " << pxP[2]
370  << " " << pxP[3]
371  << " " << pxP[4]
372  << " " << pxP[5]
373  << std::endl;
374  }
375  }
376  }
377 
378  /* TODO: NetCDF */
379  }
380 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
STLVectorHandler x
STLVectorHandler p
STLVectorHandler q
const StructNode * pRefNode
std::vector< NodeData > Nodes
STLVectorHandler qP
STLVectorHandler xP
unsigned int GetLabel(void) const
Definition: withlab.cc:62
std::ostream & Forces(void) const
Definition: output.h:450
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

bool ModalMappingExt::Prepare ( ExtFileHandlerBase pEFH)
protectedvirtual

Implements ExtForce.

Definition at line 141 of file modalmappingext.cc.

References ExtModalForceBase::EMF_RIGID, WithLabel::GetLabel(), SparseMatrixHandler::iGetNumRows(), pEMF, pH, ExtModalForceBase::Prepare(), and uFlags.

142 {
143  return pEMF->Prepare(pEFH, GetLabel(),
145  pH->iGetNumRows());
146 }
SpMapMatrixHandler * pH
integer iGetNumRows(void) const
Definition: spmh.h:113
virtual bool Prepare(ExtFileHandlerBase *pEFH, unsigned uLabel, bool bRigid, unsigned uModes)=0
ExtModalForceBase * pEMF
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void ModalMappingExt::Recv ( ExtFileHandlerBase pEFH)
protectedvirtual

Implements ExtForce.

Definition at line 200 of file modalmappingext.cc.

References bRotateReferenceNodeForces, ToBeOutput::bToBeOutput(), bUseReferenceNodeForces, grad::Cross(), ExtModalForceBase::EMF_ERR, f, F0, F1, F2, WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), M0, M1, M2, MatrixHandler::MatTVecMul(), MBDYN_EXCEPT_ARGS, Nodes, p, pEMF, pH, pRefNode, ExtModalForceBase::Recv(), uFlags, WithLabel::uLabel, and Zero3.

201 {
202  unsigned uLabel = 0;
203  unsigned uOutFlags = pEMF->Recv(pEFH, uFlags, uLabel, F0, M0, p);
204 
205  if (uOutFlags & ExtModalForceBase::EMF_ERR) {
206  silent_cerr("ModalMappingExt(" << GetLabel() << "): "
207  "error while reading modal force data" << std::endl);
209  }
210 
211  if (uFlags != uOutFlags) {
212  silent_cerr("ModalMappingExt(" << GetLabel() << "): "
213  "error while reading modal force data "
214  "(" << uOutFlags << "!=" << uFlags << ")"
215  << std::endl);
217  }
218 
219  pH->MatTVecMul(f, p);
220 
221  if (pRefNode) {
222  const Vec3& XRef(pRefNode->GetXCurr());
223  const Mat3x3& RRef(pRefNode->GetRCurr());
224 
226  // initialize rigid body forces with values provided by peer
228  F1 = RRef*F0;
229  M1 = RRef*M0;
230 
231  } else {
232  F1 = F0;
233  M1 = M0;
234  }
235  }
236 
237  F2 = Zero3;
238  M2 = Zero3;
239  for (unsigned i = 0; i < Nodes.size(); i++) {
240  Nodes[i].F = RRef*Vec3(&f[6*i]);
241  Nodes[i].M = RRef*Vec3(&f[6*i + 3]);
242 
243  if ((bUseReferenceNodeForces || bToBeOutput()) && Nodes[i].pNode != pRefNode) {
244  F2 += Nodes[i].F;
245  M2 += Nodes[i].M + (Nodes[i].pNode->GetXCurr() - XRef).Cross(Nodes[i].F);
246  }
247  }
248 
250  F1 -= F2;
251  M1 -= M2;
252  }
253 
254  } else {
255  for (unsigned i = 0; i < Nodes.size(); i++) {
256  Nodes[i].F = Vec3(&f[6*i]);
257  Nodes[i].M = Vec3(&f[6*i + 3]);
258  }
259  }
260 }
SpMapMatrixHandler * pH
const Vec3 Zero3(0., 0., 0.)
bool bUseReferenceNodeForces
virtual bool bToBeOutput(void) const
Definition: output.cc:890
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
ExtModalForceBase * pEMF
STLVectorHandler p
unsigned int uLabel
Definition: withlab.h:44
STLVectorHandler f
virtual unsigned Recv(ExtFileHandlerBase *pEFH, unsigned uFlags, unsigned &uLabel, Vec3 &f, Vec3 &m, std::vector< doublereal > &fv)=0
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pRefNode
bool bRotateReferenceNodeForces
std::vector< NodeData > Nodes
virtual VectorHandler & MatTVecMul(VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:341
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void ModalMappingExt::Send ( ExtFileHandlerBase pEFH,
ExtFileHandlerBase::SendWhen  when 
)
protectedvirtual

Implements ExtForce.

Definition at line 152 of file modalmappingext.cc.

References Vec3::Cross(), ExtModalForceBase::EMF_RIGID, Eye3, WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), MatR2LinParam(), MatrixHandler::MatVecMul(), Mat3x3::MulTM(), Mat3x3::MulTV(), Nodes, pEMF, pH, pRefNode, STLVectorHandler::Put(), q, qP, R, ExtModalForceBase::Send(), uFlags, x, xP, and Zero3.

153 {
154  Vec3 X;
155  Mat3x3 R;
156  Vec3 V;
157  Vec3 W;
158 
160  X = pRefNode->GetXCurr();
161  R = pRefNode->GetRCurr();
162  V = pRefNode->GetVCurr();
163  W = pRefNode->GetWCurr();
164 
165  } else {
166  X = Zero3;
167  R = Eye3;
168  V = Zero3;
169  W = Zero3;
170  }
171 
172  if (pRefNode) {
173  for (unsigned i = 0; i < Nodes.size(); i++) {
174  Vec3 XRel = Nodes[i].pNode->GetXCurr() - X;
175 
176  x.Put(6*i + 1, R.MulTV(XRel) - Nodes[i].X0);
177  x.Put(6*i + 4, MatR2LinParam(R.MulTM(Nodes[i].pNode->GetRCurr().MulMT(Nodes[i].R0))));
178 
179  xP.Put(6*i + 1, R.MulTV(Nodes[i].pNode->GetVCurr() - V + XRel.Cross(W)));
180  xP.Put(6*i + 4, R.MulTV(Nodes[i].pNode->GetWCurr() - W));
181  }
182 
183  } else {
184  for (unsigned i = 0; i < Nodes.size(); i++) {
185  x.Put(6*i + 1, Nodes[i].pNode->GetXCurr() - Nodes[i].X0);
186  x.Put(6*i + 4, MatR2LinParam(Nodes[i].pNode->GetRCurr().MulMT(Nodes[i].R0)));
187 
188  xP.Put(6*i + 1, Nodes[i].pNode->GetVCurr());
189  xP.Put(6*i + 4, Nodes[i].pNode->GetWCurr());
190  }
191  }
192 
193  pH->MatVecMul(q, x);
194  pH->MatVecMul(qP, xP);
195 
196  pEMF->Send(pEFH, uFlags, GetLabel(), X, R, V, W, q, qP);
197 }
SpMapMatrixHandler * pH
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
STLVectorHandler x
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
ExtModalForceBase * pEMF
STLVectorHandler q
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual void Put(integer iRow, const Vec3 &v)
Definition: stlvh.cc:181
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pRefNode
Vec3 MatR2LinParam(const Mat3x3 &m)
Definition: matvec3.cc:772
std::vector< NodeData > Nodes
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
STLVectorHandler qP
STLVectorHandler xP
unsigned int GetLabel(void) const
Definition: withlab.cc:62
virtual VectorHandler & MatVecMul(VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:332
virtual void Send(ExtFileHandlerBase *pEFH, unsigned uFlags, unsigned uLabel, const Vec3 &x, const Mat3x3 &R, const Vec3 &v, const Vec3 &w, const std::vector< doublereal > &q, const std::vector< doublereal > &qP)=0
Mat3x3 R

Here is the call graph for this function:

void ModalMappingExt::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 269 of file modalmappingext.cc.

References ExtForce::COUPLING_NONE, ExtForce::iCoupling, Nodes, and pRefNode.

Referenced by AssRes().

270 {
271  if (iCoupling == COUPLING_NONE) {
272  *piNumRows = 0;
273  *piNumCols = 0;
274 
275  } else {
276  *piNumRows = (pRefNode ? 6 : 0) + 6*Nodes.size();
277  *piNumCols = 1;
278  }
279 }
const StructNode * pRefNode
std::vector< NodeData > Nodes
int iCoupling
Definition: extforce.h:212

Member Data Documentation

bool ModalMappingExt::bOutputAccelerations
protected

Definition at line 50 of file modalmappingext.h.

bool ModalMappingExt::bRotateReferenceNodeForces
protected

Definition at line 52 of file modalmappingext.h.

Referenced by Recv().

bool ModalMappingExt::bUseReferenceNodeForces
protected

Definition at line 51 of file modalmappingext.h.

Referenced by Recv().

STLVectorHandler ModalMappingExt::f
protected

Definition at line 75 of file modalmappingext.h.

Referenced by ModalMappingExt(), and Recv().

Vec3 ModalMappingExt::F0
protected

Definition at line 71 of file modalmappingext.h.

Referenced by Output(), and Recv().

Vec3 ModalMappingExt::F1
protected

Definition at line 72 of file modalmappingext.h.

Referenced by AssRes(), Output(), and Recv().

Vec3 ModalMappingExt::F2
protected

Definition at line 73 of file modalmappingext.h.

Referenced by Output(), and Recv().

Vec3 ModalMappingExt::M0
protected

Definition at line 71 of file modalmappingext.h.

Referenced by Output(), and Recv().

Vec3 ModalMappingExt::M1
protected

Definition at line 72 of file modalmappingext.h.

Referenced by AssRes(), Output(), and Recv().

Vec3 ModalMappingExt::M2
protected

Definition at line 73 of file modalmappingext.h.

Referenced by Output(), and Recv().

std::vector<NodeData> ModalMappingExt::Nodes
protected
STLVectorHandler ModalMappingExt::p
protected

Definition at line 76 of file modalmappingext.h.

Referenced by ModalMappingExt(), Output(), and Recv().

ExtModalForceBase* ModalMappingExt::pEMF
protected

Definition at line 48 of file modalmappingext.h.

Referenced by Prepare(), Recv(), Send(), and ~ModalMappingExt().

SpMapMatrixHandler* ModalMappingExt::pH
protected

Definition at line 57 of file modalmappingext.h.

Referenced by Prepare(), Recv(), Send(), and ~ModalMappingExt().

const StructNode* ModalMappingExt::pRefNode
protected

Definition at line 54 of file modalmappingext.h.

Referenced by AssRes(), GetConnectedNodes(), Output(), Recv(), Send(), and WorkSpaceDim().

STLVectorHandler ModalMappingExt::q
protected

Definition at line 80 of file modalmappingext.h.

Referenced by ModalMappingExt(), Output(), and Send().

STLVectorHandler ModalMappingExt::qP
protected

Definition at line 81 of file modalmappingext.h.

Referenced by ModalMappingExt(), Output(), and Send().

unsigned ModalMappingExt::uFlags
protected

Definition at line 49 of file modalmappingext.h.

Referenced by AssRes(), ModalMappingExt(), Output(), Prepare(), Recv(), and Send().

STLVectorHandler ModalMappingExt::x
protected

Definition at line 78 of file modalmappingext.h.

Referenced by ModalMappingExt(), Output(), and Send().

STLVectorHandler ModalMappingExt::xP
protected

Definition at line 79 of file modalmappingext.h.

Referenced by ModalMappingExt(), Output(), and Send().


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