MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Aerodynamic2DElem< iNN > Class Template Reference

#include <aeroelem.h>

Inheritance diagram for Aerodynamic2DElem< iNN >:
Collaboration diagram for Aerodynamic2DElem< iNN >:

Public Member Functions

 Aerodynamic2DElem (unsigned int uLabel, const DofOwner *pDO, InducedVelocity *pR, bool bPassive, const Shape *pC, const Shape *pF, const Shape *pV, const Shape *pT, const Shape *pTL, integer iN, AeroData *a, const DriveCaller *pDC, bool bUseJacobian, OrientationDescription ood, flag fOut)
 
virtual ~Aerodynamic2DElem (void)
 
virtual Elem::Type GetElemType (void) const
 
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 OutputPrepare (OutputHandler &OH)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &)
 
virtual const InducedVelocitypGetInducedVelocity (void) 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 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 VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, 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
 
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 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 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 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
 
- Public Member Functions inherited from AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) const =0
 
virtual bool NeedsAirProperties (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)
 
- Public Member Functions inherited from AirPropOwner
 AirPropOwner (void)
 
virtual ~AirPropOwner (void)
 
virtual void PutAirProperties (const AirProperties *pAP)
 
virtual flag fGetAirVelocity (Vec3 &Velocity, const Vec3 &X) const
 
virtual doublereal dGetAirDensity (const Vec3 &X) const
 
virtual doublereal dGetAirPressure (const Vec3 &X) const
 
virtual doublereal dGetAirTemperature (const Vec3 &X) const
 
virtual doublereal dGetSoundSpeed (const Vec3 &X) const
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
 
- 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)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)=0
 
- Public Member Functions inherited from DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 
- Public Member Functions inherited from AerodynamicOutput
 AerodynamicOutput (flag f, int iNP, OrientationDescription ood)
 
 ~AerodynamicOutput (void)
 
void SetOutputFlag (flag f, int iNP)
 
void ResetIterator (void)
 
void SetData (const Vec3 &v, const doublereal *pd, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W, const Vec3 &F, const Vec3 &M)
 
AerodynamicOutput::eOutput GetOutput (void) const
 
bool IsOutput (void) const
 
bool IsSTD (void) const
 
bool IsPGAUSS (void) const
 
bool IsNODE (void) const
 

Protected Member Functions

virtual void SetOutputFlag (flag f=flag(1))
 
void Output_int (OutputHandler &OH) const
 
void AddForce_int (const StructNode *pN, const Vec3 &F, const Vec3 &M, const Vec3 &X) const
 
void AddSectionalForce_int (unsigned uPnt, const Vec3 &F, const Vec3 &M, doublereal dW, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W) const
 

Protected Attributes

AeroDataaerodata
 
InducedVelocitypIndVel
 
bool bPassiveInducedVelocity
 
const ShapeOwner Chord
 
const ShapeOwner ForcePoint
 
const ShapeOwner VelocityPoint
 
const ShapeOwner Twist
 
const ShapeOwner TipLoss
 
GaussDataIterator GDI
 
std::vector< outa_tOUTA
 
Mat3xN vx
 
Mat3xN wx
 
Mat3xN fq
 
Mat3xN cq
 
bool bJacobian
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from AirPropOwner
const AirPropertiespAirProperties
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 
- Protected Attributes inherited from AerodynamicOutput
flag m_eOutput
 
OrientationDescription od
 
std::vector< Aero_outputOutputData
 
std::vector< Aero_output >
::iterator 
OutputIter
 

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 AerodynamicElem
enum  Type {
  UNKNOWN = -1, INDUCEDVELOCITY = 0, AEROMODAL, AERODYNAMICBODY,
  AERODYNAMICBEAM, AERODYNAMICEXTERNAL, AERODYNAMICEXTERNALMODAL, AERODYNAMICLOADABLE,
  AIRCRAFTINSTRUMENTS, GENERICFORCE, LASTAEROTYPE
}
 
- Public Types inherited from AerodynamicOutput
enum  eOutput {
  AEROD_OUT_NONE = 0x0U, AEROD_OUT_STD = (ToBeOutput::OUTPUT_PRIVATE << 0), AEROD_OUT_PGAUSS = (ToBeOutput::OUTPUT_PRIVATE << 1), AEROD_OUT_NODE = (ToBeOutput::OUTPUT_PRIVATE << 2),
  AEROD_OUT_MASK = (AEROD_OUT_STD | AEROD_OUT_PGAUSS | AEROD_OUT_NODE)
}
 
enum  {
  OUTPUT_NONE = 0x0U, OUTPUT_GP_X = (ToBeOutput::OUTPUT_PRIVATE << 4), OUTPUT_GP_R = (ToBeOutput::OUTPUT_PRIVATE << 5), OUTPUT_GP_V = (ToBeOutput::OUTPUT_PRIVATE << 6),
  OUTPUT_GP_W = (ToBeOutput::OUTPUT_PRIVATE << 7), OUTPUT_GP_CONFIGURATION = (OUTPUT_GP_X | OUTPUT_GP_R | OUTPUT_GP_V | OUTPUT_GP_W), OUTPUT_GP_F = (ToBeOutput::OUTPUT_PRIVATE << 8), OUTPUT_GP_M = (ToBeOutput::OUTPUT_PRIVATE << 9),
  OUTPUT_GP_FORCES = (OUTPUT_GP_F | OUTPUT_GP_M), OUTPUT_DEFAULT = (OUTPUT_GP_F | OUTPUT_GP_M), OUTPUT_GP_ALL = (ToBeOutput::OUTPUT_PRIVATE_MASK & (~AEROD_OUT_MASK))
}
 

Detailed Description

template<unsigned iNN>
class Aerodynamic2DElem< iNN >

Definition at line 145 of file aeroelem.h.

Constructor & Destructor Documentation

template<unsigned iNN>
Aerodynamic2DElem< iNN >::Aerodynamic2DElem ( unsigned int  uLabel,
const DofOwner pDO,
InducedVelocity pR,
bool  bPassive,
const Shape pC,
const Shape pF,
const Shape pV,
const Shape pT,
const Shape pTL,
integer  iN,
AeroData a,
const DriveCaller pDC,
bool  bUseJacobian,
OrientationDescription  ood,
flag  fOut 
)

Definition at line 162 of file aeroelem.cc.

References Aerodynamic2DElem< iNN >::aerodata, ASSERT, and DEBUGCOUTFNAME.

173 : Elem(uLabel, fOut),
174 AerodynamicElem(uLabel, pDO, fOut),
176 DriveOwner(pDC),
177 AerodynamicOutput(fOut, iNN*iN, ood),
178 aerodata(a),
179 pIndVel(pR),
180 bPassiveInducedVelocity(bPassive),
181 Chord(pC),
182 ForcePoint(pF),
183 VelocityPoint(pV),
184 Twist(pT),
185 TipLoss(pTL),
186 GDI(iN),
187 OUTA(iNN*iN, outa_Zero),
188 bJacobian(bUseJacobian)
189 {
190  DEBUGCOUTFNAME("Aerodynamic2DElem::Aerodynamic2DElem");
191 
192  ASSERT(iNN >= 1 && iNN <= 3);
193  ASSERT(aerodata != 0);
194 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
AerodynamicElem(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: aerodyn.cc:771
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
bool bPassiveInducedVelocity
Definition: aeroelem.h:155
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
const ShapeOwner TipLoss
Definition: aeroelem.h:161
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
AerodynamicOutput(flag f, int iNP, OrientationDescription ood)
Definition: aeroelem.cc:50
GaussDataIterator GDI
Definition: aeroelem.h:163
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
InitialAssemblyElem(unsigned int uL, flag fOut)
Definition: elem.cc:233
const outa_t outa_Zero
Definition: aerodc81.c:87
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
template<unsigned iNN>
Aerodynamic2DElem< iNN >::~Aerodynamic2DElem ( void  )
virtual

Definition at line 197 of file aeroelem.cc.

References DEBUGCOUTFNAME, and SAFEDELETE.

198 {
199  DEBUGCOUTFNAME("Aerodynamic2DElem::~Aerodynamic2DElem");
200 
202 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
AeroData * aerodata
Definition: aeroelem.h:153
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

template<unsigned iNN>
void Aerodynamic2DElem< iNN >::AddForce_int ( const StructNode pN,
const Vec3 F,
const Vec3 M,
const Vec3 X 
) const
protected

Definition at line 626 of file aeroelem.cc.

628 {
629  if (pIndVel != 0 && !bPassiveInducedVelocity
630  && !pIndVel->bSectionalForces())
631  {
632  pIndVel->AddForce(this, pN, F, M, X);
633  }
634 }
InducedVelocity * pIndVel
Definition: aeroelem.h:154
bool bPassiveInducedVelocity
Definition: aeroelem.h:155
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
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::AddSectionalForce_int ( unsigned  uPnt,
const Vec3 F,
const Vec3 M,
doublereal  dW,
const Vec3 X,
const Mat3x3 R,
const Vec3 V,
const Vec3 W 
) const
protected

Definition at line 642 of file aeroelem.cc.

646 {
647  if (pIndVel != 0 && !bPassiveInducedVelocity
649  {
650  pIndVel->AddSectionalForce(GetElemType(), this, uPnt,
651  F, M, dW, X, R, V, W);
652  }
653 }
InducedVelocity * pIndVel
Definition: aeroelem.h:154
bool bPassiveInducedVelocity
Definition: aeroelem.h:155
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)
Definition: indvel.cc:265
virtual bool bSectionalForces(void) const
Definition: indvel.cc:106
virtual Elem::Type GetElemType(void) const
Definition: aeroelem.h:199
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 402 of file aeroelem.cc.

References AeroData::BIELAWA, AeroData::HARRIS, MBDYN_EXCEPT_ARGS, and AeroData::STEADY.

405 {
406  /* Memoria in caso di forze instazionarie */
407  switch (aerodata->Unsteady()) {
408  case AeroData::STEADY:
409  break;
410 
411  case AeroData::HARRIS:
413 
414  case AeroData::BIELAWA:
415  for (unsigned i = 0; i < iNN*GDI.iGetNum(); i++) {
416  aerodata->Update(i);
417  }
418  break;
419 
420  default:
422  }
423 
424  for (unsigned i = 0; i < iNN*GDI.iGetNum(); i++) {
425  aerodata->AfterConvergence(i, X, XP);
426  }
427 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
AeroData * aerodata
Definition: aeroelem.h:153
AeroData::UnsteadyModel Unsteady(void) const
Definition: aerodata.cc:208
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual void AfterConvergence(int i, const VectorHandler &X, const VectorHandler &XP)
Definition: aerodata.cc:416
virtual integer iGetNum(void) const
Definition: gauss.h:96
void Update(int i)
Definition: aerodata.cc:116
template<unsigned iNN>
std::ostream & Aerodynamic2DElem< iNN >::DescribeDof ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 236 of file aeroelem.cc.

References ASSERT.

238 {
239  ASSERT(bInitial == false);
240 
241  integer iFirstIndex = iGetFirstIndex();
242  integer iNumDof = aerodata->iGetNumDof();
243 
244  for (unsigned b = 0; b < iNN; b++) {
245  for (integer i = 0; i < GDI.iGetNum(); i++) {
246  out
247  << prefix << iFirstIndex + 1 << "->" << iFirstIndex + iNumDof << ": "
248  "internal states at point #" << i << " of " << GDI.iGetNum() << ", "
249  "block #" << b << " of " << iNN << std::endl;
250 
251  iFirstIndex += iNumDof;
252  }
253  }
254 
255  return out;
256 }
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
AeroData * aerodata
Definition: aeroelem.h:153
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
virtual integer iGetNum(void) const
Definition: gauss.h:96
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 267 of file aeroelem.cc.

References ASSERT, elemnames, and MBDYN_EXCEPT_ARGS.

269 {
270  if (i < -1) {
271  // error
273  }
274 
275  ASSERT(bInitial == false);
276 
277  std::ostringstream os;
278  os << elemnames[iNN - 1] << "(" << GetLabel() << ")";
279 
280  integer iNumDof = aerodata->iGetNumDof();
281  if (i == -1) {
282  integer iTotDof = iNumDof*GDI.iGetNum();
283  desc.resize(iTotDof);
284 
285  std::string name(os.str());
286 
287  for (integer s = 0; s < iTotDof; s++) {
288  os.str(name);
289  os.seekp(0, std::ios_base::end);
290  os << ": internal state #" << s % iNumDof << " of " << iNumDof
291  << " at point #" << s/iNumDof << " of " << GDI.iGetNum() << ", "
292  "block #" << s/(iNumDof*GDI.iGetNum()) << " of " << iNN;
293  desc[s] = os.str();
294  }
295 
296  return;
297  }
298 
299  desc.resize(1);
300  os << ": internal state #" << i % iNumDof << " of " << iNumDof
301  << " at point #" << i/iNumDof << " of " << GDI.iGetNum() << ", "
302  "block #" << i/(iNumDof*GDI.iGetNum()) << " of " << iNN;
303  desc[0] = os.str();
304 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
static const char * elemnames[]
Definition: aeroelem.cc:258
AeroData * aerodata
Definition: aeroelem.h:153
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
virtual integer iGetNum(void) const
Definition: gauss.h:96
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
template<unsigned iNN>
std::ostream & Aerodynamic2DElem< iNN >::DescribeEq ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 308 of file aeroelem.cc.

References ASSERT.

310 {
311  ASSERT(bInitial == false);
312 
313  integer iFirstIndex = iGetFirstIndex();
314  integer iNumDof = aerodata->iGetNumDof();
315 
316  for (unsigned b = 0; b < iNN; b++) {
317  for (integer i = 0; i < GDI.iGetNum(); i++) {
318  out
319  << prefix << iFirstIndex + 1 << "->" << iFirstIndex + iNumDof
320  << ": dynamics equations at point #" << i << " of " << GDI.iGetNum() << ", "
321  "block #" << b << " of " << iNN << std::endl;
322 
323  iFirstIndex += iNumDof;
324  }
325  }
326 
327  return out;
328 }
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
AeroData * aerodata
Definition: aeroelem.h:153
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
virtual integer iGetNum(void) const
Definition: gauss.h:96
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 332 of file aeroelem.cc.

References ASSERT, elemnames, and MBDYN_EXCEPT_ARGS.

334 {
335  if (i < -1) {
336  // error
338  }
339 
340  ASSERT(bInitial == false);
341 
342  std::ostringstream os;
343  os << elemnames[iNN - 1] << "(" << GetLabel() << ")";
344 
345  integer iNumDof = aerodata->iGetNumDof();
346  if (i == -1) {
347  integer iTotDof = iNumDof*GDI.iGetNum();
348  desc.resize(iTotDof);
349 
350  std::string name(os.str());
351 
352  for (integer s = 0; s < iTotDof; s++) {
353  os.str(name);
354  os.seekp(0, std::ios_base::end);
355  os << ": internal equation #" << s % iNumDof << " of " << iNumDof
356  << " at point #" << s/iNumDof << " of " << GDI.iGetNum() << ", "
357  "block " << s/(iNumDof*GDI.iGetNum()) << " of " << iNN;
358  desc[s] = os.str();
359  }
360 
361  return;
362  }
363 
364  desc.resize(1);
365  os << ": internal equation #" << i % iNumDof << " of " << iNumDof
366  << " at point #" << i/iNumDof << " of " << GDI.iGetNum() << ", "
367  "block " << i/(iNumDof*GDI.iGetNum()) << " of " << iNN;
368  desc[0] = os.str();
369 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
static const char * elemnames[]
Definition: aeroelem.cc:258
AeroData * aerodata
Definition: aeroelem.h:153
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
virtual integer iGetNum(void) const
Definition: gauss.h:96
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
template<unsigned iNN>
DofOrder::Order Aerodynamic2DElem< iNN >::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 373 of file aeroelem.cc.

References ASSERT.

374 {
375  ASSERT(aerodata->iGetNumDof() > 0);
376 
377  return aerodata->GetDofType(i % aerodata->iGetNumDof());
378 }
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
AeroData * aerodata
Definition: aeroelem.h:153
#define ASSERT(expression)
Definition: colamd.c:977
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: aerodata.cc:368
template<unsigned iNN>
virtual Elem::Type Aerodynamic2DElem< iNN >::GetElemType ( void  ) const
inlinevirtual

Implements Elem.

Definition at line 199 of file aeroelem.h.

199  {
200  return Elem::AERODYNAMIC;
201  };
template<unsigned iNN>
virtual unsigned int Aerodynamic2DElem< iNN >::iGetInitialNumDof ( void  ) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 229 of file aeroelem.h.

229  {
230  return 0;
231  };
template<unsigned iNN>
unsigned int Aerodynamic2DElem< iNN >::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 229 of file aeroelem.cc.

230 {
231  return aerodata->iGetNumDof()*iNN*GDI.iGetNum();
232 }
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
AeroData * aerodata
Definition: aeroelem.h:153
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual integer iGetNum(void) const
Definition: gauss.h:96
template<unsigned iNN>
VariableSubMatrixHandler & Aerodynamic2DElem< iNN >::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler  
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 441 of file aeroelem.cc.

References DEBUGCOUTFNAME, and VariableSubMatrixHandler::SetNullMatrix().

443 {
444  DEBUGCOUTFNAME("Aerodynamic2DElem::InitialAssJac");
445  WorkMat.SetNullMatrix();
446  return WorkMat;
447 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
void SetNullMatrix(void)
Definition: submat.h:1159

Here is the call graph for this function:

template<unsigned iNN>
void Aerodynamic2DElem< iNN >::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 432 of file aeroelem.cc.

433 {
434  *piNumRows = 6*iNN;
435  *piNumCols = 1;
436 }
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::Output_int ( OutputHandler OH) const
protected

Definition at line 544 of file aeroelem.cc.

References OutputHandler::AERODYNAMIC, dRaDegr, EULER_123, EULER_313, EULER_321, OutputHandler::GetCurrentStep(), MatR2EulerAngles123(), MatR2EulerAngles313(), MatR2EulerAngles321(), ORIENTATION_MATRIX, ORIENTATION_VECTOR, Vec3::pGetVec(), OutputHandler::UseNetCDF(), and RotManip::VecRot().

Referenced by AerodynamicBody::Output(), AerodynamicBeam::Output(), and AerodynamicBeam2::Output().

545 {
546 #ifdef USE_NETCDF
548  for (std::vector<AeroNetCDFOutput>::const_iterator i = NetCDFOutputData.begin();
549  i != NetCDFOutputData.end(); ++i)
550  {
551  if (i->Var_X) {
552  i->Var_X->put_rec(i->X.pGetVec(), OH.GetCurrentStep());
553  }
554 
555  if (i->Var_Phi) {
556  Vec3 E;
557  switch (od) {
558  case EULER_123:
559  E = MatR2EulerAngles123(i->R)*dRaDegr;
560  break;
561 
562  case EULER_313:
563  E = MatR2EulerAngles313(i->R)*dRaDegr;
564  break;
565 
566  case EULER_321:
567  E = MatR2EulerAngles321(i->R)*dRaDegr;
568  break;
569 
570  case ORIENTATION_VECTOR:
571  E = RotManip::VecRot(i->R);
572  break;
573 
574  case ORIENTATION_MATRIX:
575  break;
576 
577  default:
578  /* impossible */
579  break;
580  }
581 
582  switch (od) {
583  case EULER_123:
584  case EULER_313:
585  case EULER_321:
586  case ORIENTATION_VECTOR:
587  i->Var_Phi->put_rec(E.pGetVec(), OH.GetCurrentStep());
588  break;
589 
590  case ORIENTATION_MATRIX:
591  i->Var_Phi->put_rec(i->R.pGetMat(), OH.GetCurrentStep());
592  break;
593 
594  default:
595  /* impossible */
596  break;
597  }
598  }
599 
600  if (i->Var_V) {
601  i->Var_V->put_rec(i->V.pGetVec(), OH.GetCurrentStep());
602  }
603 
604  if (i->Var_W) {
605  i->Var_W->put_rec(i->W.pGetVec(), OH.GetCurrentStep());
606  }
607 
608  if (i->Var_F) {
609  i->Var_F->put_rec(i->F.pGetVec(), OH.GetCurrentStep());
610  }
611 
612  if (i->Var_M) {
613  i->Var_M->put_rec(i->M.pGetVec(), OH.GetCurrentStep());
614  }
615  }
616  }
617 #endif /* USE_NETCDF */
618 }
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
OrientationDescription od
Definition: aeroelem.h:83
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Definition: matvec3.cc:927
long GetCurrentStep(void) const
Definition: output.h:116
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
Definition: matvec3.cc:893
const doublereal dRaDegr
Definition: matvec3.cc:884
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
Definition: matvec3.cc:941

Here is the call graph for this function:

template<unsigned iNN>
void Aerodynamic2DElem< iNN >::OutputPrepare ( OutputHandler OH)
virtual

Reimplemented from ToBeOutput.

Definition at line 451 of file aeroelem.cc.

References OutputHandler::AERODYNAMIC, ASSERT, elemnames, OutputHandler::IsOpen(), OutputHandler::NETCDF, AerodynamicOutput::OUTPUT_GP_F, AerodynamicOutput::OUTPUT_GP_M, AerodynamicOutput::OUTPUT_GP_R, AerodynamicOutput::OUTPUT_GP_V, AerodynamicOutput::OUTPUT_GP_W, AerodynamicOutput::OUTPUT_GP_X, and OutputHandler::UseNetCDF().

452 {
453  if (bToBeOutput()) {
454 #ifdef USE_NETCDF
457 
458  std::ostringstream os;
459  os << "elem.aerodynamic." << GetLabel();
460  (void)OH.CreateVar(os.str(), elemnames[iNN - 1]);
461 
462  os << '.';
463  std::string name = os.str();
464 
465  int totgp = iNN*GDI.iGetNum();
466  NetCDFOutputData.resize(totgp);
467 
468  int j = 0;
469  for (std::vector<AeroNetCDFOutput>::iterator i = NetCDFOutputData.begin();
470  i != NetCDFOutputData.end(); ++i, ++j)
471  {
472  os.str("");
473  os << "Gauss point #" << j << "/" << totgp;
474  std::string gp(os.str());
475 
476  unsigned uOutputFlags = (fToBeOutput() & OUTPUT_GP_ALL);
477 
478  /* Add NetCDF (output) variables to the BinFile object
479  * and save the NcVar* pointer returned from add_var
480  * as handle for later write accesses.
481  * Define also variable attributes */
482  i->Var_X = 0;
483  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_X) {
484  os.str(name);
485  os.seekp(0, std::ios_base::end);
486  os << "X_" << j;
487  i->Var_X = OH.CreateVar<Vec3>(os.str(), "m",
488  gp + " global position vector (X, Y, Z)");
489  }
490 
491  i->Var_Phi = 0;
492  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_R) {
493  os.str("");
494  os << "_" << j;
495  i->Var_Phi = OH.CreateRotationVar(name, os.str(), od,
496  gp + " global");
497  }
498 
499  i->Var_V = 0;
500  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_V) {
501  os.str(name);
502  os.seekp(0, std::ios_base::end);
503  os << "V_" << j;
504  i->Var_V = OH.CreateVar<Vec3>(os.str(), "m/s",
505  gp + " global frame (V_X, V_Y, V_Z)");
506  }
507 
508  i->Var_W = 0;
509  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_W) {
510  os.str(name);
511  os.seekp(0, std::ios_base::end);
512  os << "Omega_" << j;
513  i->Var_W = OH.CreateVar<Vec3>(os.str(), "radian/s",
514  gp + " global frame (Omega_X, Omega_Y, Omega_Z)");
515  }
516 
517  i->Var_F = 0;
518  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_F) {
519  os.str(name);
520  os.seekp(0, std::ios_base::end);
521  os << "F_" << j;
522  i->Var_F = OH.CreateVar<Vec3>(os.str(), "N",
523  gp + " force in local frame (F_X, F_Y, F_Z)");
524  }
525 
526  i->Var_M = 0;
527  if (uOutputFlags & AerodynamicOutput::OUTPUT_GP_M) {
528  os.str(name);
529  os.seekp(0, std::ios_base::end);
530  os << "M_" << j;
531  i->Var_M = OH.CreateVar<Vec3>(os.str(), "Nm",
532  gp + " force in local frame (M_X, M_Y, M_Z)");
533  }
534  }
535  }
536 #endif // USE_NETCDF
537  }
538 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
bool UseNetCDF(int out) const
Definition: output.cc:491
static const char * elemnames[]
Definition: aeroelem.cc:258
OrientationDescription od
Definition: aeroelem.h:83
GaussDataIterator GDI
Definition: aeroelem.h:163
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
virtual flag fToBeOutput(void) const
Definition: output.cc:884
virtual integer iGetNum(void) const
Definition: gauss.h:96
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

template<unsigned iNN>
virtual const InducedVelocity* Aerodynamic2DElem< iNN >::pGetInducedVelocity ( void  ) const
inlinevirtual

Reimplemented from AerodynamicElem.

Definition at line 242 of file aeroelem.h.

242  {
243  return pIndVel;
244  };
InducedVelocity * pIndVel
Definition: aeroelem.h:154
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::SetOutputFlag ( flag  f = flag(1))
protectedvirtual

Reimplemented from ToBeOutput.

Definition at line 211 of file aeroelem.cc.

References DEBUGCOUTFNAME, AerodynamicOutput::SetOutputFlag(), and ToBeOutput::SetOutputFlag().

212 {
213  DEBUGCOUTFNAME("Aerodynamic2DElem::SetOutputFlag");
216 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
void SetOutputFlag(flag f, int iNP)
Definition: aeroelem.cc:64
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual integer iGetNum(void) const
Definition: gauss.h:96
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896

Here is the call graph for this function:

template<unsigned iNN>
void Aerodynamic2DElem< iNN >::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints h = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 382 of file aeroelem.cc.

385 {
386  integer iNumDof = aerodata->iGetNumDof();
387  if (iNumDof) {
388  vx.Resize(6*iNN);
389  wx.Resize(6*iNN);
390  fq.Resize(iNumDof);
391  cq.Resize(iNumDof);
392 
393  vx.Reset();
394  wx.Reset();
395  fq.Reset();
396  cq.Reset();
397  }
398 }
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
AeroData * aerodata
Definition: aeroelem.h:153
void Reset(const doublereal &d=0.)
Definition: matvec3n.cc:334
void Resize(integer ns)
Definition: matvec3n.cc:318
long int integer
Definition: colamd.c:51
template<unsigned iNN>
void Aerodynamic2DElem< iNN >::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 221 of file aeroelem.cc.

222 {
223  *piNumRows = *piNumCols = iNN*6 + iGetNumDof();
224 }
virtual unsigned int iGetNumDof(void) const
Definition: aeroelem.cc:229

Member Data Documentation

template<unsigned iNN>
AeroData* Aerodynamic2DElem< iNN >::aerodata
protected

Definition at line 153 of file aeroelem.h.

Referenced by Aerodynamic2DElem< iNN >::Aerodynamic2DElem().

template<unsigned iNN>
bool Aerodynamic2DElem< iNN >::bJacobian
protected

Definition at line 169 of file aeroelem.h.

template<unsigned iNN>
bool Aerodynamic2DElem< iNN >::bPassiveInducedVelocity
protected

Definition at line 155 of file aeroelem.h.

template<unsigned iNN>
const ShapeOwner Aerodynamic2DElem< iNN >::Chord
protected

Definition at line 157 of file aeroelem.h.

template<unsigned iNN>
Mat3xN Aerodynamic2DElem< iNN >::cq
protected

Definition at line 167 of file aeroelem.h.

template<unsigned iNN>
const ShapeOwner Aerodynamic2DElem< iNN >::ForcePoint
protected

Definition at line 158 of file aeroelem.h.

template<unsigned iNN>
Mat3xN Aerodynamic2DElem< iNN >::fq
protected

Definition at line 167 of file aeroelem.h.

template<unsigned iNN>
GaussDataIterator Aerodynamic2DElem< iNN >::GDI
protected

Definition at line 163 of file aeroelem.h.

template<unsigned iNN>
std::vector<outa_t> Aerodynamic2DElem< iNN >::OUTA
protected

Definition at line 164 of file aeroelem.h.

template<unsigned iNN>
InducedVelocity* Aerodynamic2DElem< iNN >::pIndVel
protected

Definition at line 154 of file aeroelem.h.

template<unsigned iNN>
const ShapeOwner Aerodynamic2DElem< iNN >::TipLoss
protected

Definition at line 161 of file aeroelem.h.

template<unsigned iNN>
const ShapeOwner Aerodynamic2DElem< iNN >::Twist
protected

Definition at line 160 of file aeroelem.h.

template<unsigned iNN>
const ShapeOwner Aerodynamic2DElem< iNN >::VelocityPoint
protected

Definition at line 159 of file aeroelem.h.

template<unsigned iNN>
Mat3xN Aerodynamic2DElem< iNN >::vx
protected

Definition at line 167 of file aeroelem.h.

template<unsigned iNN>
Mat3xN Aerodynamic2DElem< iNN >::wx
protected

Definition at line 167 of file aeroelem.h.


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