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

#include <aerodyn.h>

Inheritance diagram for AirProperties:
Collaboration diagram for AirProperties:

Public Member Functions

 AirProperties (const TplDriveCaller< Vec3 > *pDC, std::vector< const Gust * > &pg, const RigidBodyKinematics *pRBK, flag fOut)
 
virtual ~AirProperties (void)
 
virtual void AddGust (const Gust *pG)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual Elem::Type GetElemType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void Output (OutputHandler &) const
 
virtual Vec3 GetVelocity (const Vec3 &) const
 
virtual bool GetVelocity (const Vec3 &, Vec3 &V) const
 
virtual doublereal dGetAirDensity (const Vec3 &) const =0
 
virtual doublereal dGetAirPressure (const Vec3 &) const =0
 
virtual doublereal dGetAirTemperature (const Vec3 &) const =0
 
virtual doublereal dGetSoundSpeed (const Vec3 &) const =0
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const =0
 
virtual int GetNumConnectedNodes (void) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) 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 void GetConnectedNodes (std::vector< const Node * > &connectedNodes) 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 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 InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- Public Member Functions inherited from TplDriveOwner< Vec3 >
 TplDriveOwner (const TplDriveCaller< Vec3 > *pDC=0)
 
virtual ~TplDriveOwner (void)
 
void Set (const TplDriveCaller< Vec3 > *pDC)
 
TplDriveCaller< Vec3 > * pGetDriveCaller (void) const
 
Vec3 Get (const doublereal &dVar) const
 
Vec3 Get (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual Vec3 GetP (void) const
 

Protected Attributes

Vec3 Velocity
 
std::vector< const Gust * > gust
 
const RigidBodyKinematicspRBK
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from TplDriveOwner< Vec3 >
TplDriveCaller< Vec3 > * pTplDriveCaller
 

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 }
 

Detailed Description

Definition at line 88 of file aerodyn.h.

Constructor & Destructor Documentation

AirProperties::AirProperties ( const TplDriveCaller< Vec3 > *  pDC,
std::vector< const Gust * > &  pg,
const RigidBodyKinematics pRBK,
flag  fOut 
)

Definition at line 73 of file aerodyn.cc.

References gust, and Gust::SetAirProperties().

77 : Elem(1, fOut),
78 InitialAssemblyElem(1, fOut),
81 gust(g),
82 pRBK(pRBK)
83 {
84  for (std::vector<const Gust *>::iterator i = gust.begin();
85  i != gust.end(); ++i)
86  {
87  const_cast<Gust *>(*i)->SetAirProperties(this);
88  }
89 }
const Vec3 Zero3(0., 0., 0.)
std::vector< const Gust * > gust
Definition: aerodyn.h:92
Vec3 Velocity
Definition: aerodyn.h:91
Definition: gust.h:44
const RigidBodyKinematics * pRBK
Definition: aerodyn.h:95
void SetAirProperties(const AirProperties *pap)
Definition: gust.cc:48
InitialAssemblyElem(unsigned int uL, flag fOut)
Definition: elem.cc:233
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

AirProperties::~AirProperties ( void  )
virtual

Definition at line 91 of file aerodyn.cc.

References gust, and SAFEDELETE.

92 {
93  for (std::vector<const Gust *>::iterator i = gust.begin();
94  i != gust.end(); ++i)
95  {
96  SAFEDELETE(*i);
97  }
98 }
std::vector< const Gust * > gust
Definition: aerodyn.h:92
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

void AirProperties::AddGust ( const Gust pG)
virtual

Definition at line 101 of file aerodyn.cc.

References gust.

102 {
103  gust.insert(gust.end(), pG);
104  const_cast<Gust *>(pG)->SetAirProperties(this);
105 }
std::vector< const Gust * > gust
Definition: aerodyn.h:92
Definition: gust.h:44
VariableSubMatrixHandler & AirProperties::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  ,
const VectorHandler ,
const VectorHandler  
)
virtual

Implements Elem.

Definition at line 132 of file aerodyn.cc.

References VariableSubMatrixHandler::SetNullMatrix().

136 {
137  WorkMat.SetNullMatrix();
138  return WorkMat;
139 }
void SetNullMatrix(void)
Definition: submat.h:1159

Here is the call graph for this function:

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

Implements Elem.

Definition at line 143 of file aerodyn.cc.

References TplDriveOwner< Vec3 >::Get(), VectorHandler::Resize(), and Velocity.

Referenced by InitialAssRes().

147 {
148  WorkVec.Resize(0);
149 
150  /* Approfitto del fatto che AirProperties viene aggiornato prima
151  * degli altri elementi (vedi l'enum Elem::Type e la sequenza di
152  * assemblaggio) per fargli calcolare Velocity una volta per tutte.
153  * Quindi, quando viene chiamata GetVelocity(void),
154  * questa restituisce un reference alla velocita' con il
155  * minimo overhead */
156  Velocity = Get();
157 
158  return WorkVec;
159 }
Vec3 Velocity
Definition: aerodyn.h:91
Vec3 Get(void) const
Definition: tpldrive.h:113
virtual void Resize(integer iNewSize)=0

Here is the call graph for this function:

virtual doublereal AirProperties::dGetAirDensity ( const Vec3 ) const
pure virtual
virtual doublereal AirProperties::dGetAirPressure ( const Vec3 ) const
pure virtual
virtual doublereal AirProperties::dGetAirTemperature ( const Vec3 ) const
pure virtual
doublereal AirProperties::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 289 of file aerodyn.cc.

References WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, Vec3::Norm(), and Velocity.

290 {
291  switch (i) {
292  case 1:
293  case 2:
294  case 3:
295  return Velocity(i);
296 
297  case 4:
298  return Velocity.Norm();
299 
300  default:
301  silent_cerr("AirProperties(" << GetLabel() << "): "
302  "illegal property " << i << std::endl);
304  }
305 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal Norm(void) const
Definition: matvec3.h:263
Vec3 Velocity
Definition: aerodyn.h:91
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

virtual doublereal AirProperties::dGetSoundSpeed ( const Vec3 ) const
pure virtual
virtual bool AirProperties::GetAirProps ( const Vec3 X,
doublereal rho,
doublereal c,
doublereal p,
doublereal T 
) const
pure virtual
virtual Elem::Type AirProperties::GetElemType ( void  ) const
inlinevirtual

Implements Elem.

Definition at line 110 of file aerodyn.h.

References Elem::AIRPROPERTIES.

110  {
111  return Elem::AIRPROPERTIES;
112  };
virtual int AirProperties::GetNumConnectedNodes ( void  ) const
inlinevirtual

Reimplemented from Elem.

Definition at line 188 of file aerodyn.h.

188  {
189  return 0;
190  };
Vec3 AirProperties::GetVelocity ( const Vec3 X) const
virtual

Definition at line 208 of file aerodyn.cc.

Referenced by AirPropOwner::fGetAirVelocity(), Output(), and ExtRigidForceEDGE::Send().

209 {
210  Vec3 V;
211 
212  GetVelocity(X, V);
213 
214  return V;
215 }
Definition: matvec3.h:98
virtual Vec3 GetVelocity(const Vec3 &) const
Definition: aerodyn.cc:208
bool AirProperties::GetVelocity ( const Vec3 X,
Vec3 V 
) const
virtual

Definition at line 218 of file aerodyn.cc.

References Vec3::Cross(), RigidBodyKinematics::GetR(), RigidBodyKinematics::GetV(), RigidBodyKinematics::GetW(), RigidBodyKinematics::GetX(), gust, Mat3x3::MulTV(), pRBK, and Velocity.

219 {
220  Vec3 Xabs;
221  if (pRBK) {
222  // X is the position of the point in the relative frame
223  // Xabs is the position of the point in the absolute frame
224  Vec3 Xabs = pRBK->GetX();
225  Xabs += pRBK->GetR()*X;
226 
227  } else {
228  Xabs = X;
229  }
230 
231  V = Velocity;
232  for (std::vector<const Gust *>::const_iterator i = gust.begin();
233  i != gust.end(); ++i)
234  {
235  Vec3 VV;
236  if ((*i)->GetVelocity(Xabs, VV)) {
237  V += VV;
238  }
239  }
240 
241  if (pRBK) {
242  // V is the velocity of the point in the absolute frame,
243  // projected in the relative reference frame,
244  // plus the airstream speed, minus the relative frame velocity
245 
246  // the velocity is projected in the relative frame
247  V = pRBK->GetR().MulTV(V);
248 
249  // the reference velocity is subtracted
250  V -= pRBK->GetV();
251 
252  // the contribution of the angular velocity is subtracted
253  V -= pRBK->GetW().Cross(X);
254  }
255 
256  return true;
257 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
std::vector< const Gust * > gust
Definition: aerodyn.h:92
Definition: matvec3.h:98
virtual const Vec3 & GetV(void) const =0
Vec3 Velocity
Definition: aerodyn.h:91
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual const Vec3 & GetX(void) const =0
const RigidBodyKinematics * pRBK
Definition: aerodyn.h:95
virtual const Vec3 & GetW(void) const =0
virtual const Mat3x3 & GetR(void) const =0

Here is the call graph for this function:

unsigned int AirProperties::iGetInitialNumDof ( void  ) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 163 of file aerodyn.cc.

164 {
165  return 0;
166 }
unsigned int AirProperties::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 261 of file aerodyn.cc.

262 {
263  /* 3 components + module */
264  return 4;
265 }
unsigned int AirProperties::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 268 of file aerodyn.cc.

References ASSERT.

269 {
270  ASSERT(s != NULL);
271 
272  if (strcasecmp(s, "vxinf") == 0) {
273  return 1;
274 
275  } else if (strcasecmp(s, "vyinf") == 0) {
276  return 2;
277 
278  } else if (strcasecmp(s, "vzinf") == 0) {
279  return 3;
280 
281  } else if (strcasecmp(s, "vinf") == 0) {
282  return 4;
283  }
284 
285  return 0;
286 }
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & AirProperties::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler  
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 179 of file aerodyn.cc.

References VariableSubMatrixHandler::SetNullMatrix().

181 {
182  WorkMat.SetNullMatrix();
183  return WorkMat;
184 }
void SetNullMatrix(void)
Definition: submat.h:1159

Here is the call graph for this function:

SubVectorHandler & AirProperties::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 188 of file aerodyn.cc.

References AssRes().

190 {
191  /* Chiama AssRes, che si limita ad aggiornare la velocita' */
192  return AssRes(WorkVec, 1, XCurr, XCurr);
193 }
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal, const VectorHandler &, const VectorHandler &)
Definition: aerodyn.cc:143

Here is the call graph for this function:

void AirProperties::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 170 of file aerodyn.cc.

172 {
173  *piNumRows = 0;
174  *piNumCols = 0;
175 }
void AirProperties::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 196 of file aerodyn.cc.

References OutputHandler::AirProps(), ToBeOutput::bToBeOutput(), dGetAirDensity(), dGetSoundSpeed(), WithLabel::GetLabel(), GetVelocity(), and Zero3.

197 {
198  if (bToBeOutput()) {
199  OH.AirProps() << std::setw(8) << GetLabel()
200  << " " << dGetAirDensity(Zero3)
201  << " " << dGetSoundSpeed(Zero3)
202  << " " << GetVelocity(Zero3)
203  << std::endl;
204  }
205 }
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
Definition: output.cc:890
virtual Vec3 GetVelocity(const Vec3 &) const
Definition: aerodyn.cc:208
virtual doublereal dGetSoundSpeed(const Vec3 &) const =0
std::ostream & AirProps(void) const
Definition: output.h:552
virtual doublereal dGetAirDensity(const Vec3 &) const =0
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Reimplemented in StdAirProperties, and BasicAirProperties.

Definition at line 109 of file aerodyn.cc.

References gust, TplDriveOwner< Vec3 >::pGetDriveCaller(), and TplDriveCaller< T >::Restart().

Referenced by BasicAirProperties::Restart(), and StdAirProperties::Restart().

110 {
111  pGetDriveCaller()->Restart(out);
112  if (!gust.empty()) {
113  for (std::vector<const Gust *>::const_iterator i = gust.begin();
114  i != gust.end(); ++i)
115  {
116  out << ", ", (*i)->Restart(out);
117  }
118  }
119  return out << ';' << std::endl;
120 }
std::vector< const Gust * > gust
Definition: aerodyn.h:92
TplDriveCaller< Vec3 > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
virtual std::ostream & Restart(std::ostream &out) const =0

Here is the call graph for this function:

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

Implements Elem.

Definition at line 124 of file aerodyn.cc.

125 {
126  *piNumRows = 0;
127  *piNumCols = 0;
128 }

Member Data Documentation

std::vector<const Gust *> AirProperties::gust
protected

Definition at line 92 of file aerodyn.h.

Referenced by AddGust(), AirProperties(), GetVelocity(), Restart(), and ~AirProperties().

const RigidBodyKinematics* AirProperties::pRBK
protected

Definition at line 95 of file aerodyn.h.

Referenced by GetVelocity().

Vec3 AirProperties::Velocity
mutableprotected

Definition at line 91 of file aerodyn.h.

Referenced by AssRes(), dGetPrivData(), and GetVelocity().


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