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

#include <accelerometer.h>

Inheritance diagram for TranslAccel:
Collaboration diagram for TranslAccel:

Public Member Functions

 TranslAccel (unsigned int uL, const DofOwner *pD, const StructNode *pS, const ScalarDifferentialNode *pA, const Vec3 &TmpDir, const Vec3 &Tmpf, flag fOut)
 
 ~TranslAccel (void)
 
virtual Electric::Type GetElectricType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &, SimulationEntity::Hints *ph=0)
 
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 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 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 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
 
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 Electric
 Electric (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Electric (void)
 
virtual Elem::Type GetElemType (void) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 

Private Attributes

const StructNodepStrNode
 
const ScalarDifferentialNodepAbsNode
 
Vec3 Dir
 
Vec3 f
 

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 Electric
enum  Type {
  UNKNOWN = -1, ACCELEROMETER = 0, DISPLACEMENT, DISCRETECONTROL,
  MOTOR, LASTELECTRICTYPE
}
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 104 of file accelerometer.h.

Constructor & Destructor Documentation

TranslAccel::TranslAccel ( unsigned int  uL,
const DofOwner pD,
const StructNode pS,
const ScalarDifferentialNode pA,
const Vec3 TmpDir,
const Vec3 Tmpf,
flag  fOut 
)

Definition at line 259 of file accelerometer.cc.

References Node::ABSTRACT, ASSERT, StructDispNode::GetNodeType(), ScalarDifferentialNode::GetNodeType(), pAbsNode, pStrNode, and Node::STRUCTURAL.

266 : Elem(uL, fOut),
267 Electric(uL, pDO, fOut),
268 pStrNode(pS), pAbsNode(pA),
269 Dir(TmpDir), f(Tmpf)
270 {
271  ASSERT(pStrNode != NULL);
273  ASSERT(pAbsNode != NULL);
275 }
const ScalarDifferentialNode * pAbsNode
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
Electric(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: elec.cc:48
#define ASSERT(expression)
Definition: colamd.c:977
const StructNode * pStrNode
virtual Node::Type GetNodeType(void) const
Definition: node.cc:169
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

TranslAccel::~TranslAccel ( void  )

Definition at line 278 of file accelerometer.cc.

References NO_OP.

279 {
280  NO_OP;
281 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

VariableSubMatrixHandler & TranslAccel::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 298 of file accelerometer.cc.

References Vec3::Cross(), DEBUGCOUT, Vec3::dGet(), Dir, f, StructNode::GetRCurr(), StructDispNode::GetVCurr(), Node::iGetFirstColIndex(), DofOwnerOwner::iGetFirstIndex(), pAbsNode, pStrNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

302 {
303  DEBUGCOUT("Entering TranslAccel::AssJac()" << std::endl);
304 
305  /* Casting di WorkMat */
306  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
307  WM.ResizeReset(9, 0);
308 
309  /* Indici delle equazioni */
310  integer iFirstColIndex = pStrNode->iGetFirstColIndex();
311  integer iAbstractIndex = pAbsNode->iGetFirstIndex() + 1;
312  integer iFirstIndex = iGetFirstIndex() + 1;
313 
314  WM.PutItem(1, iAbstractIndex, iAbstractIndex, dCoef);
315  WM.PutItem(2, iAbstractIndex, iFirstIndex, -1.);
316  WM.PutItem(3, iFirstIndex, iFirstIndex, dCoef);
317 
318  Vec3 tmpf = pStrNode->GetRCurr()*f;
319  Vec3 tmpd = pStrNode->GetRCurr()*Dir;
320  Vec3 tmp = tmpf.Cross(tmpd); // FIXME?
321  WM.PutItem(4, iFirstIndex, iFirstColIndex + 1, -tmpd.dGet(1));
322  WM.PutItem(5, iFirstIndex, iFirstColIndex + 2, -tmpd.dGet(2));
323  WM.PutItem(6, iFirstIndex, iFirstColIndex + 3, -tmpd.dGet(3));
324 
325  tmp = tmpd.Cross((pStrNode->GetVCurr()*(-dCoef) + tmpf));
326  WM.PutItem(7, iFirstIndex, iFirstColIndex + 4, tmp.dGet(1));
327  WM.PutItem(8, iFirstIndex, iFirstColIndex + 5, tmp.dGet(2));
328  WM.PutItem(9, iFirstIndex, iFirstColIndex + 6, tmp.dGet(3));
329 
330  return WorkMat;
331 }
const ScalarDifferentialNode * pAbsNode
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
const StructNode * pStrNode
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

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

Implements Elem.

Definition at line 335 of file accelerometer.cc.

References a, Vec3::Cross(), DEBUGCOUT, ScalarDifferentialNode::dGetX(), Dir, Vec3::Dot(), f, StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), pAbsNode, pStrNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), and VectorHandler::Resize().

339 {
340  DEBUGCOUT("Entering TranslAccel::AssRes()" << std::endl);
341 
342  /* Dimensiona e resetta la matrice di lavoro */
343  WorkVec.Resize(2);
344 
345  integer iAbstractIndex = pAbsNode->iGetFirstIndex() + 1;
346  integer iFirstIndex = iGetFirstIndex()+1;
347 
348  WorkVec.PutRowIndex(1, iAbstractIndex);
349  WorkVec.PutRowIndex(2, iFirstIndex);
350 
351  Vec3 tmpf = pStrNode->GetRCurr()*f;
352  Vec3 tmpd = pStrNode->GetRCurr()*Dir;
353 
354  doublereal v = XCurr(iFirstIndex);
355  doublereal vp = XPrimeCurr(iFirstIndex);
356  doublereal a = pAbsNode->dGetX();
357 
358  WorkVec.PutCoef(1, vp - a);
359  WorkVec.PutCoef(2, tmpd.Dot((pStrNode->GetVCurr() + pStrNode->GetWCurr().Cross(tmpf))) - v);
360 
361  return WorkVec;
362 }
const ScalarDifferentialNode * pAbsNode
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
static const doublereal a
Definition: hfluid_.h:289
const StructNode * pStrNode
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual void Resize(integer iNewSize)=0
virtual const doublereal & dGetX(void) const
Definition: node.h:386

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 150 of file accelerometer.h.

References pAbsNode, and pStrNode.

150  {
151  connectedNodes.resize(2);
152  connectedNodes[0] = pStrNode;
153  connectedNodes[1] = pAbsNode;
154  };
const ScalarDifferentialNode * pAbsNode
const StructNode * pStrNode
DofOrder::Order TranslAccel::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 371 of file accelerometer.cc.

References ASSERT, and DofOrder::DIFFERENTIAL.

372 {
373  ASSERT(i == 0);
374  return DofOrder::DIFFERENTIAL;
375 }
#define ASSERT(expression)
Definition: colamd.c:977
virtual Electric::Type TranslAccel::GetElectricType ( void  ) const
inlinevirtual

Implements Electric.

Definition at line 118 of file accelerometer.h.

References Electric::ACCELEROMETER.

118  {
120  };
unsigned int TranslAccel::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 365 of file accelerometer.cc.

366 {
367  return 1;
368 }
std::ostream & TranslAccel::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 285 of file accelerometer.cc.

References Dir, f, WithLabel::GetLabel(), pAbsNode, pStrNode, Electric::Restart(), and Vec3::Write().

286 {
287  Electric::Restart(out) << ", accelerometer, translational, "
288  << pStrNode->GetLabel() << ", "
289  << pAbsNode->GetLabel() << ", "
290  "reference, node, ", Dir.Write(out, ", ") << ", "
291  "reference, node, ", f.Write(out, ", ") << ';'
292  << std::endl;
293  return out;
294 }
const ScalarDifferentialNode * pAbsNode
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
virtual std::ostream & Restart(std::ostream &out) const
Definition: elec.cc:65
const StructNode * pStrNode
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void TranslAccel::SetInitialValue ( VectorHandler X)
virtual

Initialize state vector used in initial assembly. May set internal states of the element. Do not rely on being always called, because initial assembly could be implicitly or explicitly skipped

Reimplemented from DofOwnerOwner.

Definition at line 385 of file accelerometer.cc.

References NO_OP.

386 {
387  NO_OP;
388 }
#define NO_OP
Definition: myassert.h:74
void TranslAccel::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 391 of file accelerometer.cc.

References Vec3::Cross(), Dir, grad::Dot(), f, StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), pStrNode, and VectorHandler::PutCoef().

394 {
395  doublereal v =
398  X.PutCoef(iGetFirstIndex() + 1, v);
399  XP.PutCoef(iGetFirstIndex() + 1, 0.);
400 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
const StructNode * pStrNode
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

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

Implements Elem.

Definition at line 378 of file accelerometer.cc.

379 {
380  *piNumRows = 2;
381  *piNumCols = 8;
382 }

Member Data Documentation

Vec3 TranslAccel::Dir
private

Definition at line 108 of file accelerometer.h.

Referenced by AssJac(), AssRes(), Restart(), and SetValue().

Vec3 TranslAccel::f
private

Definition at line 109 of file accelerometer.h.

Referenced by AssJac(), AssRes(), Restart(), and SetValue().

const ScalarDifferentialNode* TranslAccel::pAbsNode
private

Definition at line 107 of file accelerometer.h.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), Restart(), and TranslAccel().

const StructNode* TranslAccel::pStrNode
private

Definition at line 106 of file accelerometer.h.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), Restart(), SetValue(), and TranslAccel().


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