MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
aeroelem.cc File Reference
#include "mbconfig.h"
#include "dataman.h"
#include "aerodata.h"
#include "aeroelem.h"
#include "shapefnc.h"
#include "aerodc81.h"
#include "c81data.h"
#include "Rot.hh"
#include <sstream>
Include dependency graph for aeroelem.cc:

Go to the source code of this file.

Functions

static bool ReadInducedVelocity (DataManager *pDM, MBDynParser &HP, unsigned uLabel, const char *sElemType, InducedVelocity *&pIndVel, bool &bPassive)
 
void ReadAerodynamicCustomOutput (DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
 
void ReadOptionalAerodynamicCustomOutput (DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
 
ElemReadAerodynamicBody (DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
 
ElemReadAerodynamicBeam (DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
 
ElemReadAerodynamicBeam2 (DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
 

Variables

static const bool bDefaultUseJacobian = false
 
static const char * elemnames []
 
static const doublereal d13 = 1./sqrt(3.)
 
static const doublereal pdsi3 [] = { -1., -d13, d13 }
 
static const doublereal pdsf3 [] = { -d13, d13, 1. }
 
static const doublereal pdsi2 [] = { -1., 0. }
 
static const doublereal pdsf2 [] = { 0., 1. }
 

Function Documentation

Elem* ReadAerodynamicBeam ( DataManager pDM,
MBDynParser HP,
const DofOwner pDO,
unsigned int  uLabel 
)

Definition at line 2268 of file aeroelem.cc.

References AerodynamicOutput::AEROD_OUT_NODE, AerodynamicOutput::AEROD_OUT_PGAUSS, AerodynamicOutput::AEROD_OUT_STD, Elem::AERODYNAMIC, ASSERT, bDefaultUseJacobian, Elem::BEAM, DEBUGCOUTFNAME, DEBUGLCOUT, Shape::dGet(), DataManager::fReadOutput(), HighParser::GetInt(), WithLabel::GetLabel(), IncludeParser::GetLineData(), DataManager::GetLogFile(), MBDynParser::GetPosRel(), MBDynParser::GetRotRel(), HighParser::GetYesNoOrBool(), AeroData::iGetNumDof(), HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, AerodynamicOutput::OUTPUT_NONE, DataManager::pFindElem(), Beam::pGetNode(), ReadAeroData(), ReadInducedVelocity(), ReadOptionalAerodynamicCustomOutput(), SAFENEWWITHCONSTRUCTOR, UNKNOWN_ORIENTATION_DESCRIPTION, and Write().

Referenced by DataManager::ReadOneElem().

2272 {
2273  DEBUGCOUTFNAME("ReadAerodynamicBeam");
2274 
2275  /* Trave */
2276  unsigned int uBeam = (unsigned int)HP.GetInt();
2277 
2278  DEBUGLCOUT(MYDEBUG_INPUT, "Linked to beam: " << uBeam << std::endl);
2279 
2280  /* verifica di esistenza della trave */
2281  Elem* p = pDM->pFindElem(Elem::BEAM, uBeam);
2282  if (p == 0) {
2283  silent_cerr("Beam3(" << uBeam << ") not defined "
2284  "at line " << HP.GetLineData()
2285  << std::endl);
2287  }
2288  Beam *pBeam = dynamic_cast<Beam *>(p);
2289  if (pBeam == 0) {
2290  silent_cerr("Beam(" << uBeam << ") is not a Beam3 "
2291  "at line " << HP.GetLineData()
2292  << std::endl);
2294  }
2295  ASSERT(pBeam != 0);
2296 
2297  /* Eventuale rotore */
2298  InducedVelocity* pIndVel = 0;
2299  bool bPassive(false);
2300  (void)ReadInducedVelocity(pDM, HP, uLabel, "AerodynamicBeam3",
2301  pIndVel, bPassive);
2302 
2303  /* Nodo 1: */
2304 
2305  /* Offset del corpo aerodinamico rispetto al nodo */
2306  const StructNode* pNode1 = pBeam->pGetNode(1);
2307 
2308  ReferenceFrame RF(pNode1);
2309  Vec3 f1(HP.GetPosRel(RF));
2310  DEBUGLCOUT(MYDEBUG_INPUT, "Node 1 offset: " << f1 << std::endl);
2311 
2312  Mat3x3 Ra1(HP.GetRotRel(RF));
2314  "Node 1 rotation matrix: " << std::endl << Ra1 << std::endl);
2315 
2316  /* Nodo 2: */
2317 
2318  /* Offset del corpo aerodinamico rispetto al nodo */
2319  const StructNode* pNode2 = pBeam->pGetNode(2);
2320 
2321  RF = ReferenceFrame(pNode2);
2322  Vec3 f2(HP.GetPosRel(RF));
2323  DEBUGLCOUT(MYDEBUG_INPUT, "Node 2 offset: " << f2 << std::endl);
2324 
2325  Mat3x3 Ra2(HP.GetRotRel(RF));
2327  "Node 2 rotation matrix: " << std::endl << Ra2 << std::endl);
2328 
2329  /* Nodo 3: */
2330 
2331  /* Offset del corpo aerodinamico rispetto al nodo */
2332  const StructNode* pNode3 = pBeam->pGetNode(3);
2333 
2334  RF = ReferenceFrame(pNode3);
2335  Vec3 f3(HP.GetPosRel(RF));
2336  DEBUGLCOUT(MYDEBUG_INPUT, "Node 3 offset: " << f3 << std::endl);
2337 
2338  Mat3x3 Ra3(HP.GetRotRel(RF));
2340  "Node 3 rotation matrix: " << std::endl << Ra3 << std::endl);
2341 
2342  Shape* pChord = 0;
2343  Shape* pForce = 0;
2344  Shape* pVelocity = 0;
2345  Shape* pTwist = 0;
2346  Shape* pTipLoss = 0;
2347 
2348  integer iNumber = 0;
2349  DriveCaller* pDC = 0;
2350  AeroData* aerodata = 0;
2351 
2352  ReadAeroData(pDM, HP, 3,
2353  &pChord, &pForce, &pVelocity, &pTwist, &pTipLoss,
2354  &iNumber, &pDC, &aerodata);
2355 
2356  bool bUseJacobian(false);
2357  if (HP.IsKeyWord("jacobian")) {
2358  bUseJacobian = HP.GetYesNoOrBool(bDefaultUseJacobian);
2359  }
2360 
2361  if (aerodata->iGetNumDof() > 0 && !bUseJacobian) {
2362  silent_cerr("AerodynamicBeam3(" << uLabel << "): "
2363  "aerodynamic model needs \"jacobian, yes\" at line " << HP.GetLineData()
2364  << std::endl);
2366  }
2367 
2369  unsigned uFlags = AerodynamicOutput::OUTPUT_NONE;
2370  ReadOptionalAerodynamicCustomOutput(pDM, HP, uLabel, uFlags, od);
2371 
2372  flag fOut = pDM->fReadOutput(HP, Elem::AERODYNAMIC);
2373  if (HP.IsArg()) {
2374  if (HP.IsKeyWord("std")) {
2376  } else if (HP.IsKeyWord("gauss")) {
2378  } else if (HP.IsKeyWord("node")) {
2380  } else {
2381  silent_cerr("AerodynamicBeam3(" << uLabel << "): "
2382  "unknown output mode at line " << HP.GetLineData()
2383  << std::endl);
2385  }
2386 
2387  } else if (fOut) {
2389  }
2390  fOut |= uFlags;
2391 
2392  Elem* pEl = 0;
2393 
2396  AerodynamicBeam(uLabel, pDO, pBeam, pIndVel, bPassive,
2397  f1, f2, f3, Ra1, Ra2, Ra3,
2398  pChord, pForce, pVelocity, pTwist, pTipLoss,
2399  iNumber, aerodata, pDC, bUseJacobian, od, fOut));
2400 
2401  /* Se non c'e' il punto e virgola finale */
2402  if (HP.IsArg()) {
2403  silent_cerr("semicolon expected at line "
2404  << HP.GetLineData() << std::endl);
2406  }
2407 
2408  std::ostream& out = pDM->GetLogFile();
2409  out << "aero3: " << uLabel;
2410 
2411  Vec3 ra1 = Ra1.GetVec(1);
2412  Vec3 ra3 = Ra1.GetVec(3);
2413  doublereal dC = pChord->dGet(-1.);
2414  doublereal dP = pForce->dGet(-1.);
2415  out
2416  << " " << pNode1->GetLabel()
2417  << " ", (f1 + ra1*(dP - dC*3./4.)).Write(out, " ")
2418  << " ", (f1 + ra1*(dP + dC/4.)).Write(out, " ");
2419 
2420  ra1 = Ra2.GetVec(1);
2421  ra3 = Ra2.GetVec(3);
2422  dC = pChord->dGet(0.);
2423  dP = pForce->dGet(0.);
2424  out
2425  << " " << pNode2->GetLabel()
2426  << " ", (f2 + ra1*(dP - dC*3./4.)).Write(out, " ")
2427  << " ", (f2 + ra1*(dP + dC/4.)).Write(out, " ");
2428 
2429  ra1 = Ra3.GetVec(1);
2430  ra3 = Ra3.GetVec(3);
2431  dC = pChord->dGet(1.);
2432  dP = pForce->dGet(1.);
2433  out
2434  << " " << pNode3->GetLabel()
2435  << " ", (f3 + ra1*(dP - dC*3./4.)).Write(out, " ")
2436  << " ", (f3 + ra1*(dP + dC/4.)).Write(out, " ")
2437  << std::endl;
2438 
2439  return pEl;
2440 } /* End of ReadAerodynamicBeam() */
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
Mat3x3 GetRotRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1795
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
OrientationDescription
Definition: matvec3.h:1597
static const bool bDefaultUseJacobian
Definition: aeroelem.cc:159
virtual const StructNode * pGetNode(unsigned int i) const
Definition: beam.cc:1290
void ReadOptionalAerodynamicCustomOutput(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
Definition: aeroelem.cc:1351
virtual bool GetYesNoOrBool(bool bDefval=false)
Definition: parser.cc:1038
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
Definition: elman.cc:650
static bool ReadInducedVelocity(DataManager *pDM, MBDynParser &HP, unsigned uLabel, const char *sElemType, InducedVelocity *&pIndVel, bool &bPassive)
Definition: aeroelem.cc:1216
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
Definition: beam.h:56
void ReadAeroData(DataManager *pDM, MBDynParser &HP, int iDim, Shape **ppChord, Shape **ppForce, Shape **ppVelocity, Shape **ppTwist, Shape **ppTipLoss, integer *piNumber, DriveCaller **ppDC, AeroData **aerodata)
Definition: aerodata.cc:593
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
virtual doublereal dGet(doublereal d1, doublereal d2=0.) const =0
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244
Definition: shape.h:50

Here is the call graph for this function:

Elem* ReadAerodynamicBeam2 ( DataManager pDM,
MBDynParser HP,
const DofOwner pDO,
unsigned int  uLabel 
)

Definition at line 3167 of file aeroelem.cc.

References AerodynamicOutput::AEROD_OUT_NODE, AerodynamicOutput::AEROD_OUT_PGAUSS, AerodynamicOutput::AEROD_OUT_STD, Elem::AERODYNAMIC, bDefaultUseJacobian, Elem::BEAM, DEBUGCOUTFNAME, DEBUGLCOUT, Shape::dGet(), DataManager::fReadOutput(), HighParser::GetInt(), WithLabel::GetLabel(), IncludeParser::GetLineData(), DataManager::GetLogFile(), MBDynParser::GetPosRel(), MBDynParser::GetRotRel(), HighParser::GetYesNoOrBool(), AeroData::iGetNumDof(), HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, AerodynamicOutput::OUTPUT_NONE, DataManager::pFindElem(), Beam2::pGetNode(), ReadAeroData(), ReadInducedVelocity(), ReadOptionalAerodynamicCustomOutput(), SAFENEWWITHCONSTRUCTOR, UNKNOWN_ORIENTATION_DESCRIPTION, and Write().

Referenced by DataManager::ReadOneElem().

3171 {
3172  DEBUGCOUTFNAME("ReadAerodynamicBeam2");
3173 
3174  /* Trave */
3175  unsigned int uBeam = (unsigned int)HP.GetInt();
3176 
3177  DEBUGLCOUT(MYDEBUG_INPUT, "Linked to beam: " << uBeam << std::endl);
3178 
3179  /* verifica di esistenza della trave */
3180  Elem *p = pDM->pFindElem(Elem::BEAM, uBeam);
3181  if (p == 0) {
3182  silent_cerr("Beam2(" << uBeam << ") not defined "
3183  "at line " << HP.GetLineData()
3184  << std::endl);
3186  }
3187  Beam2* pBeam = dynamic_cast<Beam2 *>(p);
3188  if (pBeam == 0) {
3189  silent_cerr("Beam(" << uBeam << ") is not a Beam2 "
3190  "at line " << HP.GetLineData()
3191  << std::endl);
3193  }
3194 
3195  /* Eventuale rotore */
3196  InducedVelocity* pIndVel = 0;
3197  bool bPassive(false);
3198  (void)ReadInducedVelocity(pDM, HP, uLabel, "AerodynamicBeam2",
3199  pIndVel, bPassive);
3200 
3201  /* Nodo 1: */
3202 
3203  /* Offset del corpo aerodinamico rispetto al nodo */
3204  const StructNode* pNode1 = pBeam->pGetNode(1);
3205 
3206  ReferenceFrame RF(pNode1);
3207  Vec3 f1(HP.GetPosRel(RF));
3208  DEBUGLCOUT(MYDEBUG_INPUT, "Node 1 offset: " << f1 << std::endl);
3209 
3210  Mat3x3 Ra1(HP.GetRotRel(RF));
3212  "Node 1 rotation matrix: " << std::endl << Ra1 << std::endl);
3213 
3214  /* Nodo 2: */
3215 
3216  /* Offset del corpo aerodinamico rispetto al nodo */
3217  const StructNode* pNode2 = pBeam->pGetNode(2);
3218 
3219  RF = ReferenceFrame(pNode2);
3220  Vec3 f2(HP.GetPosRel(RF));
3221  DEBUGLCOUT(MYDEBUG_INPUT, "Node 2 offset: " << f2 << std::endl);
3222 
3223  Mat3x3 Ra2(HP.GetRotRel(RF));
3225  "Node 2 rotation matrix: " << std::endl << Ra2 << std::endl);
3226 
3227  Shape* pChord = 0;
3228  Shape* pForce = 0;
3229  Shape* pVelocity = 0;
3230  Shape* pTwist = 0;
3231  Shape* pTipLoss = 0;
3232 
3233  integer iNumber = 0;
3234  DriveCaller* pDC = 0;
3235  AeroData* aerodata = 0;
3236 
3237  ReadAeroData(pDM, HP, 2,
3238  &pChord, &pForce, &pVelocity, &pTwist, &pTipLoss,
3239  &iNumber, &pDC, &aerodata);
3240 
3241  bool bUseJacobian(false);
3242  if (HP.IsKeyWord("jacobian")) {
3243  bUseJacobian = HP.GetYesNoOrBool(bDefaultUseJacobian);
3244  }
3245 
3246  if (aerodata->iGetNumDof() > 0 && !bUseJacobian) {
3247  silent_cerr("AerodynamicBeam2(" << uLabel << "): "
3248  "aerodynamic model needs \"jacobian, yes\" at line " << HP.GetLineData()
3249  << std::endl);
3251  }
3252 
3254  unsigned uFlags = AerodynamicOutput::OUTPUT_NONE;
3255  ReadOptionalAerodynamicCustomOutput(pDM, HP, uLabel, uFlags, od);
3256 
3257  flag fOut = pDM->fReadOutput(HP, Elem::AERODYNAMIC);
3258  if (HP.IsArg()) {
3259  if (HP.IsKeyWord("std")) {
3261  } else if (HP.IsKeyWord("gauss")) {
3263  } else if (HP.IsKeyWord("node")) {
3265  } else {
3266  silent_cerr("AerodynamicBeam2(" << uLabel << "): "
3267  "unknown output mode at line " << HP.GetLineData()
3268  << std::endl);
3270  }
3271 
3272  } else if (fOut) {
3274  }
3275  fOut |= uFlags;
3276 
3277  Elem* pEl = 0;
3278 
3281  AerodynamicBeam2(uLabel, pDO, pBeam, pIndVel, bPassive,
3282  f1, f2, Ra1, Ra2,
3283  pChord, pForce, pVelocity, pTwist, pTipLoss,
3284  iNumber, aerodata, pDC, bUseJacobian, od, fOut));
3285 
3286  /* Se non c'e' il punto e virgola finale */
3287  if (HP.IsArg()) {
3288  silent_cerr("semicolon expected at line "
3289  << HP.GetLineData() << std::endl);
3291  }
3292 
3293  std::ostream& out = pDM->GetLogFile();
3294  out << "aero2: " << uLabel;
3295 
3296  Vec3 ra1 = Ra1.GetVec(1);
3297  Vec3 ra3 = Ra1.GetVec(3);
3298  doublereal dC = pChord->dGet(-1.);
3299  doublereal dP = pForce->dGet(-1.);
3300  out
3301  << " " << pNode1->GetLabel()
3302  << " ", (f1 + ra1*(dP - dC*3./4.)).Write(out, " ")
3303  << " ", (f1 + ra1*(dP + dC/4.)).Write(out, " ");
3304 
3305  ra1 = Ra2.GetVec(1);
3306  ra3 = Ra2.GetVec(3);
3307  dC = pChord->dGet(1.);
3308  dP = pForce->dGet(1.);
3309  out
3310  << " " << pNode2->GetLabel()
3311  << " ", (f2 + ra1*(dP - dC*3./4.)).Write(out, " ")
3312  << " ", (f2 + ra1*(dP + dC/4.)).Write(out, " ")
3313  << std::endl;
3314 
3315  return pEl;
3316 } /* End of ReadAerodynamicBeam2() */
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
Mat3x3 GetRotRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1795
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
Definition: beam2.h:50
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
OrientationDescription
Definition: matvec3.h:1597
static const bool bDefaultUseJacobian
Definition: aeroelem.cc:159
void ReadOptionalAerodynamicCustomOutput(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
Definition: aeroelem.cc:1351
virtual bool GetYesNoOrBool(bool bDefval=false)
Definition: parser.cc:1038
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
Definition: elman.cc:650
static bool ReadInducedVelocity(DataManager *pDM, MBDynParser &HP, unsigned uLabel, const char *sElemType, InducedVelocity *&pIndVel, bool &bPassive)
Definition: aeroelem.cc:1216
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual const StructNode * pGetNode(unsigned int i) const
Definition: beam2.cc:852
void ReadAeroData(DataManager *pDM, MBDynParser &HP, int iDim, Shape **ppChord, Shape **ppForce, Shape **ppVelocity, Shape **ppTwist, Shape **ppTipLoss, integer *piNumber, DriveCaller **ppDC, AeroData **aerodata)
Definition: aerodata.cc:593
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
virtual doublereal dGet(doublereal d1, doublereal d2=0.) const =0
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244
Definition: shape.h:50

Here is the call graph for this function:

Elem* ReadAerodynamicBody ( DataManager pDM,
MBDynParser HP,
const DofOwner pDO,
unsigned int  uLabel 
)

Definition at line 1361 of file aeroelem.cc.

References AerodynamicOutput::AEROD_OUT_NODE, AerodynamicOutput::AEROD_OUT_PGAUSS, AerodynamicOutput::AEROD_OUT_STD, Elem::AERODYNAMIC, bDefaultUseJacobian, grad::cos(), DEBUGCOUTFNAME, DEBUGLCOUT, Shape::dGet(), DataManager::fReadOutput(), WithLabel::GetLabel(), IncludeParser::GetLineData(), DataManager::GetLogFile(), MBDynParser::GetPosRel(), HighParser::GetReal(), MBDynParser::GetRotRel(), HighParser::GetYesNoOrBool(), AeroData::iGetNumDof(), HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, AerodynamicOutput::OUTPUT_NONE, ReadAeroData(), ReadInducedVelocity(), DataManager::ReadNode(), ReadOptionalAerodynamicCustomOutput(), SAFENEWWITHCONSTRUCTOR, grad::sin(), Node::STRUCTURAL, UNKNOWN_ORIENTATION_DESCRIPTION, and Write().

Referenced by DataManager::ReadOneElem().

1365 {
1366  DEBUGCOUTFNAME("ReadAerodynamicBody");
1367 
1368  /* Nodo */
1369  const StructNode* pNode = pDM->ReadNode<const StructNode, Node::STRUCTURAL>(HP);
1370 
1371  InducedVelocity* pIndVel = 0;
1372  bool bPassive(false);
1373  (void)ReadInducedVelocity(pDM, HP, uLabel, "AerodynamicBody",
1374  pIndVel, bPassive);
1375 
1376  ReferenceFrame RF(pNode);
1377  Vec3 f(HP.GetPosRel(RF));
1378 
1379  DEBUGLCOUT(MYDEBUG_INPUT, "Offset: " << f << std::endl);
1380 
1381  Mat3x3 Ra(HP.GetRotRel(RF));
1382 
1383  doublereal dSpan = HP.GetReal();
1384  DEBUGLCOUT(MYDEBUG_INPUT, "Span: " << dSpan << std::endl);
1385 
1386  Shape* pChord = 0;
1387  Shape* pForce = 0;
1388  Shape* pVelocity = 0;
1389  Shape* pTwist = 0;
1390  Shape* pTipLoss = 0;
1391 
1392  integer iNumber = 0;
1393  DriveCaller* pDC = 0;
1394  AeroData* aerodata = 0;
1395 
1396  ReadAeroData(pDM, HP, 1,
1397  &pChord, &pForce, &pVelocity, &pTwist, &pTipLoss,
1398  &iNumber, &pDC, &aerodata);
1399 
1400  bool bUseJacobian(false);
1401  if (HP.IsKeyWord("jacobian")) {
1402  bUseJacobian = HP.GetYesNoOrBool(bDefaultUseJacobian);
1403  }
1404 
1405  if (aerodata->iGetNumDof() > 0 && !bUseJacobian) {
1406  silent_cerr("AerodynamicBody(" << uLabel << "): "
1407  "aerodynamic model needs \"jacobian, yes\" at line " << HP.GetLineData()
1408  << std::endl);
1410  }
1411 
1413  unsigned uFlags = AerodynamicOutput::OUTPUT_NONE;
1414  ReadOptionalAerodynamicCustomOutput(pDM, HP, uLabel, uFlags, od);
1415 
1416  flag fOut = pDM->fReadOutput(HP, Elem::AERODYNAMIC);
1417  if (HP.IsArg()) {
1418  if (HP.IsKeyWord("std")) {
1420  } else if (HP.IsKeyWord("gauss")) {
1422  } else if (HP.IsKeyWord("node")) {
1424  } else {
1425  silent_cerr("AerodynamicBody(" << uLabel << "): "
1426  "unknown output mode at line " << HP.GetLineData()
1427  << std::endl);
1429  }
1430 
1431  } else if (fOut) {
1433  }
1434  fOut |= uFlags;
1435 
1436  Elem* pEl = 0;
1439  AerodynamicBody(uLabel, pDO, pNode, pIndVel, bPassive,
1440  f, dSpan, Ra,
1441  pChord, pForce, pVelocity, pTwist, pTipLoss,
1442  iNumber, aerodata, pDC, bUseJacobian, od, fOut));
1443 
1444  /* Se non c'e' il punto e virgola finale */
1445  if (HP.IsArg()) {
1446  silent_cerr("semicolon expected at line "
1447  << HP.GetLineData() << std::endl);
1449  }
1450 
1451  Vec3 Ra3 = Ra.GetVec(3);
1452  doublereal dCm1 = pChord->dGet(-1.);
1453  doublereal dPm1 = pForce->dGet(-1.);
1454  doublereal dTm1 = pTwist->dGet(-1.);
1455  Vec3 Ram1 = Ra*Vec3(std::cos(dTm1), std::sin(dTm1), 0.);
1456 
1457  doublereal dCp1 = pChord->dGet(1.);
1458  doublereal dPp1 = pForce->dGet(1.);
1459  doublereal dTp1 = pTwist->dGet(1.);
1460  Vec3 Rap1 = Ra*Vec3(std::cos(dTp1), std::sin(dTp1), 0.);
1461 
1462  std::ostream& out = pDM->GetLogFile();
1463  out << "aero0: " << uLabel
1464  << " " << pNode->GetLabel()
1465  << " ", (f - Ra3*(dSpan/2.) + Ram1*(dPm1 - dCm1*3./4.)).Write(out, " ")
1466  << " ", (f - Ra3*(dSpan/2.) + Ram1*(dPm1 + dCm1/4.)).Write(out, " ")
1467  << " ", (f + Ra3*(dSpan/2.) + Rap1*(dPp1 - dCp1*3./4.)).Write(out, " ")
1468  << " ", (f + Ra3*(dSpan/2.) + Rap1*(dPp1 + dCp1/4.)).Write(out, " ")
1469  << std::endl;
1470 
1471  return pEl;
1472 } /* End of ReadAerodynamicBody() */
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
Mat3x3 GetRotRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1795
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
OrientationDescription
Definition: matvec3.h:1597
static const bool bDefaultUseJacobian
Definition: aeroelem.cc:159
void ReadOptionalAerodynamicCustomOutput(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
Definition: aeroelem.cc:1351
virtual bool GetYesNoOrBool(bool bDefval=false)
Definition: parser.cc:1038
static bool ReadInducedVelocity(DataManager *pDM, MBDynParser &HP, unsigned uLabel, const char *sElemType, InducedVelocity *&pIndVel, bool &bPassive)
Definition: aeroelem.cc:1216
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
void ReadAeroData(DataManager *pDM, MBDynParser &HP, int iDim, Shape **ppChord, Shape **ppForce, Shape **ppVelocity, Shape **ppTwist, Shape **ppTipLoss, integer *piNumber, DriveCaller **ppDC, AeroData **aerodata)
Definition: aerodata.cc:593
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
virtual doublereal dGet(doublereal d1, doublereal d2=0.) const =0
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244
Definition: shape.h:50
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:

void ReadAerodynamicCustomOutput ( DataManager pDM,
MBDynParser HP,
unsigned int  uLabel,
unsigned &  uFlags,
OrientationDescription od 
)

Definition at line 1295 of file aeroelem.cc.

References IncludeParser::GetLineData(), HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, AerodynamicOutput::OUTPUT_GP_ALL, AerodynamicOutput::OUTPUT_GP_CONFIGURATION, AerodynamicOutput::OUTPUT_GP_F, AerodynamicOutput::OUTPUT_GP_FORCES, AerodynamicOutput::OUTPUT_GP_M, AerodynamicOutput::OUTPUT_GP_R, AerodynamicOutput::OUTPUT_GP_V, AerodynamicOutput::OUTPUT_GP_W, AerodynamicOutput::OUTPUT_GP_X, AerodynamicOutput::OUTPUT_NONE, and ReadOptionalOrientationDescription().

Referenced by DataManager::ReadControl(), and ReadOptionalAerodynamicCustomOutput().

1297 {
1299 
1300  while (HP.IsArg()) {
1301  unsigned uFlag;
1302 
1303  if (HP.IsKeyWord("position")) {
1305 
1306  } else if (HP.IsKeyWord("orientation")) {
1308 
1309  } else if (HP.IsKeyWord("velocity")) {
1311 
1312  } else if (HP.IsKeyWord("angular" "velocity")) {
1314 
1315  } else if (HP.IsKeyWord("configuration")) {
1317 
1318  } else if (HP.IsKeyWord("force")) {
1320 
1321  } else if (HP.IsKeyWord("moment")) {
1323 
1324  } else if (HP.IsKeyWord("forces")) {
1326 
1327  } else if (HP.IsKeyWord("all")) {
1329 
1330  } else {
1331  break;
1332  }
1333 
1334  if (uFlags & uFlag) {
1335  silent_cerr("AerodynamicElement(" << uLabel << "): "
1336  "duplicate custom output "
1337  "at line " << HP.GetLineData()
1338  << std::endl);
1340  }
1341 
1342  if (uFlag & AerodynamicOutput::OUTPUT_GP_R) {
1343  od = ReadOptionalOrientationDescription(pDM, HP);
1344  }
1345 
1346  uFlags |= uFlag;
1347  }
1348 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
OrientationDescription ReadOptionalOrientationDescription(DataManager *pDM, MBDynParser &HP)
Definition: dataman3.cc:2531
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual bool IsArg(void)
Definition: parser.cc:807
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

static bool ReadInducedVelocity ( DataManager pDM,
MBDynParser HP,
unsigned  uLabel,
const char *  sElemType,
InducedVelocity *&  pIndVel,
bool bPassive 
)
static

Definition at line 1216 of file aeroelem.cc.

References ASSERT, DEBUGLCOUT, HighParser::GetInt(), IncludeParser::GetLineData(), Elem::INDUCEDVELOCITY, HighParser::IsKeyWord(), Elem::LOADABLE, MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, and DataManager::pFindElem().

Referenced by ReadAerodynamicBeam(), ReadAerodynamicBeam2(), and ReadAerodynamicBody().

1219 {
1220  bool bReadIV(false);
1221  bool bReadUDIV(false);
1222  if (HP.IsKeyWord("rotor")) {
1223  silent_cerr(sElemType << "(" << uLabel << "): "
1224  "\"rotor\" keyword is deprecated; "
1225  "use \"induced velocity\" instead "
1226  "at line " << HP.GetLineData()
1227  << std::endl);
1228 
1229  bReadIV = true;
1230 
1231  } else if (HP.IsKeyWord("induced" "velocity")) {
1232  bReadIV = true;
1233 
1234  } else if (HP.IsKeyWord("user" "defined" "induced" "velocity")) {
1235  bReadIV = true;
1236  bReadUDIV = true;
1237  }
1238 
1239  if (bReadIV) {
1240  unsigned int uIV = (unsigned int)HP.GetInt();
1242  "Linked to InducedVelocity(" << uIV << ")" << std::endl);
1243 
1244  bPassive = false;
1245  if (HP.IsKeyWord("passive")) {
1246  bPassive = true;
1247  }
1248 
1249  /*
1250  * verifica di esistenza del rotore
1251  * NOTA: ovviamente il rotore deve essere definito
1252  * prima dell'elemento aerodinamico
1253  */
1254  Elem* p;
1255 
1256  if (bReadUDIV) {
1257  p = pDM->pFindElem(Elem::LOADABLE, uIV);
1258  if (p == 0) {
1259  silent_cerr(sElemType << "(" << uLabel << "): "
1260  "user-defined InducedVelocity(" << uIV << ") not defined "
1261  "at line " << HP.GetLineData()
1262  << std::endl);
1264  }
1265 
1266  } else {
1267  p = pDM->pFindElem(Elem::INDUCEDVELOCITY, uIV);
1268  if (p == 0) {
1269  // try a user-defined one?
1270  p = pDM->pFindElem(Elem::LOADABLE, uIV);
1271  if (p == 0 || !dynamic_cast<InducedVelocity *>(p)) {
1272  silent_cerr(sElemType << "(" << uLabel << "): "
1273  "InducedVelocity(" << uIV << ") not defined "
1274  "at line " << HP.GetLineData()
1275  << std::endl);
1276 
1278  }
1279 
1280  silent_cerr(sElemType << "(" << uLabel << "): "
1281  "InducedVelocity(" << uIV << ") not defined; using user-defined InducedVelocity(" << uIV << ") "
1282  "at line " << HP.GetLineData()
1283  << std::endl);
1284  }
1285  }
1286 
1287  pIndVel = dynamic_cast<InducedVelocity *>(p);
1288  ASSERT(pIndVel != 0);
1289  }
1290 
1291  return (pIndVel != 0);
1292 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
Definition: elman.cc:650
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define ASSERT(expression)
Definition: colamd.c:977
Definition: elem.h:75
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244

Here is the call graph for this function:

void ReadOptionalAerodynamicCustomOutput ( DataManager pDM,
MBDynParser HP,
unsigned int  uLabel,
unsigned &  uFlags,
OrientationDescription od 
)

Definition at line 1351 of file aeroelem.cc.

References Elem::AERODYNAMIC, DataManager::GetOutput(), HighParser::IsKeyWord(), and ReadAerodynamicCustomOutput().

Referenced by ReadAerodynamicBeam(), ReadAerodynamicBeam2(), and ReadAerodynamicBody().

1353 {
1354  pDM->GetOutput(Elem::AERODYNAMIC, uFlags, od);
1355  if (HP.IsKeyWord("custom" "output")) {
1356  ReadAerodynamicCustomOutput(pDM, HP, uLabel, uFlags, od);
1357  }
1358 }
void GetOutput(Elem::Type t, unsigned &, OrientationDescription &) const
Definition: dataman.cc:871
void ReadAerodynamicCustomOutput(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, unsigned &uFlags, OrientationDescription &od)
Definition: aeroelem.cc:1295
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910

Here is the call graph for this function:

Variable Documentation

const bool bDefaultUseJacobian = false
static

Definition at line 159 of file aeroelem.cc.

Referenced by ReadAerodynamicBeam(), ReadAerodynamicBeam2(), and ReadAerodynamicBody().

const doublereal d13 = 1./sqrt(3.)
static

Definition at line 1556 of file aeroelem.cc.

const char* elemnames[]
static
Initial value:
= {
"AerodynamicBody",
"AerodynamicBeam2",
"AerodynamicBeam3",
0
}

Definition at line 258 of file aeroelem.cc.

Referenced by Aerodynamic2DElem< iNN >::DescribeDof(), Aerodynamic2DElem< iNN >::DescribeEq(), and Aerodynamic2DElem< iNN >::OutputPrepare().

const doublereal pdsf2[] = { 0., 1. }
static

Definition at line 2524 of file aeroelem.cc.

Referenced by AerodynamicBeam2::AssJac(), and AerodynamicBeam2::AssVec().

const doublereal pdsf3[] = { -d13, d13, 1. }
static

Definition at line 1558 of file aeroelem.cc.

Referenced by AerodynamicBeam::AssJac(), and AerodynamicBeam::AssVec().

const doublereal pdsi2[] = { -1., 0. }
static

Definition at line 2523 of file aeroelem.cc.

Referenced by AerodynamicBeam2::AssJac(), and AerodynamicBeam2::AssVec().

const doublereal pdsi3[] = { -1., -d13, d13 }
static

Definition at line 1557 of file aeroelem.cc.

Referenced by AerodynamicBeam::AssJac(), and AerodynamicBeam::AssVec().