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

#include <displacement.h>

Inheritance diagram for DispMeasure:
Collaboration diagram for DispMeasure:

Public Member Functions

 DispMeasure (unsigned int uL, const DofOwner *pD, const StructNode *pS1, const StructNode *pS2, const ScalarDifferentialNode *pA, const Vec3 &Tmpf1, const Vec3 &Tmpf2, flag fOut)
 
 ~DispMeasure (void)
 
virtual Electric::Type GetElectricType (void) const
 
virtual std::ostream & Restart (std::ostream &out) 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 SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, 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 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 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
 
virtual void SetInitialValue (VectorHandler &X)
 

Private Attributes

const StructNodepStrNode1
 
const StructNodepStrNode2
 
const ScalarDifferentialNodepAbsNode
 
Vec3 f1
 
Vec3 f2
 

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 41 of file displacement.h.

Constructor & Destructor Documentation

DispMeasure::DispMeasure ( unsigned int  uL,
const DofOwner pD,
const StructNode pS1,
const StructNode pS2,
const ScalarDifferentialNode pA,
const Vec3 Tmpf1,
const Vec3 Tmpf2,
flag  fOut 
)

Definition at line 43 of file displacement.cc.

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

48 : Elem(uL, fOut),
49 Electric(uL, pDO, fOut),
50 pStrNode1(pS1), pStrNode2(pS2), pAbsNode(pA),
51 f1(Tmpf1), f2(Tmpf2)
52 {
53  ASSERT(pStrNode1 != NULL);
55  ASSERT(pStrNode2 != NULL);
57  ASSERT(pAbsNode != NULL);
59 }
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
Electric(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: elec.cc:48
const StructNode * pStrNode2
Definition: displacement.h:44
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
#define ASSERT(expression)
Definition: colamd.c:977
virtual Node::Type GetNodeType(void) const
Definition: node.cc:169
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const StructNode * pStrNode1
Definition: displacement.h:43

Here is the call graph for this function:

DispMeasure::~DispMeasure ( void  )

Definition at line 62 of file displacement.cc.

References NO_OP.

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

Member Function Documentation

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

Implements Elem.

Definition at line 83 of file displacement.cc.

References DEBUGCOUT, DofOwnerOwner::iGetFirstIndex(), pAbsNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

87 {
88  DEBUGCOUT("Entering DispMeasure::AssJac()" << std::endl);
89 
90  /* Casting di WorkMat */
91  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
92  WM.ResizeReset(1, 0);
93 
94  /* Indici delle equazioni */
95  integer iAbstractIndex = pAbsNode->iGetFirstIndex()+1;
96 
97  WM.PutItem(1, iAbstractIndex, iAbstractIndex, dCoef);
98 
99  return WorkMat;
100 }
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
#define DEBUGCOUT(msg)
Definition: myassert.h:232
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 104 of file displacement.cc.

References a, DEBUGCOUT, ScalarDifferentialNode::dGetX(), f1, f2, StructNode::GetRCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), grad::Norm(), pAbsNode, pStrNode1, pStrNode2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), and VectorHandler::Resize().

108 {
109  DEBUGCOUT("Entering DispMeasure::AssRes()" << std::endl);
110 
111  /* Dimensiona e resetta la matrice di lavoro */
112  WorkVec.Resize(1);
113 
114  integer iAbstractIndex = pAbsNode->iGetFirstIndex() + 1;
115 
116  WorkVec.PutRowIndex(1, iAbstractIndex);
117 
120 
121  doublereal a = pAbsNode->dGetX();
122 
123  doublereal d = (x2 - x1).Norm();
124 
125  WorkVec.PutCoef(1, d - a);
126 
127  return WorkVec;
128 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pStrNode2
Definition: displacement.h:44
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
VectorExpression< VectorExpr, N_rows >::ScalarType Norm(const VectorExpression< VectorExpr, N_rows > &u)
Definition: matvec.h:3163
static const doublereal a
Definition: hfluid_.h:289
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
const StructNode * pStrNode1
Definition: displacement.h:43

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 87 of file displacement.h.

References pAbsNode, pStrNode1, and pStrNode2.

87  {
88  connectedNodes.resize(3);
89  connectedNodes[0] = pStrNode1;
90  connectedNodes[1] = pStrNode2;
91  connectedNodes[2] = pAbsNode;
92  };
const StructNode * pStrNode2
Definition: displacement.h:44
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
const StructNode * pStrNode1
Definition: displacement.h:43
virtual Electric::Type DispMeasure::GetElectricType ( void  ) const
inlinevirtual

Implements Electric.

Definition at line 57 of file displacement.h.

References Electric::DISPLACEMENT.

57  {
59  };
std::ostream & DispMeasure::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 69 of file displacement.cc.

References f1, f2, WithLabel::GetLabel(), pAbsNode, pStrNode1, pStrNode2, Electric::Restart(), and Vec3::Write().

70 {
71  Electric::Restart(out) << ", displacement, "
72  << pStrNode1->GetLabel() << ", "
73  "reference, node, ", f1.Write(out, ", ") << ", "
74  << pStrNode2->GetLabel() << ", "
75  "reference, node, ", f2.Write(out, ", ") << ", "
76  << pAbsNode->GetLabel() << ';'
77  << std::endl;
78  return out;
79 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
const StructNode * pStrNode2
Definition: displacement.h:44
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
virtual std::ostream & Restart(std::ostream &out) const
Definition: elec.cc:65
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const StructNode * pStrNode1
Definition: displacement.h:43

Here is the call graph for this function:

void DispMeasure::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 140 of file displacement.cc.

References grad::Cross(), f1, f2, StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), grad::Norm(), pAbsNode, pStrNode1, pStrNode2, and VectorHandler::PutCoef().

143 {
144  integer iIndex = pAbsNode->iGetFirstIndex() + 1;
145 
146  /* distanza */
147  Vec3 ff1 = pStrNode1->GetRCurr()*f1;
148  Vec3 ff2 = pStrNode2->GetRCurr()*f2;
149 
150  Vec3 x1 = pStrNode1->GetXCurr()+ff1;
151  Vec3 x2 = pStrNode2->GetXCurr()+ff2;
152 
153  doublereal d = (x2 - x1).Norm();
154 
155  const_cast<ScalarDifferentialNode *>(pAbsNode)->SetX(d);
156  X.PutCoef(iIndex, d);
157 
158  /* velocita' */
159  Vec3 v1 = pStrNode1->GetVCurr() + (pStrNode1->GetWCurr()).Cross(ff1);
160  Vec3 v2 = pStrNode2->GetVCurr() + (pStrNode2->GetWCurr()).Cross(ff2);
161 
162  doublereal v = (v2 - v1).Norm();
163 
164  const_cast<ScalarDifferentialNode *>(pAbsNode)->SetXPrime(v);
165 
166  XP.PutCoef(iIndex, v);
167 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * pStrNode2
Definition: displacement.h:44
const ScalarDifferentialNode * pAbsNode
Definition: displacement.h:45
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void PutCoef(integer iRow, const doublereal &dCoef)=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
VectorExpression< VectorExpr, N_rows >::ScalarType Norm(const VectorExpression< VectorExpr, N_rows > &u)
Definition: matvec.h:3163
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const StructNode * pStrNode1
Definition: displacement.h:43

Here is the call graph for this function:

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

Implements Elem.

Definition at line 131 of file displacement.cc.

132 {
133  *piNumRows = 1;
134  *piNumCols = 1;
135 }

Member Data Documentation

Vec3 DispMeasure::f1
private

Definition at line 46 of file displacement.h.

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

Vec3 DispMeasure::f2
private

Definition at line 47 of file displacement.h.

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

const ScalarDifferentialNode* DispMeasure::pAbsNode
mutableprivate

Definition at line 45 of file displacement.h.

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

const StructNode* DispMeasure::pStrNode1
private

Definition at line 43 of file displacement.h.

Referenced by AssRes(), DispMeasure(), GetConnectedNodes(), Restart(), and SetValue().

const StructNode* DispMeasure::pStrNode2
private

Definition at line 44 of file displacement.h.

Referenced by AssRes(), DispMeasure(), GetConnectedNodes(), Restart(), and SetValue().


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