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

#include <rottrim.h>

Inheritance diagram for RotorTrimBase:
Collaboration diagram for RotorTrimBase:

Public Member Functions

 RotorTrimBase (unsigned int uL, const DofOwner *pDO, const ScalarDifferentialNode *pNode1, const ScalarDifferentialNode *pNode2, const ScalarDifferentialNode *pNode3, const DriveCaller *pDThrust, const DriveCaller *pDRollMoment, const DriveCaller *pDPitchMoment, const doublereal &dG, const doublereal &dp, const doublereal &dT0, const doublereal &dT1, const doublereal &dK0, const doublereal &dK1, const DriveCaller *pTrigger, flag fOut)
 
virtual ~RotorTrimBase (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual Genel::Type GetGenelType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &, const VectorHandler &)
 
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 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
 
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 Genel
 Genel (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Genel (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
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)
 

Protected Member Functions

virtual void GetData (doublereal &dThrust, doublereal &dRollMoment, doublereal &dPitchMoment, doublereal &dRho, doublereal &dOmega, doublereal &dMu) const =0
 

Protected Attributes

doublereal dRadius
 
const ScalarDifferentialNodepvNodes [3]
 
DriveOwner DThrust
 
DriveOwner DRollMoment
 
DriveOwner DPitchMoment
 
DriveOwner Trigger
 
doublereal dGamma
 
doublereal dP
 
doublereal dP2
 
doublereal dC
 
doublereal dC2
 
doublereal dTau0
 
doublereal dTau1
 
doublereal dKappa0
 
doublereal dKappa1
 
- 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 Genel
enum  Type {
  UNKNOWN = -1, SWASHPLATE = 0, ROTORTRIM, CLAMP,
  DISTANCE, SPRING, SPRINGSUPPORT, CROSSSPRINGSUPPORT,
  SPRINGDAMPER, SPRINGDAMPERSUPPORT, CROSSSPRINGDAMPERSUPPORT, MASS,
  SCALARFILTER, STATESPACESISO, STATESPACEMIMO, LASTGENELTYPE
}
 

Detailed Description

Definition at line 58 of file rottrim.h.

Constructor & Destructor Documentation

RotorTrimBase::RotorTrimBase ( unsigned int  uL,
const DofOwner pDO,
const ScalarDifferentialNode pNode1,
const ScalarDifferentialNode pNode2,
const ScalarDifferentialNode pNode3,
const DriveCaller pDThrust,
const DriveCaller pDRollMoment,
const DriveCaller pDPitchMoment,
const doublereal dG,
const doublereal dp,
const doublereal dT0,
const doublereal dT1,
const doublereal dK0,
const doublereal dK1,
const DriveCaller pTrigger,
flag  fOut 
)

Definition at line 41 of file rottrim.cc.

References ASSERT, dGamma, dP, and pvNodes.

57 : Elem(uL, fOut),
58 Genel(uL, pDO, fOut),
59 dRadius(-1.),
60 DThrust(pDThrust),
61 DRollMoment(pDRollMoment),
62 DPitchMoment(pDPitchMoment),
63 Trigger(pTrigger),
64 dGamma(dG),
65 dP(dp),
66 dP2(dP*dP),
67 dC(8.*(dP*dP - 1.)/dGamma),
68 dC2(dC*dC),
69 dTau0(dT0),
70 dTau1(dT1),
71 dKappa0(dK0),
72 dKappa1(dK1)
73 {
74  ASSERT(pNode1 != NULL);
75  ASSERT(pNode2 != NULL);
76  ASSERT(pNode3 != NULL);
77  ASSERT(dGamma > 0.);
78  ASSERT(dP > 0.);
79 
80  pvNodes[0] = pNode1;
81  pvNodes[1] = pNode2;
82  pvNodes[2] = pNode3;
83 }
doublereal dC2
Definition: rottrim.h:70
doublereal dKappa1
Definition: rottrim.h:75
DriveOwner DThrust
Definition: rottrim.h:62
doublereal dC
Definition: rottrim.h:69
doublereal dRadius
Definition: rottrim.h:60
doublereal dTau1
Definition: rottrim.h:73
DriveOwner DPitchMoment
Definition: rottrim.h:62
DriveOwner Trigger
Definition: rottrim.h:63
doublereal dTau0
Definition: rottrim.h:72
doublereal dGamma
Definition: rottrim.h:65
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dP
Definition: rottrim.h:66
Genel(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: genel.cc:44
doublereal dP2
Definition: rottrim.h:68
DriveOwner DRollMoment
Definition: rottrim.h:62
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
doublereal dKappa0
Definition: rottrim.h:74
const ScalarDifferentialNode * pvNodes[3]
Definition: rottrim.h:61
RotorTrimBase::~RotorTrimBase ( void  )
virtual

Definition at line 85 of file rottrim.cc.

References NO_OP.

86 {
87  NO_OP;
88 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

VariableSubMatrixHandler & RotorTrimBase::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler ,
const VectorHandler  
)
virtual

Implements Elem.

Definition at line 106 of file rottrim.cc.

References DEBUGCOUT, DriveOwner::dGet(), dTau0, dTau1, Node::iGetFirstColIndex(), Node::iGetFirstRowIndex(), SparseSubMatrixHandler::PutItem(), pvNodes, SparseSubMatrixHandler::Resize(), VariableSubMatrixHandler::SetSparse(), and Trigger.

110 {
111  DEBUGCOUT("Entering RotorTrimBase::AssJac()" << std::endl);
112 
113  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
114  WM.Resize(3, 0);
115 
116  doublereal d[3];
117  if (Trigger.dGet() == 0.) {
118  d[0] = dCoef;
119  d[1] = dCoef;
120  d[2] = dCoef;
121 
122  } else {
123  d[0] = dTau0 + dCoef;
124  d[1] = dTau1 + dCoef;
125  d[2] = dTau1 + dCoef;
126  }
127 
128  for (int iIdx = 0; iIdx < 3; iIdx++ ) {
129  integer iRowIndex = pvNodes[iIdx]->iGetFirstRowIndex() + 1;
130  integer iColIndex = pvNodes[iIdx]->iGetFirstColIndex() + 1;
131  WM.PutItem(iIdx + 1, iRowIndex, iColIndex, d[iIdx]);
132  }
133 
134  return WorkMat;
135 }
void Resize(integer iNewRow, integer iNewCol)
Definition: submat.cc:1053
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
doublereal dTau1
Definition: rottrim.h:73
DriveOwner Trigger
Definition: rottrim.h:63
doublereal dTau0
Definition: rottrim.h:72
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const ScalarDifferentialNode * pvNodes[3]
Definition: rottrim.h:61
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

SubVectorHandler & RotorTrimBase::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler ,
const VectorHandler  
)
virtual

Implements Elem.

Definition at line 139 of file rottrim.cc.

References dC, dC2, DEBUGCOUT, dGamma, DriveOwner::dGet(), ScalarDifferentialNode::dGetX(), ScalarDifferentialNode::dGetXPrime(), dKappa0, dKappa1, dP2, DPitchMoment, dRadius, DRollMoment, dTau0, dTau1, DThrust, GetData(), M_PI, grad::pow(), VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), pvNodes, VectorHandler::Resize(), Mat3x3::Solve(), and Trigger.

143 {
144  DEBUGCOUT("Entering RotorTrimBase::AssRes()" << std::endl);
145 
146  WorkVec.Resize(3);
147 
148  WorkVec.PutRowIndex(1, pvNodes[0]->iGetFirstRowIndex() + 1);
149  WorkVec.PutRowIndex(2, pvNodes[1]->iGetFirstRowIndex() + 1);
150  WorkVec.PutRowIndex(3, pvNodes[2]->iGetFirstRowIndex() + 1);
151 
152  doublereal dX1 = pvNodes[0]->dGetX();
153  doublereal dX2 = pvNodes[1]->dGetX();
154  doublereal dX3 = pvNodes[2]->dGetX();
155 
156  if (Trigger.dGet() == 0.) {
157  WorkVec.PutCoef(1, -dX1);
158  WorkVec.PutCoef(2, -dX2);
159  WorkVec.PutCoef(3, -dX3);
160 
161  return WorkVec;
162  }
163 
164  doublereal dX1Prime = pvNodes[0]->dGetXPrime();
165  doublereal dX2Prime = pvNodes[1]->dGetXPrime();
166  doublereal dX3Prime = pvNodes[2]->dGetXPrime();
167 
168  doublereal dThrust;
169  doublereal dRollMoment;
170  doublereal dPitchMoment;
171  doublereal dRho;
172  doublereal dOmega;
173  doublereal dMu;
174 
175  GetData(dThrust, dRollMoment, dPitchMoment, dRho, dOmega, dMu);
176 
177  doublereal d = M_PI*pow(dRadius, 4)*dRho*dOmega*dOmega;
178  dThrust /= d;
179  d *= dRadius;
180  dRollMoment /= d;
181  dPitchMoment /= d;
182 
183  doublereal dMu2 = dMu*dMu;
184 
185  const doublereal f = dC/(1. + dC2);
186 
187  Mat3x3 m((1. + 3./2.*dMu2)/6.,
188  -f*dMu/6.*(dC - dGamma/(16.*dP2)),
189  f*dMu/6.*(1. + dC*dGamma/(16.*dP2)),
190  2./9.*dMu,
191  -f/16.*(dC*(1. + 3./2.*dMu2) - 2./9.*dMu2*dGamma/dP2),
192  f/16.*((1. + 2.*dMu2) + 2./9.*dMu2*dC*dGamma/dP2),
193  0.,
194  -f/16.,
195  -f*dC/16.*(1. + 1./2.*dMu2));
196  Vec3 v(DThrust.dGet() - dThrust,
197  DRollMoment.dGet() - dRollMoment,
198  DPitchMoment.dGet() - dPitchMoment);
199  v = m.Solve(v);
200 
201  WorkVec.PutCoef(1, v(1)*dKappa0 - dX1 - dTau0*dX1Prime);
202  WorkVec.PutCoef(2, v(2)*dKappa1 - dX2 - dTau1*dX2Prime);
203  WorkVec.PutCoef(3, v(3)*dKappa1 - dX3 - dTau1*dX3Prime);
204 
205  return WorkVec;
206 }
#define M_PI
Definition: gradienttest.cc:67
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
Definition: matvec3.h:98
virtual const doublereal & dGetXPrime(void) const
Definition: node.h:393
doublereal dC2
Definition: rottrim.h:70
doublereal dKappa1
Definition: rottrim.h:75
DriveOwner DThrust
Definition: rottrim.h:62
doublereal dC
Definition: rottrim.h:69
virtual void GetData(doublereal &dThrust, doublereal &dRollMoment, doublereal &dPitchMoment, doublereal &dRho, doublereal &dOmega, doublereal &dMu) const =0
doublereal dRadius
Definition: rottrim.h:60
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
doublereal dTau1
Definition: rottrim.h:73
DriveOwner DPitchMoment
Definition: rottrim.h:62
DriveOwner Trigger
Definition: rottrim.h:63
doublereal dTau0
Definition: rottrim.h:72
doublereal dGamma
Definition: rottrim.h:65
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
doublereal dP2
Definition: rottrim.h:68
DriveOwner DRollMoment
Definition: rottrim.h:62
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
double doublereal
Definition: colamd.c:52
virtual void Resize(integer iNewSize)=0
virtual const doublereal & dGetX(void) const
Definition: node.h:386
doublereal dKappa0
Definition: rottrim.h:74
const ScalarDifferentialNode * pvNodes[3]
Definition: rottrim.h:61

Here is the call graph for this function:

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

Reimplemented from Elem.

Reimplemented in RotorTrim.

Definition at line 209 of file rottrim.cc.

References pvNodes.

210 {
211  connectedNodes.resize(3);
212  for (int i = 0; i < 3; i++) {
213  connectedNodes[i] = pvNodes[i];
214  }
215 }
const ScalarDifferentialNode * pvNodes[3]
Definition: rottrim.h:61
virtual void RotorTrimBase::GetData ( doublereal dThrust,
doublereal dRollMoment,
doublereal dPitchMoment,
doublereal dRho,
doublereal dOmega,
doublereal dMu 
) const
protectedpure virtual

Implemented in RotorTrimGeneric, and RotorTrim.

Referenced by AssRes().

virtual Genel::Type RotorTrimBase::GetGenelType ( void  ) const
inlinevirtual

Implements Genel.

Definition at line 109 of file rottrim.h.

References Genel::ROTORTRIM.

109  {
110  return Genel::ROTORTRIM;
111  };
unsigned int RotorTrimBase::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 91 of file rottrim.cc.

92 {
93  return 0;
94 }
void RotorTrimBase::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 98 of file rottrim.cc.

99 {
100  *piNumRows = 3;
101  *piNumCols = 3;
102 }

Member Data Documentation

doublereal RotorTrimBase::dC
protected

Definition at line 69 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dC2
protected

Definition at line 70 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dGamma
protected

Definition at line 65 of file rottrim.h.

Referenced by AssRes(), and RotorTrimBase().

doublereal RotorTrimBase::dKappa0
protected

Definition at line 74 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dKappa1
protected

Definition at line 75 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dP
protected

Definition at line 66 of file rottrim.h.

Referenced by RotorTrimBase().

doublereal RotorTrimBase::dP2
protected

Definition at line 68 of file rottrim.h.

Referenced by AssRes().

DriveOwner RotorTrimBase::DPitchMoment
protected

Definition at line 62 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dRadius
protected

Definition at line 60 of file rottrim.h.

Referenced by AssRes(), RotorTrim::RotorTrim(), and RotorTrimGeneric::RotorTrimGeneric().

DriveOwner RotorTrimBase::DRollMoment
protected

Definition at line 62 of file rottrim.h.

Referenced by AssRes().

doublereal RotorTrimBase::dTau0
protected

Definition at line 72 of file rottrim.h.

Referenced by AssJac(), and AssRes().

doublereal RotorTrimBase::dTau1
protected

Definition at line 73 of file rottrim.h.

Referenced by AssJac(), and AssRes().

DriveOwner RotorTrimBase::DThrust
protected

Definition at line 62 of file rottrim.h.

Referenced by AssRes().

const ScalarDifferentialNode* RotorTrimBase::pvNodes[3]
protected
DriveOwner RotorTrimBase::Trigger
protected

Definition at line 63 of file rottrim.h.

Referenced by AssJac(), and AssRes().


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