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

#include <actuator.h>

Inheritance diagram for Actuator:
Collaboration diagram for Actuator:

Public Member Functions

 Actuator (unsigned int uL, const DofOwner *pD, const PressureNode *p1, const PressureNode *p2, const StructNode *pN1, const StructNode *pN2, const Vec3 &f1Tmp, const Vec3 &f2Tmp, const Vec3 &axisTmp, HydraulicFluid *hf1, HydraulicFluid *hf2, doublereal A_1, doublereal A_2, doublereal l, flag fOut)
 
 ~Actuator (void)
 
virtual HydraulicElem::Type GetHydraulicType (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 DofOrder::Order GetEqType (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 Output (OutputHandler &OH) const
 
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 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 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 HydraulicElem
 HydraulicElem (unsigned int uL, const DofOwner *pDO, HydraulicFluid *hf, flag fOut)
 
virtual ~HydraulicElem (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 PressureNodepNodeHyd1
 
const PressureNodepNodeHyd2
 
HydraulicFluidHF2
 
doublereal area1
 
doublereal area2
 
doublereal dl
 
const Vec3 axis
 
doublereal dp1
 
doublereal dp2
 
doublereal dpP1
 
doublereal dpP2
 
doublereal flow1
 
doublereal flow2
 
doublereal Vol1
 
doublereal Vol2
 
doublereal density1
 
doublereal density2
 
const StructNodepNodeStr1
 
const StructNodepNodeStr2
 
const Vec3 f1
 
const 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 HydraulicElem
enum  Type {
  UNKNOWN = -1, MINOR_LOSS = 0, THREEWAYMINORLOSS, CONTROL_VALVE,
  DYNAMIC_CONTROL_VALVE, PRESSURE_FLOW_CONTROL_VALVE, PRESSURE_VALVE, FLOW_VALVE,
  ORIFICE, ACCUMULATOR, TANK, PIPE,
  DYNAMIC_PIPE, HYDRAULIC_ACTUATOR, ACTUATOR, LASTHYDRAULICTYPE
}
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from HydraulicElem
HydraulicFluidHF
 

Detailed Description

Definition at line 44 of file actuator.h.

Constructor & Destructor Documentation

Actuator::Actuator ( unsigned int  uL,
const DofOwner pD,
const PressureNode p1,
const PressureNode p2,
const StructNode pN1,
const StructNode pN2,
const Vec3 f1Tmp,
const Vec3 f2Tmp,
const Vec3 axisTmp,
HydraulicFluid hf1,
HydraulicFluid hf2,
doublereal  A_1,
doublereal  A_2,
doublereal  l,
flag  fOut 
)

Definition at line 100 of file actuator.cc.

References area1, area2, ASSERT, dl, PressureNode::GetNodeType(), StructDispNode::GetNodeType(), HF2, Node::HYDRAULIC, pNodeHyd1, pNodeHyd2, pNodeStr1, pNodeStr2, and Node::STRUCTURAL.

112 : Elem(uL, fOut),
113 HydraulicElem(uL, pDO, hf1, fOut),
114 pNodeHyd1(p1), pNodeHyd2(p2),
115 HF2(hf2),
116 area1(A_1), area2(A_2),
117 dl(l), axis(axisTmp),
118 dp1(0.),
119 dp2(0.),
120 dpP1(0.),
121 dpP2(0.),
122 flow1(0.),
123 flow2(0.),
124 Vol1(0.),
125 Vol2(0.),
126 density1(0.),
127 density2(0.),
128 pNodeStr1(pN1), pNodeStr2(pN2), f1(f1Tmp), f2(f2Tmp)
129 {
130  ASSERT(pNodeHyd1 != NULL);
132  ASSERT(pNodeHyd2 != NULL);
134  ASSERT(area1 > std::numeric_limits<doublereal>::epsilon());
135  ASSERT(area2 > std::numeric_limits<doublereal>::epsilon());
136  ASSERT(dl > std::numeric_limits<doublereal>::epsilon());
137  ASSERT(pNodeStr1 != NULL);
139  ASSERT(pNodeStr2 != NULL);
141  ASSERT(HF2 != NULL);
142 }
doublereal dp2
Definition: actuator.h:58
const Vec3 f2
Definition: actuator.h:72
doublereal area2
Definition: actuator.h:50
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
const PressureNode * pNodeHyd1
Definition: actuator.h:46
doublereal dp1
Definition: actuator.h:57
doublereal dl
Definition: actuator.h:52
doublereal Vol2
Definition: actuator.h:65
HydraulicElem(unsigned int uL, const DofOwner *pDO, HydraulicFluid *hf, flag fOut)
Definition: preselem.cc:54
doublereal flow2
Definition: actuator.h:63
doublereal density2
Definition: actuator.h:67
#define ASSERT(expression)
Definition: colamd.c:977
const Vec3 axis
Definition: actuator.h:55
const Vec3 f1
Definition: actuator.h:71
doublereal density1
Definition: actuator.h:66
HydraulicFluid * HF2
Definition: actuator.h:48
doublereal dpP1
Definition: actuator.h:59
doublereal flow1
Definition: actuator.h:62
doublereal dpP2
Definition: actuator.h:60
virtual Node::Type GetNodeType(void) const
Definition: presnode.h:54
const StructNode * pNodeStr1
Definition: actuator.h:69
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
doublereal Vol1
Definition: actuator.h:64
doublereal area1
Definition: actuator.h:49
const PressureNode * pNodeHyd2
Definition: actuator.h:47
const StructNode * pNodeStr2
Definition: actuator.h:70

Here is the call graph for this function:

Actuator::~Actuator ( void  )

Definition at line 144 of file actuator.cc.

References HF2, and SAFEDELETE.

145 {
146  if (HF2 != NULL) {
147  SAFEDELETE(HF2);
148  }
149 }
HydraulicFluid * HF2
Definition: actuator.h:48
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 193 of file actuator.cc.

References FullSubMatrixHandler::Add(), area1, area2, axis, Vec3::Cross(), DEBUGCOUT, density1, density2, Vec3::dGet(), HydraulicFluid::dGetDensity(), HydraulicFluid::dGetDensityDPres(), ScalarAlgebraicNode::dGetX(), dl, Vec3::Dot(), dpP1, dpP2, f1, f2, StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWRef(), StructDispNode::GetXCurr(), HF1, HF2, Node::iGetFirstColIndex(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), Node::iGetFirstRowIndex(), MatCross, pNodeHyd1, pNodeHyd2, pNodeStr1, pNodeStr2, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

197 {
198  DEBUGCOUT("Entering Actuator::AssJac()" << std::endl);
199 
200  FullSubMatrixHandler& WM = WorkMat.SetFull();
201  WM.ResizeReset(16, 16);
202 
203  /* Recupera gli indici */
204  integer iNode1FirstPosIndex = pNodeStr1->iGetFirstPositionIndex();
205  integer iNode1FirstMomIndex = pNodeStr1->iGetFirstMomentumIndex();
206  integer iNode2FirstPosIndex = pNodeStr2->iGetFirstPositionIndex();
207  integer iNode2FirstMomIndex = pNodeStr2->iGetFirstMomentumIndex();
208  integer iIndex = iGetFirstIndex();
209 
210  /* Setta gli indici della matrice */
211  for (int iCnt = 1; iCnt <= 6; iCnt++) {
212  WM.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
213  WM.PutColIndex(iCnt, iNode1FirstPosIndex+iCnt);
214  WM.PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
215  WM.PutColIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
216  }
217 
218  integer iNode1RowIndex = pNodeHyd1->iGetFirstRowIndex()+1;
219  integer iNode1ColIndex = pNodeHyd1->iGetFirstColIndex()+1;
220  integer iNode2RowIndex = pNodeHyd2->iGetFirstRowIndex()+1;
221  integer iNode2ColIndex = pNodeHyd2->iGetFirstColIndex()+1;
222 
223  WM.PutRowIndex(13, iNode1RowIndex);
224  WM.PutColIndex(13, iNode1ColIndex);
225  WM.PutRowIndex(14, iNode2RowIndex);
226  WM.PutColIndex(14, iNode2ColIndex);
227 
228  WM.PutRowIndex(15, iIndex+1);
229  WM.PutColIndex(15, iIndex+1);
230  WM.PutRowIndex(16, iIndex+2);
231  WM.PutColIndex(16, iIndex+2);
232 
233  doublereal p1 = pNodeHyd1->dGetX();
234  doublereal p2 = pNodeHyd2->dGetX();
235 
236  doublereal density1 = HF1->dGetDensity(p1);
238  doublereal densityDP1 = HF1->dGetDensityDPres(p1);
239  doublereal densityDP2 = HF2->dGetDensityDPres(p2);
240 
241  Vec3 x1(pNodeStr1->GetXCurr());
242  Vec3 x2(pNodeStr2->GetXCurr());
243  Mat3x3 R1(pNodeStr1->GetRRef());
244  Mat3x3 R2(pNodeStr2->GetRRef());
245 
246  Vec3 f1Tmp(R1*f1);
247  Vec3 f2Tmp(R2*f2);
248 
249  Vec3 v1(pNodeStr1->GetVCurr());
250  Vec3 v2(pNodeStr2->GetVCurr());
251  Vec3 Omega1(pNodeStr1->GetWRef());
252  Vec3 Omega2(pNodeStr2->GetWRef());
253 
254  Vec3 TmpAxis(R1*axis);
255 
256  Vec3 FHyd = TmpAxis*(area1*p1-area2*p2); /* forza idraulica (scalare) */
257 
258  doublereal dDist = TmpAxis.Dot(x2+f2Tmp-x1-f1Tmp);
259  doublereal dVel = TmpAxis.Dot(v2+Omega2.Cross(f2Tmp)-v1-Omega1.Cross(f1Tmp));
260 
261  /* prima equazione & terza equazione
262  * moltiplica deltagpuntonodo1 */
263  Mat3x3 JacMatWedge1(MatCross, FHyd*dCoef);
264  WM.Sub(1, 4, JacMatWedge1);
265  WM.Add(7, 4, JacMatWedge1);
266 
267  /* moltiplica deltaP1 e deltaP2 */
268  for (int iCnt = 1; iCnt <= 3; iCnt++) {
269  doublereal d = TmpAxis.dGet(iCnt);
270  doublereal d1 = d*area1;
271  doublereal d2 = d*area2;
272 
273  WM.PutCoef(iCnt, 13, d1);
274  WM.PutCoef(6+iCnt, 13, -d1);
275 
276 
277  WM.PutCoef(iCnt, 14, -d2);
278  WM.PutCoef(6+iCnt, 14, d2);
279  }
280 
281  /* seconda equazione moltiplica deltagpuntonodo1 */
282  WM.Sub(4, 4, Mat3x3(MatCross, f1Tmp.Cross(FHyd*dCoef)));
283 
284  /* moltiplica deltaP1 e deltaP2 */
285  Vec3 JacVec = f1Tmp.Cross(TmpAxis);
286  for (int iCnt = 1; iCnt <= 3; iCnt++) {
287  doublereal d = JacVec.dGet(iCnt);
288 
289  WM.PutCoef(3+iCnt, 13, d*area1);
290  WM.PutCoef(3+iCnt, 14, -d*area2);
291  }
292 
293  /* quarta equazione moltiplica deltagpuntonodo1 */
294  Mat3x3 TmpMat(MatCross, f2Tmp.Cross(FHyd*dCoef));
295  WM.Add(4, 4, TmpMat);
296  WM.Sub(4, 10, TmpMat);
297 
298  /* moltiplica deltaP1 e deltaP2 */
299  JacVec = f2Tmp.Cross(TmpAxis);
300  for (int iCnt = 1; iCnt <=3; iCnt++) {
301  doublereal d = JacVec.dGet(iCnt);
302 
303  WM.PutCoef(9+iCnt, 13, -d*area1);
304  WM.PutCoef(9+iCnt, 14, d*area2);
305  }
306 
307  /* inerzia del fluido */
308  WM.PutCoef(13, 15, -densityDP1*dDist*area1);
309  WM.PutCoef(13, 13, -densityDP1*dVel*area1);
310  WM.PutCoef(14, 16, -densityDP2*(dl-dDist)*area2);
311  WM.PutCoef(14, 14, densityDP2*dVel*area2);
312 
313  /* termini in spostamento e velocita' */
314  doublereal rho1A1 = (density1+dCoef*densityDP1*dpP1)*area1;
315  doublereal rho2A2 = (density2+dCoef*densityDP2*dpP2)*area2;
316 
317  for (int iCnt = 1; iCnt <= 3; iCnt++) {
318  doublereal d = TmpAxis.dGet(iCnt);
319  WM.PutCoef(13, iCnt, d*rho1A1);
320  WM.PutCoef(13, 6+iCnt, -d*rho1A1);
321 
322  WM.PutCoef(14, iCnt, -d*rho2A2);
323  WM.PutCoef(14, 6+iCnt, d*rho2A2);
324  }
325 
326  /* prima eq., nodo 1 */
327  JacVec = (TmpAxis.Cross(x2+f2Tmp-x1))*(densityDP1*dpP1*dCoef)
328  +(TmpAxis.Cross(f1Tmp+(x2+Omega2.Cross(f2Tmp)-x1)*dCoef))*density1;
329  for (int iCnt = 1; iCnt <= 3; iCnt++) {
330  WM.PutCoef(13, 3+iCnt, -JacVec.dGet(iCnt)*area1);
331  }
332 
333  /* prima eq., nodo 2 */
334  JacVec = (TmpAxis.Cross(f2Tmp))*(densityDP1*dpP1*dCoef)
335  +(TmpAxis.Cross(f2Tmp+(Omega2.Cross(f2Tmp))*dCoef))*density1;
336  for (int iCnt = 1; iCnt <= 3; iCnt++) {
337  WM.PutCoef(13, 9+iCnt, JacVec.dGet(iCnt)*area1);
338  }
339 
340  /* seconda eq., nodo 1 */
341  JacVec = (TmpAxis.Cross(x2+f2Tmp-x1))*(densityDP2*dpP2*dCoef)
342  +(TmpAxis.Cross(f1Tmp+(x2+Omega2.Cross(f2Tmp)-x1)*dCoef))*density2;
343  for (int iCnt = 1; iCnt <= 3; iCnt++) {
344  WM.PutCoef(14, 3+iCnt, JacVec.dGet(iCnt)*area2);
345  }
346 
347  /* seconda eq., nodo 2 */
348  JacVec = (TmpAxis.Cross(f2Tmp))*(densityDP2*dpP2*dCoef)
349  +(TmpAxis.Cross(f2Tmp+(Omega2.Cross(f2Tmp))*dCoef))*density2;
350  for (int iCnt = 1; iCnt <= 3; iCnt++) {
351  WM.PutCoef(14, 9+iCnt, JacVec.dGet(iCnt)*area2);
352  }
353 
354  /* definizione della pressione interna */
355 
356  WM.PutCoef(15, 15, dCoef);
357  WM.PutCoef(15, 13, -1.);
358 
359  WM.PutCoef(16, 16, dCoef);
360  WM.PutCoef(16, 14, -1.);
361 
362  return WorkMat;
363 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
const Vec3 f2
Definition: actuator.h:72
Definition: matvec3.h:98
doublereal area2
Definition: actuator.h:50
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual doublereal dGetDensityDPres(void) const =0
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
const PressureNode * pNodeHyd1
Definition: actuator.h:46
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
doublereal dl
Definition: actuator.h:52
virtual doublereal dGetDensity(void) const =0
virtual const doublereal & dGetX(void) const
Definition: node.h:492
#define HF1
Definition: actuator.cc:96
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
#define DEBUGCOUT(msg)
Definition: myassert.h:232
doublereal density2
Definition: actuator.h:67
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const Vec3 axis
Definition: actuator.h:55
const Vec3 f1
Definition: actuator.h:71
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
doublereal density1
Definition: actuator.h:66
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
HydraulicFluid * HF2
Definition: actuator.h:48
doublereal dpP1
Definition: actuator.h:59
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
doublereal dpP2
Definition: actuator.h:60
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
const StructNode * pNodeStr1
Definition: actuator.h:69
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal area1
Definition: actuator.h:49
const PressureNode * pNodeHyd2
Definition: actuator.h:47
const StructNode * pNodeStr2
Definition: actuator.h:70
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

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

Implements Elem.

Definition at line 367 of file actuator.cc.

References VectorHandler::Add(), area1, area2, axis, Vec3::Cross(), density1, density2, HydraulicFluid::dGetDensity(), HydraulicFluid::dGetDensityDPres(), ScalarAlgebraicNode::dGetX(), dl, Vec3::Dot(), dp1, dp2, dpP1, dpP2, f1, f2, flow1, flow2, StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), HF1, HF2, DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), Node::iGetFirstRowIndex(), pNodeHyd1, pNodeHyd2, pNodeStr1, pNodeStr2, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), VectorHandler::Sub(), Vol1, and Vol2.

372 {
373  WorkVec.ResizeReset(16);
374 
375  integer iNode1RowIndex = pNodeHyd1->iGetFirstRowIndex()+1;
376  integer iNode2RowIndex = pNodeHyd2->iGetFirstRowIndex()+1;
377  integer iNode1FirstMomIndex = pNodeStr1->iGetFirstMomentumIndex();
378  integer iNode2FirstMomIndex = pNodeStr2->iGetFirstMomentumIndex();
379  integer iIndex = iGetFirstIndex();
380 
381  /* Setta gli indici */
382  for (int iCnt = 1; iCnt <= 6; iCnt++) {
383  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
384  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
385  }
386 
387  WorkVec.PutRowIndex(13, iNode1RowIndex);
388  WorkVec.PutRowIndex(14, iNode2RowIndex);
389 
390  WorkVec.PutRowIndex(15, iIndex+1);
391  WorkVec.PutRowIndex(16, iIndex+2);
392 
393  /* Dati */
394  doublereal p1 = pNodeHyd1->dGetX();
395  doublereal p2 = pNodeHyd2->dGetX();
396 
397  dp1 = XCurr(iIndex+1);
398  dp2 = XCurr(iIndex+2);
399 
400  dpP1 = XPrimeCurr(iIndex+1);
401  dpP2 = XPrimeCurr(iIndex+2);
402 
403  Vec3 x1(pNodeStr1->GetXCurr());
404  Vec3 x2(pNodeStr2->GetXCurr());
405  Mat3x3 R1(pNodeStr1->GetRCurr());
406  Mat3x3 R2(pNodeStr2->GetRCurr());
407 
408  Vec3 v1(pNodeStr1->GetVCurr());
409  Vec3 v2(pNodeStr2->GetVCurr());
410  Vec3 Omega1(pNodeStr1->GetWCurr());
411  Vec3 Omega2(pNodeStr2->GetWCurr());
412 
413  Vec3 f1Tmp(R1*f1);
414  Vec3 f2Tmp(R2*f2);
415 
416  density1 = HF1->dGetDensity(p1);
417  density2 = HF2->dGetDensity(p2);
418 
419  doublereal densityDP1 = HF1->dGetDensityDPres(p1);
420  doublereal densityDP2 = HF2->dGetDensityDPres(p2);
421 
422  /* asse nel sistema globale */
423  Vec3 TmpAxis(R1*axis);
424 
425  /* Calcolo della forza */
426  Vec3 FHyd = TmpAxis*(area1*p1-area2*p2);
427 
428  /* Calcolo delle portate */
429  /*
430  * FIXME: manca nello Jacobiano un pezzo della velocita'
431  * dell'attuatore dipendente dalla velocita' angolare dell'asse
432  */
433  Vec3 Dist = x2+f2Tmp-x1-f1Tmp;
434  doublereal dDist = TmpAxis*Dist;
435  doublereal dVel = TmpAxis.Dot(v2+Omega2.Cross(f2Tmp)-v1-Omega1.Cross(f1Tmp))
436  +Dist*(Omega1.Cross(TmpAxis));
437  flow1 = area1*(densityDP1*dpP1*dDist+density1*dVel);
438  flow2 = area2*(densityDP2*dpP2*(dl-dDist)-density2*dVel);
439  Vol1 = area1*dDist;
440  Vol2 = area2*(dl-dDist);
441 
442  /* Forze e coppia sul nodo strutturale 1 */
443  WorkVec.Sub(1, FHyd);
444  WorkVec.Sub(4, f1Tmp.Cross(FHyd));
445 
446  /* Forze e coppia sul nodo strutturale 2 */
447  WorkVec.Add(7, FHyd);
448  WorkVec.Add(10, f2Tmp.Cross(FHyd));
449 
450  /* Portata sul nodo idraulico 1 */
451  WorkVec.PutCoef(13, flow1);
452 
453  /* Portata sul nodo idraulico 2 */
454  WorkVec.PutCoef(14, flow2);
455 
456  /* pressioni */
457  WorkVec.PutCoef(15, p1-dp1);
458  WorkVec.PutCoef(16, p2-dp2);
459 
460  return WorkVec;
461 }
doublereal dp2
Definition: actuator.h:58
const Vec3 f2
Definition: actuator.h:72
Definition: matvec3.h:98
doublereal area2
Definition: actuator.h:50
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual doublereal dGetDensityDPres(void) const =0
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
const PressureNode * pNodeHyd1
Definition: actuator.h:46
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
doublereal dp1
Definition: actuator.h:57
doublereal dl
Definition: actuator.h:52
doublereal Vol2
Definition: actuator.h:65
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual doublereal dGetDensity(void) const =0
virtual const doublereal & dGetX(void) const
Definition: node.h:492
#define HF1
Definition: actuator.cc:96
doublereal flow2
Definition: actuator.h:63
doublereal density2
Definition: actuator.h:67
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual integer iGetFirstMomentumIndex(void) const =0
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const Vec3 axis
Definition: actuator.h:55
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
const Vec3 f1
Definition: actuator.h:71
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
doublereal density1
Definition: actuator.h:66
HydraulicFluid * HF2
Definition: actuator.h:48
doublereal dpP1
Definition: actuator.h:59
doublereal flow1
Definition: actuator.h:62
doublereal dpP2
Definition: actuator.h:60
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
const StructNode * pNodeStr1
Definition: actuator.h:69
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal Vol1
Definition: actuator.h:64
doublereal area1
Definition: actuator.h:49
const PressureNode * pNodeHyd2
Definition: actuator.h:47
const StructNode * pNodeStr2
Definition: actuator.h:70

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 119 of file actuator.h.

References pNodeHyd1, pNodeHyd2, pNodeStr1, and pNodeStr2.

119  {
120  connectedNodes.resize(4);
121  connectedNodes[0] = pNodeHyd1;
122  connectedNodes[1] = pNodeHyd2;
123  connectedNodes[2] = pNodeStr1;
124  connectedNodes[3] = pNodeStr2;
125  };
const PressureNode * pNodeHyd1
Definition: actuator.h:46
const StructNode * pNodeStr1
Definition: actuator.h:69
const PressureNode * pNodeHyd2
Definition: actuator.h:47
const StructNode * pNodeStr2
Definition: actuator.h:70
DofOrder::Order Actuator::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 171 of file actuator.cc.

References DofOrder::DIFFERENTIAL.

172 {
173  return DofOrder::DIFFERENTIAL;
174 }
DofOrder::Order Actuator::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 177 of file actuator.cc.

References DofOrder::DIFFERENTIAL.

178 {
179  return DofOrder::DIFFERENTIAL;
180 }
HydraulicElem::Type Actuator::GetHydraulicType ( void  ) const
virtual

Implements HydraulicElem.

Definition at line 152 of file actuator.cc.

References HydraulicElem::ACTUATOR.

153 {
155 }
unsigned int Actuator::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 165 of file actuator.cc.

166 {
167  return 2;
168 }
void Actuator::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 464 of file actuator.cc.

References ToBeOutput::bToBeOutput(), density1, density2, dp1, dp2, dpP1, dpP2, flow1, flow2, WithLabel::GetLabel(), OutputHandler::Hydraulic(), Vol1, and Vol2.

465 {
466  if (bToBeOutput()) {
467  std::ostream& out = OH.Hydraulic();
468  out << std::setw(8) << GetLabel()
469  << " " << flow1 << " " << flow2
470  << " " << dp1 << " " << dp2
471  << " " << dpP1 << " " << dpP2
472  << " " << Vol1 << " " << Vol2
473  << " " << density1 << " " << density2
474  << std::endl;
475  }
476 }
doublereal dp2
Definition: actuator.h:58
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dp1
Definition: actuator.h:57
doublereal Vol2
Definition: actuator.h:65
doublereal flow2
Definition: actuator.h:63
doublereal density2
Definition: actuator.h:67
doublereal density1
Definition: actuator.h:66
doublereal dpP1
Definition: actuator.h:59
doublereal flow1
Definition: actuator.h:62
doublereal dpP2
Definition: actuator.h:60
std::ostream & Hydraulic(void) const
Definition: output.h:492
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal Vol1
Definition: actuator.h:64

Here is the call graph for this function:

std::ostream & Actuator::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 159 of file actuator.cc.

160 {
161  return out << "Actuator not implemented yet!" << std::endl;
162 }
void Actuator::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 479 of file actuator.cc.

References ScalarAlgebraicNode::dGetX(), dp1, dp2, dpP1, dpP2, DofOwnerOwner::iGetFirstIndex(), pNodeHyd1, pNodeHyd2, and VectorHandler::PutCoef().

482 {
483  integer iIndex = iGetFirstIndex();
484  (doublereal&)dp1 = pNodeHyd1->dGetX();
485  (doublereal&)dp2 = pNodeHyd2->dGetX();
486  (doublereal&)dpP1 = 0.;
487  (doublereal&)dpP2 = 0.;
488 
489  X.PutCoef(iIndex+1, dp1);
490  X.PutCoef(iIndex+2, dp2);
491  XP.PutCoef(iIndex+1, dpP1);
492  XP.PutCoef(iIndex+2, dpP2);
493 }
doublereal dp2
Definition: actuator.h:58
const PressureNode * pNodeHyd1
Definition: actuator.h:46
doublereal dp1
Definition: actuator.h:57
virtual const doublereal & dGetX(void) const
Definition: node.h:492
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
doublereal dpP1
Definition: actuator.h:59
doublereal dpP2
Definition: actuator.h:60
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const PressureNode * pNodeHyd2
Definition: actuator.h:47

Here is the call graph for this function:

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

Implements Elem.

Definition at line 184 of file actuator.cc.

185 {
186  *piNumRows = 16;
187  *piNumCols = 16;
188 
189 }

Member Data Documentation

doublereal Actuator::area1
private

Definition at line 49 of file actuator.h.

Referenced by Actuator(), AssJac(), and AssRes().

doublereal Actuator::area2
private

Definition at line 50 of file actuator.h.

Referenced by Actuator(), AssJac(), and AssRes().

const Vec3 Actuator::axis
private

Definition at line 55 of file actuator.h.

Referenced by AssJac(), and AssRes().

doublereal Actuator::density1
private

Definition at line 66 of file actuator.h.

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

doublereal Actuator::density2
private

Definition at line 67 of file actuator.h.

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

doublereal Actuator::dl
private

Definition at line 52 of file actuator.h.

Referenced by Actuator(), AssJac(), and AssRes().

doublereal Actuator::dp1
private

Definition at line 57 of file actuator.h.

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

doublereal Actuator::dp2
private

Definition at line 58 of file actuator.h.

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

doublereal Actuator::dpP1
private

Definition at line 59 of file actuator.h.

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

doublereal Actuator::dpP2
private

Definition at line 60 of file actuator.h.

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

const Vec3 Actuator::f1
private

Definition at line 71 of file actuator.h.

Referenced by AssJac(), and AssRes().

const Vec3 Actuator::f2
private

Definition at line 72 of file actuator.h.

Referenced by AssJac(), and AssRes().

doublereal Actuator::flow1
private

Definition at line 62 of file actuator.h.

Referenced by AssRes(), and Output().

doublereal Actuator::flow2
private

Definition at line 63 of file actuator.h.

Referenced by AssRes(), and Output().

HydraulicFluid* Actuator::HF2
private

Definition at line 48 of file actuator.h.

Referenced by Actuator(), AssJac(), AssRes(), and ~Actuator().

const PressureNode* Actuator::pNodeHyd1
private

Definition at line 46 of file actuator.h.

Referenced by Actuator(), AssJac(), AssRes(), GetConnectedNodes(), and SetValue().

const PressureNode* Actuator::pNodeHyd2
private

Definition at line 47 of file actuator.h.

Referenced by Actuator(), AssJac(), AssRes(), GetConnectedNodes(), and SetValue().

const StructNode* Actuator::pNodeStr1
private

Definition at line 69 of file actuator.h.

Referenced by Actuator(), AssJac(), AssRes(), and GetConnectedNodes().

const StructNode* Actuator::pNodeStr2
private

Definition at line 70 of file actuator.h.

Referenced by Actuator(), AssJac(), AssRes(), and GetConnectedNodes().

doublereal Actuator::Vol1
private

Definition at line 64 of file actuator.h.

Referenced by AssRes(), and Output().

doublereal Actuator::Vol2
private

Definition at line 65 of file actuator.h.

Referenced by AssRes(), and Output().


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