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

#include <indvel.h>

Inheritance diagram for InducedVelocity:
Collaboration diagram for InducedVelocity:

Classes

class  ErrInfiniteMeanInducedVelocity
 

Public Types

enum  Type {
  UNKNOWN = -1, USER_DEFINED = 0x01000000U, ROTOR = 0x10000000U, NO = (0U | ROTOR),
  UNIFORM = (1U | ROTOR), GLAUERT = (2U | ROTOR), MANGLER = (3U | ROTOR), DYNAMICINFLOW = (4U | ROTOR),
  PETERS_HE = (5U | ROTOR), CYCLOCOPTER = (11U | ROTOR), LASTROTORTYPE
}
 
- 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 Member Functions

 InducedVelocity (unsigned int uL, const StructNode *pCraft, ResForceSet **ppres, flag fOut)
 
virtual ~InducedVelocity (void)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual bool bSectionalForces (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual InducedVelocity::Type GetInducedVelocityType (void) const =0
 
virtual const Vec3GetXCurr (void) const
 
virtual const Vec3GetForces (void) const
 
virtual const Vec3GetMoments (void) const
 
virtual void AddForce (const Elem *pEl, const StructNode *pNode, const Vec3 &F, const Vec3 &M, const Vec3 &X)
 
virtual void AddSectionalForce (Elem::Type type, const Elem *pEl, unsigned uPnt, const Vec3 &F, const Vec3 &M, doublereal dW, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W)
 
virtual void ResetForce (void)
 
virtual Vec3 GetInducedVelocity (Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const =0
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void SetValue (DataManager *pDM, VectorHandler &, 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 & Restart (std::ostream &out) const =0
 
virtual Elem::Type GetElemType (void) const =0
 
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 SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
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, const VectorHandler &XPP)
 
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))
 

Protected Attributes

const StructNodepCraft
 
ExternResForces Res
 
ResForceSet ** ppRes
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 48 of file indvel.h.

Member Enumeration Documentation

Enumerator
UNKNOWN 
USER_DEFINED 
ROTOR 
NO 
UNIFORM 
GLAUERT 
MANGLER 
DYNAMICINFLOW 
PETERS_HE 
CYCLOCOPTER 
LASTROTORTYPE 

Definition at line 51 of file indvel.h.

51  {
52  UNKNOWN = -1,
53 
54  // non-rotating...
55 
56  USER_DEFINED = 0x01000000U,
57  ROTOR = 0x10000000U,
58 
59  // rotating...
60 
61  NO = (0U | ROTOR),
62  UNIFORM = (1U | ROTOR),
63  GLAUERT = (2U | ROTOR),
64  MANGLER = (3U | ROTOR),
65  DYNAMICINFLOW = (4U | ROTOR),
66  PETERS_HE = (5U | ROTOR),
67 
68  CYCLOCOPTER = (11U | ROTOR),
69 
71  };

Constructor & Destructor Documentation

InducedVelocity::InducedVelocity ( unsigned int  uL,
const StructNode pCraft,
ResForceSet **  ppres,
flag  fOut 
)

Definition at line 57 of file indvel.cc.

References ppRes, and SAFENEWARR.

60 : Elem(uL, fOut),
61 #ifdef USE_MPI
62 is_parallel(false),
63 pBlockLenght(0),
64 pDispl(0),
65 ReqV(MPI::REQUEST_NULL),
66 pIndVelDataType(0),
67 #endif /* USE_MPI */
68 pCraft(pCraft),
69 ppRes(ppres)
70 {
71 #ifdef USE_MPI
72  iForcesVecDim = 6;
73  for (int i = 0; ppRes && ppRes[i]; i++) {
74  iForcesVecDim += 6;
75  }
76  SAFENEWARR(pTmpVecR, doublereal, iForcesVecDim);
77  SAFENEWARR(pTmpVecS, doublereal, iForcesVecDim);
78  if (MPI::Is_initialized()) {
79  is_parallel = true;
80  IndVelComm = MBDynComm.Dup();
81  }
82 #endif /* USE_MPI */
83 
84 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES)
85  pthread_mutex_init(&induced_velocity_mutex, NULL);
86  pthread_cond_init(&induced_velocity_cond, NULL);
87  pthread_mutex_init(&forces_mutex, NULL);
88 #endif /* USE_MULTITHREAD && MBDYN_X_MT_ASSRES */
89 }
ResForceSet ** ppRes
Definition: indvel.h:116
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
double doublereal
Definition: colamd.c:52
const StructNode * pCraft
Definition: indvel.h:111
InducedVelocity::~InducedVelocity ( void  )
virtual

Definition at line 91 of file indvel.cc.

References SAFEDELETEARR.

92 {
93 #ifdef USE_MPI
94  SAFEDELETEARR(pTmpVecR);
95  SAFEDELETEARR(pTmpVecS);
96 #endif /* USE_MPI */
97 
98 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES)
99  pthread_mutex_destroy(&induced_velocity_mutex);
100  pthread_cond_destroy(&induced_velocity_cond);
101  pthread_mutex_destroy(&forces_mutex);
102 #endif /* USE_MULTITHREAD && MBDYN_X_MT_ASSRES */
103 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713

Member Function Documentation

void InducedVelocity::AddForce ( const Elem pEl,
const StructNode pNode,
const Vec3 F,
const Vec3 M,
const Vec3 X 
)
virtual

Reimplemented in CyclocopterPolimi, CyclocopterUniform2D, PetersHeRotor, DynamicInflowRotor, CyclocopterUniform1D, ManglerRotor, GlauertRotor, CyclocopterNoInflow, UniformRotor, and NoRotor.

Definition at line 252 of file indvel.cc.

References WithLabel::GetLabel().

Referenced by NoRotor::AddForce(), UniformRotor::AddForce(), CyclocopterNoInflow::AddForce(), GlauertRotor::AddForce(), ManglerRotor::AddForce(), CyclocopterUniform1D::AddForce(), DynamicInflowRotor::AddForce(), PetersHeRotor::AddForce(), CyclocopterUniform2D::AddForce(), CyclocopterPolimi::AddForce(), AddSectionalForce(), and UniformRotor2::AddSectionalForce().

254 {
255  for (int i = 0; ppRes && ppRes[i]; i++) {
256  if (ppRes[i]->is_in(pEl->GetLabel())) {
257  ppRes[i]->pRes->AddForces(F, M, X);
258  }
259  }
260 }
ResForceSet ** ppRes
Definition: indvel.h:116
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void InducedVelocity::AddSectionalForce ( Elem::Type  type,
const Elem pEl,
unsigned  uPnt,
const Vec3 F,
const Vec3 M,
doublereal  dW,
const Vec3 X,
const Mat3x3 R,
const Vec3 V,
const Vec3 W 
)
virtual

Reimplemented in UniformRotor2.

Definition at line 265 of file indvel.cc.

References AddForce(), ASSERT, and bSectionalForces().

270 {
271  ASSERT(bSectionalForces() == true);
272  InducedVelocity::AddForce(pEl, 0, F*dW, M*dW, X);
273 }
virtual bool bSectionalForces(void) const
Definition: indvel.cc:106
virtual void AddForce(const Elem *pEl, const StructNode *pNode, const Vec3 &F, const Vec3 &M, const Vec3 &X)
Definition: indvel.cc:252
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void InducedVelocity::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Reimplemented in CyclocopterPolimi, CyclocopterUniform2D, CyclocopterUniform1D, Rotor, and CyclocopterInflow.

Definition at line 170 of file indvel.cc.

References ASSERT.

Referenced by Rotor::AfterConvergence(), CyclocopterUniform1D::AfterConvergence(), CyclocopterUniform2D::AfterConvergence(), and CyclocopterPolimi::AfterConvergence().

172 {
173 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES)
174  ASSERT(bDone);
175  bDone = false;
176 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES
177 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & InducedVelocity::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Reimplemented in PetersHeRotor, and DynamicInflowRotor.

Definition at line 181 of file indvel.cc.

References DEBUGCOUT, and VariableSubMatrixHandler::SetNullMatrix().

185 {
186  DEBUGCOUT("Entering InducedVelocity::AssJac()" << std::endl);
187  WorkMat.SetNullMatrix();
188 
189  return WorkMat;
190 }
void SetNullMatrix(void)
Definition: submat.h:1159
#define DEBUGCOUT(msg)
Definition: myassert.h:232

Here is the call graph for this function:

bool InducedVelocity::bSectionalForces ( void  ) const
virtual

Reimplemented in UniformRotor2.

Definition at line 106 of file indvel.cc.

Referenced by AddSectionalForce().

107 {
108  return false;
109 }
doublereal InducedVelocity::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 150 of file indvel.cc.

References ASSERT, ResForces::Force(), MBDYN_EXCEPT_ARGS, ResForces::Moment(), and Res.

151 {
152  ASSERT(i > 0 && i <= 6);
153 
154  switch (i) {
155  case 1:
156  case 2:
157  case 3:
158  return Res.Force()(i);
159 
160  case 4:
161  case 5:
162  case 6:
163  return Res.Moment()(i - 3);
164  }
165 
167 }
ExternResForces Res
Definition: indvel.h:114
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const Vec3 & Force(void) const
Definition: resforces.cc:103
virtual const Vec3 & Moment(void) const
Definition: resforces.cc:109
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Reimplemented from Elem.

Reimplemented in Rotor, and CyclocopterInflow.

Definition at line 242 of file indvel.h.

References pCraft.

242  {
243  connectedNodes.resize(1);
244  connectedNodes[0] = pCraft;
245  };
const StructNode * pCraft
Definition: indvel.h:111
virtual const Vec3& InducedVelocity::GetForces ( void  ) const
inlinevirtual

Reimplemented in Rotor.

Definition at line 163 of file indvel.h.

References ResForces::Force().

163  {
164 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES)
165  Wait();
166 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES
167  return Res.Force();
168  };
ExternResForces Res
Definition: indvel.h:114
virtual const Vec3 & Force(void) const
Definition: resforces.cc:103

Here is the call graph for this function:

virtual InducedVelocity::Type InducedVelocity::GetInducedVelocityType ( void  ) const
pure virtual
virtual const Vec3& InducedVelocity::GetMoments ( void  ) const
inlinevirtual

Reimplemented in Rotor.

Definition at line 170 of file indvel.h.

References ResForces::Moment().

170  {
171 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES)
172  Wait();
173 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES
174  return Res.Moment();
175  };
ExternResForces Res
Definition: indvel.h:114
virtual const Vec3 & Moment(void) const
Definition: resforces.cc:109

Here is the call graph for this function:

virtual const Vec3& InducedVelocity::GetXCurr ( void  ) const
inlinevirtual

Reimplemented in Rotor.

Definition at line 159 of file indvel.h.

References StructDispNode::GetXCurr().

Referenced by CyclocopterUniform1D::AfterConvergence(), CyclocopterUniform2D::AfterConvergence(), CyclocopterPolimi::AfterConvergence(), CyclocopterUniform1D::AssRes(), CyclocopterUniform2D::AssRes(), and CyclocopterPolimi::AssRes().

159  {
160  return pCraft->GetXCurr();
161  };
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pCraft
Definition: indvel.h:111

Here is the call graph for this function:

virtual unsigned int InducedVelocity::iGetNumDof ( void  ) const
inlinevirtual

Reimplemented from Elem.

Reimplemented in PetersHeRotor, and DynamicInflowRotor.

Definition at line 152 of file indvel.h.

Referenced by InducedVelocityElem::GetDofType().

152  {
153  return 0;
154  };
unsigned int InducedVelocity::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 112 of file indvel.cc.

112  {
113  return 6;
114 }
unsigned int InducedVelocity::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 117 of file indvel.cc.

References ASSERT.

118 {
119  ASSERT(s != 0);
120 
121  unsigned int idx = 0;
122 
123  // sanity check
124  if (s[0] == '\0' || s[1] == '\0' || s[2] != '\0' ) {
125  return 0;
126  }
127 
128  switch (s[0]) {
129  case 'M':
130  idx += 3;
131  // fallthru
132 
133  case 'T':
134  switch (s[1]) {
135  case 'x':
136  return idx + 1;
137 
138  case 'y':
139  return idx + 2;
140 
141  case 'z':
142  return idx + 3;
143  }
144  }
145 
146  return 0;
147 }
#define ASSERT(expression)
Definition: colamd.c:977
void InducedVelocity::ResetForce ( void  )
virtual

Definition at line 276 of file indvel.cc.

References StructDispNode::GetXCurr(), pCraft, Res, and ExternResForces::Reset().

Referenced by NoRotor::AssRes(), UniformRotor::AssRes(), CyclocopterNoInflow::AssRes(), GlauertRotor::AssRes(), ManglerRotor::AssRes(), CyclocopterUniform1D::AssRes(), DynamicInflowRotor::AssRes(), PetersHeRotor::AssRes(), CyclocopterUniform2D::AssRes(), and CyclocopterPolimi::AssRes().

277 {
278  Res.Reset(pCraft->GetXCurr());
279  for (int i = 0; ppRes && ppRes[i]; i++) {
280  ppRes[i]->pRes->Reset();
281  }
282 }
ExternResForces Res
Definition: indvel.h:114
ResForceSet ** ppRes
Definition: indvel.h:116
void Reset(void)
Definition: resforces.cc:126
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pCraft
Definition: indvel.h:111

Here is the call graph for this function:

virtual void InducedVelocity::SetInitialValue ( VectorHandler )
inlinevirtual

Reimplemented in PetersHeRotor, DynamicInflowRotor, Rotor, and CyclocopterInflow.

Definition at line 225 of file indvel.h.

References NO_OP.

225  {
226  NO_OP;
227  };
#define NO_OP
Definition: myassert.h:74
virtual void InducedVelocity::SetValue ( DataManager pDM,
VectorHandler ,
VectorHandler ,
SimulationEntity::Hints ph = 0 
)
inlinevirtual

Reimplemented from SimulationEntity.

Reimplemented in PetersHeRotor, DynamicInflowRotor, and CyclocopterInflow.

Definition at line 231 of file indvel.h.

References NO_OP.

234  {
235  NO_OP;
236  };
#define NO_OP
Definition: myassert.h:74
virtual void InducedVelocity::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Reimplemented in PetersHeRotor, and DynamicInflowRotor.

Definition at line 208 of file indvel.h.

208  {
209  *piNumRows = 0;
210  *piNumCols = 0;
211  };

Member Data Documentation


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