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

#include <aeroelem.h>

Inheritance diagram for AerodynamicBody:
Collaboration diagram for AerodynamicBody:

Public Member Functions

 AerodynamicBody (unsigned int uLabel, const DofOwner *pDO, const StructNode *pN, InducedVelocity *pR, bool bPassive, const Vec3 &fTmp, doublereal dS, const Mat3x3 &RaTmp, 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 ~AerodynamicBody (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Output (OutputHandler &OH) const
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) const
 
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 void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual 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 VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
- Public Member Functions inherited from Aerodynamic2DElem< 1 >
 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 AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
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)
 
- 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

void AssVec (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
- Protected Member Functions inherited from Aerodynamic2DElem< 1 >
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

const StructNodepNode
 
const Vec3 f
 
doublereal dHalfSpan
 
const Mat3x3 Ra
 
const Vec3 Ra3
 
Vec3 F
 
Vec3 M
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from Aerodynamic2DElem< 1 >
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 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

Definition at line 253 of file aeroelem.h.

Constructor & Destructor Documentation

AerodynamicBody::AerodynamicBody ( unsigned int  uLabel,
const DofOwner pDO,
const StructNode pN,
InducedVelocity pR,
bool  bPassive,
const Vec3 fTmp,
doublereal  dS,
const Mat3x3 RaTmp,
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 660 of file aeroelem.cc.

References ASSERT, DEBUGCOUTFNAME, StructDispNode::GetNodeType(), pNode, and Node::STRUCTURAL.

673 : Elem(uLabel, fOut),
674 Aerodynamic2DElem<1>(uLabel, pDO, pR, bPassive, pC, pF, pV, pT, pTL, iN,
675  a, pDC, bUseJacobian, ood, fOut),
676 pNode(pN),
677 f(fTmp),
678 dHalfSpan(dS/2.),
679 Ra(RaTmp),
680 Ra3(RaTmp.GetVec(3)),
681 F(Zero3),
682 M(Zero3)
683 {
684  DEBUGCOUTFNAME("AerodynamicBody::AerodynamicBody");
685 
686  ASSERT(pNode != 0);
688 
689 }
const Vec3 Zero3(0., 0., 0.)
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
const Vec3 f
Definition: aeroelem.h:260
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const Vec3 Ra3
Definition: aeroelem.h:263
const StructNode * pNode
Definition: aeroelem.h:258
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal dS
Definition: beamslider.cc:71
const Mat3x3 Ra
Definition: aeroelem.h:262
static const doublereal a
Definition: hfluid_.h:289
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
doublereal dHalfSpan
Definition: aeroelem.h:261

Here is the call graph for this function:

AerodynamicBody::~AerodynamicBody ( void  )
virtual

Definition at line 691 of file aeroelem.cc.

References DEBUGCOUTFNAME.

692 {
693  DEBUGCOUTFNAME("AerodynamicBody::~AerodynamicBody");
694 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256

Member Function Documentation

VariableSubMatrixHandler & AerodynamicBody::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 723 of file aeroelem.cc.

References Aerodynamic2DElem< 1 >::aerodata, AeroData::AssJac(), Aerodynamic2DElem< 1 >::bJacobian, c, Aerodynamic2DElem< 1 >::Chord, grad::cos(), Aerodynamic2DElem< 1 >::cq, DEBUGCOUT, ShapeOwner::dGet(), DriveOwner::dGet(), Rotor::dGetOmega(), PntWght::dGetPnt(), PntWght::dGetWght(), dHalfSpan, f, AirPropOwner::fGetAirVelocity(), GaussDataIterator::fGetNext(), Aerodynamic2DElem< 1 >::ForcePoint, Aerodynamic2DElem< 1 >::fq, Aerodynamic2DElem< 1 >::GDI, AirPropOwner::GetAirProps(), Elem::GetElemType(), GaussDataIterator::GetFirst(), AeroData::GetForcesJac(), InducedVelocity::GetInducedVelocity(), WithLabel::GetLabel(), Mat6x6::GetMat11(), Mat6x6::GetMat12(), Mat6x6::GetMat21(), Mat6x6::GetMat22(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3xN::GetVec(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), AeroData::iGetNumDof(), MatCross, Mat3x3::MulTM(), MultRMRt(), Mat3x3::MulTV(), Aerodynamic2DElem< 1 >::OUTA, Aerodynamic2DElem< 1 >::pIndVel, pNode, FullSubMatrixHandler::PutColIndex(), Mat3xN::PutMat3x3(), FullSubMatrixHandler::PutRowIndex(), Vec3::PutTo(), Ra, Ra3, AerodynamicOutput::ResetIterator(), FullSubMatrixHandler::ResizeReset(), AeroData::SetAirData(), VariableSubMatrixHandler::SetFull(), VariableSubMatrixHandler::SetNullMatrix(), AeroData::SetSectionData(), grad::sin(), FullSubMatrixHandler::Sub(), Mat3x3::Transpose(), Aerodynamic2DElem< 1 >::Twist, Aerodynamic2DElem< 1 >::VelocityPoint, Aerodynamic2DElem< 1 >::vx, Elem::WorkSpaceDim(), Aerodynamic2DElem< 1 >::wx, and Zero3.

727 {
728  DEBUGCOUT("Entering AerodynamicBody::AssJac()" << std::endl);
729 
730  if (!bJacobian) {
731  WorkMat.SetNullMatrix();
732  return WorkMat;
733  }
734 
735  FullSubMatrixHandler& WM = WorkMat.SetFull();
736 
737  /* Ridimensiona la sottomatrice in base alle esigenze */
738  integer iNumRows = 0;
739  integer iNumCols = 0;
740  WorkSpaceDim(&iNumRows, &iNumCols);
741  WM.ResizeReset(iNumRows, iNumCols);
742 
743  /* Recupera gli indici delle varie incognite */
744  integer iNodeFirstMomIndex = pNode->iGetFirstMomentumIndex();
745  integer iNodeFirstPosIndex = pNode->iGetFirstPositionIndex();
746 
747  /* Setta gli indici delle equazioni */
748  for (int iCnt = 1; iCnt <= 6; iCnt++) {
749  WM.PutRowIndex(iCnt, iNodeFirstMomIndex + iCnt);
750  WM.PutColIndex(iCnt, iNodeFirstPosIndex + iCnt);
751  }
752 
753  /* Equations start here... */
754  doublereal dW[6];
755 
756  /* Dati del nodo */
757  const Vec3& Xn(pNode->GetXCurr());
758  const Mat3x3& Rn(pNode->GetRCurr());
759  const Vec3& Vn(pNode->GetVCurr());
760  const Vec3& Wn(pNode->GetWCurr());
761 
762  /*
763  * Matrice di trasformazione dal sistema globale a quello aerodinamico
764  */
765  Mat3x3 RR(Rn*Ra);
766 
767  /*
768  * Se l'elemento e' collegato ad un rotore,
769  * si fa dare la velocita' di rotazione
770  */
771  doublereal dOmega = 0.;
772  if (pIndVel != 0) {
773  Rotor *pRotor = dynamic_cast<Rotor *>(pIndVel);
774  if (pRotor) {
775  dOmega = pRotor->dGetOmega();
776  }
777  }
778 
779  /*
780  * Dati "permanenti" (uso la posizione del nodo perche'
781  * non dovrebbero cambiare "molto")
782  */
783  doublereal rho, c, p, T;
784  GetAirProps(Xn, rho, c, p, T); /* p, T no used yet */
785  aerodata->SetAirData(rho, c);
786 
787  ResetIterator();
788 
789  integer iNumDof = aerodata->iGetNumDof();
790  integer iFirstEq = -1;
791  integer iFirstSubEq = -1;
792  if (iNumDof > 0) {
793  iFirstEq = iGetFirstIndex();
794  iFirstSubEq = 6;
795 
796  integer iOffset = iFirstEq - 6;
797 
798  for (int iCnt = 6 + 1; iCnt <= iNumRows; iCnt++) {
799  WM.PutRowIndex(iCnt, iOffset + iCnt);
800  WM.PutColIndex(iCnt, iOffset + iCnt);
801  }
802  }
803 
804  /* Ciclo sui punti di Gauss */
805  PntWght PW = GDI.GetFirst();
806  int iPnt = 0;
807  do {
808  doublereal dCsi = PW.dGetPnt();
809  Vec3 Xr(Rn*(f + Ra3*(dHalfSpan*dCsi)));
810  Vec3 Xnr = Xn + Xr;
811  Vec3 Vr(Vn + Wn.Cross(Xr));
812 
813  /* Contributo di velocita' del vento */
814  Vec3 VTmp(Zero3);
815  if (fGetAirVelocity(VTmp, Xnr)) {
816  Vr -= VTmp;
817  }
818 
819  /*
820  * Se l'elemento e' collegato ad un rotore,
821  * aggiunge alla velocita' la velocita' indotta
822  */
823  if (pIndVel != 0) {
825  GetLabel(), iPnt, Xnr);
826  }
827 
828  /* Copia i dati nel vettore di lavoro dVAM */
829  doublereal dTw = Twist.dGet(dCsi) + dGet();
830  aerodata->SetSectionData(dCsi,
831  Chord.dGet(dCsi),
832  ForcePoint.dGet(dCsi),
833  VelocityPoint.dGet(dCsi),
834  dTw,
835  dOmega);
836 
837  /*
838  * Lo svergolamento non viene piu' trattato in aerod2_; quindi
839  * lo uso per correggere la matrice di rotazione
840  * dal sistema aerodinamico a quello globale
841  */
842  Mat3x3 RRloc;
843  if (dTw != 0.) {
844  doublereal dCosT = cos(dTw);
845  doublereal dSinT = sin(dTw);
846  /* Assumo lo svergolamento positivo a cabrare */
847  Mat3x3 RTw( dCosT, dSinT, 0.,
848  -dSinT, dCosT, 0.,
849  0., 0., 1.);
850  RRloc = RR*RTw;
851 
852  } else {
853  RRloc = RR;
854  }
855 
856  /*
857  * Ruota velocita' e velocita' angolare nel sistema
858  * aerodinamico e li copia nel vettore di lavoro dW
859  */
860  VTmp = RRloc.MulTV(Vr);
861  VTmp.PutTo(dW);
862 
863  Vec3 WTmp = RRloc.MulTV(Wn);
864  WTmp.PutTo(&dW[3]);
865 
866  /* Funzione di calcolo delle forze aerodinamiche */
867  doublereal Fa0[6];
868  Mat6x6 JFa;
869 
870  /* Jacobian Assembly... */
871  doublereal cc = dHalfSpan*PW.dGetWght();
872 
873  if (iNumDof) {
874  // prepare (v/dot{x} + dCoef*v/x) and so
875  Mat3x3 RRlocT(RRloc.Transpose());
876 
877  vx.PutMat3x3(1, RRlocT);
878  vx.PutMat3x3(4, RRloc.MulTM(Mat3x3(MatCross, (Vr + Xr.Cross(Wn))*dCoef - Xr)));
879  wx.PutMat3x3(4, RRlocT);
880 
881  // equations from iFirstEq on are dealt with by aerodata
882  aerodata->AssJac(WM, dCoef, XCurr, XPrimeCurr,
883  iFirstEq, iFirstSubEq,
884  vx, wx, fq, cq, iPnt, dW, Fa0, JFa, OUTA[iPnt]);
885 
886  // deal with (f/dot{q} + dCoef*f/q) and so
887  integer iOffset = 6 + iPnt*iNumDof;
888  for (integer iCol = 1; iCol <= iNumDof; iCol++) {
889  Vec3 fqTmp((RRloc*fq.GetVec(iCol))*cc);
890  Vec3 cqTmp(Xr.Cross(fqTmp) + (RRloc*cq.GetVec(iCol))*cc);
891 
892  WM.Sub(1, iOffset + iCol, fqTmp);
893  WM.Sub(4, iOffset + iCol, cqTmp);
894  }
895 
896  // first equation
897  iFirstEq += iNumDof;
898  iFirstSubEq += iNumDof;
899 
900  } else {
901  aerodata->GetForcesJac(iPnt, dW, Fa0, JFa, OUTA[iPnt]);
902  }
903 
904  // rotate force, couple and Jacobian matrix in absolute frame
905  Mat6x6 JFaR = MultRMRt(JFa, RRloc, cc);
906 
907  Vec3 fTmp(RRloc*(Vec3(&Fa0[0])*dCoef));
908  Vec3 cTmp(RRloc*(Vec3(&Fa0[3])*dCoef) + Xr.Cross(fTmp));
909 
910  // compute submatrices (see tecman.pdf)
911  Mat3x3 Mat21(Xr.Cross(JFaR.GetMat11()) + JFaR.GetMat21());
912 
913  Mat3x3 Mat12(JFaR.GetMat12() - JFaR.GetMat11()*Mat3x3(MatCross, Xr));
914 
915  Mat3x3 Mat22(Xr.Cross(JFaR.GetMat12()) + JFaR.GetMat22() - Mat21*Mat3x3(MatCross, Xr));
916 
917  Mat3x3 MatV(MatCross, (Vr + Xr.Cross(Wn))*dCoef);
918 
919  Mat12 += JFaR.GetMat11()*MatV - Mat3x3(MatCross, fTmp);
920 
921  Mat22 += Mat21*MatV - Mat3x3(MatCross, cTmp);
922 
923  // add (actually, sub) contributions, scaled by weight
924  WM.Sub(1, 1, JFaR.GetMat11());
925  WM.Sub(1, 4, Mat12);
926  WM.Sub(4, 1, Mat21);
927  WM.Sub(4, 4, Mat22);
928 
929  iPnt++;
930 
931  } while (GDI.fGetNext(PW));
932 
933  return WorkMat;
934 }
void ResetIterator(void)
Definition: aeroelem.cc:77
Mat3x3 MultRMRt(const Mat3x3 &m, const Mat3x3 &R)
Definition: matvec3.cc:1162
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual void SetSectionData(const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
Definition: aerodata.cc:237
const Vec3 Zero3(0., 0., 0.)
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:760
Mat3x3 GetMat12(void)
Definition: matvec6.h:328
virtual int GetForcesJac(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:384
Definition: matvec3.h:98
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
flag fGetNext(doublereal &d, integer i=0) const
Definition: gauss.cc:205
Mat3x3 GetMat21(void)
Definition: matvec6.h:324
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
PntWght GetFirst(void) const
Definition: gauss.cc:198
doublereal dGet(void) const
Definition: drive.cc:671
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
void PutMat3x3(integer iCol, const Mat3x3 &m)
Definition: matvec3n.cc:628
Mat3x3 GetMat22(void)
Definition: matvec6.h:332
virtual Elem::Type GetElemType(void) const =0
const Vec3 f
Definition: aeroelem.h:260
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
const Vec3 Ra3
Definition: aeroelem.h:263
virtual void SetAirData(const doublereal &rho, const doublereal &c)
Definition: aerodata.cc:214
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
Mat3x3 GetMat11(void)
Definition: matvec6.h:320
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
doublereal dGetWght(void) const
Definition: gauss.h:56
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
void SetNullMatrix(void)
Definition: submat.h:1159
void PutTo(doublereal *pd) const
Definition: matvec3.h:339
virtual Vec3 GetInducedVelocity(Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const =0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const StructNode * pNode
Definition: aeroelem.h:258
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual integer iGetFirstMomentumIndex(void) const =0
virtual doublereal dGet(doublereal d) const
Definition: shape.cc:60
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
virtual doublereal dGetOmega(void) const
Definition: rotor.h:151
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
static std::stack< cleanup * > c
Definition: cleanup.cc:59
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
doublereal dGetPnt(void) const
Definition: gauss.h:55
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
const Mat3x3 Ra
Definition: aeroelem.h:262
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual flag fGetAirVelocity(Vec3 &Velocity, const Vec3 &X) const
Definition: aerodyn.cc:725
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
virtual void AssJac(FullSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, const Mat3xN &vx, const Mat3xN &wx, Mat3xN &fq, Mat3xN &cq, int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:403
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal dHalfSpan
Definition: aeroelem.h:261
Definition: rotor.h:43
Definition: gauss.h:50

Here is the call graph for this function:

SubVectorHandler & AerodynamicBody::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 938 of file aeroelem.cc.

References AssVec(), DEBUGCOUTFNAME, StructDispNode::iGetFirstMomentumIndex(), pNode, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and Elem::WorkSpaceDim().

942 {
943  DEBUGCOUTFNAME("AerodynamicBody::AssRes");
944 
945  integer iNumRows;
946  integer iNumCols;
947  WorkSpaceDim(&iNumRows, &iNumCols);
948  WorkVec.ResizeReset(iNumRows);
949 
950  integer iFirstIndex = pNode->iGetFirstMomentumIndex();
951  for (int iCnt = 1; iCnt <= 6; iCnt++) {
952  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
953  }
954 
955  AssVec(WorkVec, dCoef, XCurr, XPrimeCurr);
956 
957  return WorkVec;
958 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: aeroelem.cc:990
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructNode * pNode
Definition: aeroelem.h:258
virtual integer iGetFirstMomentumIndex(void) const =0
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void AerodynamicBody::AssVec ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
protected

Definition at line 990 of file aeroelem.cc.

References VectorHandler::Add(), Aerodynamic2DElem< 1 >::AddForce_int(), Aerodynamic2DElem< 1 >::AddSectionalForce_int(), Aerodynamic2DElem< 1 >::aerodata, AeroData::AssRes(), ToBeOutput::bToBeOutput(), c, Aerodynamic2DElem< 1 >::Chord, grad::cos(), Vec3::Cross(), DEBUGCOUTFNAME, ShapeOwner::dGet(), DriveOwner::dGet(), Rotor::dGetOmega(), PntWght::dGetPnt(), PntWght::dGetWght(), dHalfSpan, f, F, AirPropOwner::fGetAirVelocity(), GaussDataIterator::fGetNext(), Aerodynamic2DElem< 1 >::ForcePoint, Aerodynamic2DElem< 1 >::GDI, AirPropOwner::GetAirProps(), Elem::GetElemType(), GaussDataIterator::GetFirst(), AeroData::GetForces(), InducedVelocity::GetInducedVelocity(), WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), AeroData::iGetNumDof(), VectorHandler::iGetSize(), M, Mat3x3::MulTV(), Aerodynamic2DElem< 1 >::OUTA, Aerodynamic2DElem< 1 >::pIndVel, pNode, SubVectorHandler::PutRowIndex(), Vec3::PutTo(), Ra, Ra3, Vec3::Reset(), AerodynamicOutput::ResetIterator(), AeroData::SetAirData(), AerodynamicOutput::SetData(), AeroData::SetSectionData(), grad::sin(), Aerodynamic2DElem< 1 >::TipLoss, Aerodynamic2DElem< 1 >::Twist, Aerodynamic2DElem< 1 >::VelocityPoint, and Zero3.

Referenced by AssRes(), and InitialAssRes().

994 {
995  DEBUGCOUTFNAME("AerodynamicBody::AssVec");
996 
997  doublereal dTng[6];
998  doublereal dW[6];
999 
1000  /* Dati del nodo */
1001  const Vec3& Xn(pNode->GetXCurr());
1002  const Mat3x3& Rn(pNode->GetRCurr());
1003  const Vec3& Vn(pNode->GetVCurr());
1004  const Vec3& Wn(pNode->GetWCurr());
1005 
1006  /*
1007  * Matrice di trasformazione dal sistema globale a quello aerodinamico
1008  */
1009  Mat3x3 RR(Rn*Ra);
1010 
1011  /*
1012  * Se l'elemento e' collegato ad un rotore,
1013  * si fa dare la velocita' di rotazione
1014  */
1015  doublereal dOmega = 0.;
1016  if (pIndVel != 0) {
1017  Rotor *pRotor = dynamic_cast<Rotor *>(pIndVel);
1018  if (pRotor) {
1019  dOmega = pRotor->dGetOmega();
1020  }
1021  }
1022 
1023  /* Resetta i dati */
1024  F.Reset();
1025  M.Reset();
1026 
1027  /*
1028  * Dati "permanenti" (uso la posizione del nodo perche'
1029  * non dovrebbero cambiare "molto")
1030  */
1031  doublereal rho, c, p, T;
1032  GetAirProps(Xn, rho, c, p, T); /* p, T no used yet */
1033  aerodata->SetAirData(rho, c);
1034 
1035  ResetIterator();
1036 
1037  integer iNumDof = aerodata->iGetNumDof();
1038  integer iFirstEq = -1;
1039  integer iFirstSubEq = -1;
1040  if (iNumDof > 0) {
1041  iFirstEq = iGetFirstIndex();
1042  iFirstSubEq = 6;
1043 
1044  integer iOffset = iFirstEq - 6;
1045  integer iNumRows = WorkVec.iGetSize();
1046  for (int iCnt = 6 + 1; iCnt <= iNumRows; iCnt++) {
1047  WorkVec.PutRowIndex(iCnt, iOffset + iCnt);
1048  }
1049  }
1050 
1051  /* Ciclo sui punti di Gauss */
1052  PntWght PW = GDI.GetFirst();
1053  int iPnt = 0;
1054  do {
1055  doublereal dCsi = PW.dGetPnt();
1056  Vec3 Xr(Rn*(f + Ra3*(dHalfSpan*dCsi)));
1057  Vec3 Xnr = Xn + Xr;
1058  Vec3 Vr(Vn + Wn.Cross(Xr));
1059 
1060  /* Contributo di velocita' del vento */
1061  Vec3 VTmp(Zero3);
1062  if (fGetAirVelocity(VTmp, Xnr)) {
1063  Vr -= VTmp;
1064  }
1065 
1066  /*
1067  * Se l'elemento e' collegato ad un rotore,
1068  * aggiunge alla velocita' la velocita' indotta
1069  */
1070  if (pIndVel != 0) {
1072  GetLabel(), iPnt, Xnr);
1073  }
1074 
1075  /* Copia i dati nel vettore di lavoro dVAM */
1076  doublereal dTw = Twist.dGet(dCsi) + dGet();
1077  aerodata->SetSectionData(dCsi,
1078  Chord.dGet(dCsi),
1079  ForcePoint.dGet(dCsi),
1080  VelocityPoint.dGet(dCsi),
1081  dTw,
1082  dOmega);
1083 
1084  /*
1085  * Lo svergolamento non viene piu' trattato in aerod2_; quindi
1086  * lo uso per correggere la matrice di rotazione
1087  * dal sistema aerodinamico a quello globale
1088  */
1089  Mat3x3 RRloc;
1090  if (dTw != 0.) {
1091  doublereal dCosT = cos(dTw);
1092  doublereal dSinT = sin(dTw);
1093  /* Assumo lo svergolamento positivo a cabrare */
1094  Mat3x3 RTw( dCosT, dSinT, 0.,
1095  -dSinT, dCosT, 0.,
1096  0., 0., 1.);
1097  RRloc = RR*RTw;
1098 
1099  } else {
1100  RRloc = RR;
1101  }
1102 
1103  /*
1104  * Ruota velocita' e velocita' angolare nel sistema
1105  * aerodinamico e li copia nel vettore di lavoro dW
1106  */
1107  VTmp = RRloc.MulTV(Vr);
1108  VTmp.PutTo(dW);
1109 
1110  Vec3 WTmp = RRloc.MulTV(Wn);
1111  WTmp.PutTo(&dW[3]);
1112 
1113  /* Funzione di calcolo delle forze aerodinamiche */
1114  if (iNumDof) {
1115  aerodata->AssRes(WorkVec, dCoef, XCurr, XPrimeCurr,
1116  iFirstEq, iFirstSubEq, iPnt, dW, dTng, OUTA[iPnt]);
1117 
1118  // first equation
1119  iFirstEq += iNumDof;
1120  iFirstSubEq += iNumDof;
1121 
1122  } else {
1123  aerodata->GetForces(iPnt, dW, dTng, OUTA[iPnt]);
1124  }
1125 
1126  /* Dimensionalizza le forze */
1127  doublereal dWght = dHalfSpan*PW.dGetWght();
1128  dTng[1] *= TipLoss.dGet(dCsi);
1129  Vec3 FTmp(RRloc*(Vec3(&dTng[0])));
1130  Vec3 MTmp(RRloc*(Vec3(&dTng[3])));
1131 
1132  // Se e' definito il rotore, aggiungere il contributo alla trazione
1133  AddSectionalForce_int(iPnt, FTmp, MTmp, dWght, Xnr, RRloc, Vr, Wn);
1134 
1135  FTmp *= dWght;
1136  MTmp *= dWght;
1137 
1138  F += FTmp;
1139  M += MTmp;
1140  M += Xr.Cross(FTmp);
1141 
1142  // specific for Gauss points force output
1143  if (bToBeOutput()) {
1144  SetData(VTmp, dTng, Xr, RRloc, Vr, Wn, FTmp, MTmp);
1145  }
1146 
1147  iPnt++;
1148 
1149  } while (GDI.fGetNext(PW));
1150 
1151  // Se e' definito il rotore, aggiungere il contributo alla trazione
1152  AddForce_int(pNode, F, M, Xn);
1153 
1154  /* Sommare il termine al residuo */
1155  WorkVec.Add(1, F);
1156  WorkVec.Add(4, M);
1157 }
void ResetIterator(void)
Definition: aeroelem.cc:77
virtual void SetSectionData(const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
Definition: aerodata.cc:237
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:760
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
flag fGetNext(doublereal &d, integer i=0) const
Definition: gauss.cc:205
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
PntWght GetFirst(void) const
Definition: gauss.cc:198
doublereal dGet(void) const
Definition: drive.cc:671
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
virtual int GetForces(int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:377
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
virtual Elem::Type GetElemType(void) const =0
virtual integer iGetSize(void) const =0
const Vec3 f
Definition: aeroelem.h:260
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
const Vec3 Ra3
Definition: aeroelem.h:263
const ShapeOwner TipLoss
Definition: aeroelem.h:161
virtual void SetAirData(const doublereal &rho, const doublereal &c)
Definition: aerodata.cc:214
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
doublereal dGetWght(void) const
Definition: gauss.h:56
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
void Reset(void)
Definition: matvec3.cc:109
void PutTo(doublereal *pd) const
Definition: matvec3.h:339
virtual Vec3 GetInducedVelocity(Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const =0
const StructNode * pNode
Definition: aeroelem.h:258
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual doublereal dGet(doublereal d) const
Definition: shape.cc:60
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual doublereal dGetOmega(void) const
Definition: rotor.h:151
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
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
static std::stack< cleanup * > c
Definition: cleanup.cc:59
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)
Definition: aeroelem.cc:92
doublereal dGetPnt(void) const
Definition: gauss.h:55
const Mat3x3 Ra
Definition: aeroelem.h:262
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual flag fGetAirVelocity(Vec3 &Velocity, const Vec3 &X) const
Definition: aerodyn.cc:725
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
void AddForce_int(const StructNode *pN, const Vec3 &F, const Vec3 &M, const Vec3 &X) const
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal dHalfSpan
Definition: aeroelem.h:261
virtual void AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:391
Definition: rotor.h:43
Definition: gauss.h:50

Here is the call graph for this function:

virtual AerodynamicElem::Type AerodynamicBody::GetAerodynamicElemType ( void  ) const
inlinevirtual

Implements AerodynamicElem.

Definition at line 319 of file aeroelem.h.

References AerodynamicElem::AERODYNAMICBODY.

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

Reimplemented from Elem.

Definition at line 329 of file aeroelem.h.

329  {
330  connectedNodes.resize(1);
331  connectedNodes[0] = pNode;
332  };
const StructNode * pNode
Definition: aeroelem.h:258
SubVectorHandler & AerodynamicBody::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 962 of file aeroelem.cc.

References Aerodynamic2DElem< 1 >::aerodata, AssVec(), DEBUGCOUTFNAME, StructDispNode::iGetFirstPositionIndex(), AeroData::iGetNumDof(), pNode, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and Elem::WorkSpaceDim().

964 {
965  DEBUGCOUTFNAME("AerodynamicBody::InitialAssRes");
966 
967  if (aerodata->iGetNumDof() > 0) {
968  WorkVec.ResizeReset(0);
969  return WorkVec;
970  }
971 
972  integer iNumRows;
973  integer iNumCols;
974  WorkSpaceDim(&iNumRows, &iNumCols);
975  WorkVec.ResizeReset(iNumRows);
976 
977  integer iFirstIndex = pNode->iGetFirstPositionIndex();
978  for (int iCnt = 1; iCnt <= 6; iCnt++) {
979  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
980  }
981 
982  AssVec(WorkVec, 1., XCurr, XCurr);
983 
984  return WorkVec;
985 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: aeroelem.cc:990
AeroData * aerodata
Definition: aeroelem.h:153
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructNode * pNode
Definition: aeroelem.h:258
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void AerodynamicBody::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 1164 of file aeroelem.cc.

References AerodynamicOutput::AEROD_OUT_NODE, AerodynamicOutput::AEROD_OUT_PGAUSS, AerodynamicOutput::AEROD_OUT_STD, OutputHandler::AERODYNAMIC, OutputHandler::Aerodynamic(), ASSERT, ToBeOutput::bToBeOutput(), F, Aerodynamic2DElem< 1 >::GDI, WithLabel::GetLabel(), AerodynamicOutput::GetOutput(), NumIntData::iGetNum(), M, Aerodynamic2DElem< 1 >::OUTA, Aerodynamic2DElem< iNN >::Output_int(), AerodynamicOutput::OutputData, pNode, OutputHandler::UseText(), and Vec3::Write().

1165 {
1166  /* Output delle forze aerodinamiche F, M su apposito file */
1167  if (bToBeOutput()) {
1169 
1171  std::ostream& out = OH.Aerodynamic()
1172  << std::setw(8) << GetLabel();
1173 
1174  switch (GetOutput()) {
1175  case AEROD_OUT_NODE:
1176  out << " " << std::setw(8) << pNode->GetLabel()
1177  << " ", F.Write(out, " ") << " ", M.Write(out, " ");
1178  break;
1179 
1180  case AEROD_OUT_PGAUSS:
1181  ASSERT(!OutputData.empty());
1182  for (std::vector<Aero_output>::const_iterator i = OutputData.begin();
1183  i != OutputData.end(); ++i)
1184  {
1185  out << " " << i->alpha
1186  << " " << i->f;
1187  }
1188  break;
1189 
1190  case AEROD_OUT_STD:
1191  for (int i = 0; i < GDI.iGetNum(); i++) {
1192  out
1193  << " " << OUTA[i].alpha
1194  << " " << OUTA[i].gamma
1195  << " " << OUTA[i].mach
1196  << " " << OUTA[i].cl
1197  << " " << OUTA[i].cd
1198  << " " << OUTA[i].cm
1199  << " " << OUTA[i].alf1
1200  << " " << OUTA[i].alf2;
1201  }
1202  break;
1203 
1204  default:
1205  ASSERT(0);
1206  break;
1207  }
1208 
1209  out << std::endl;
1210  } }
1211 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
virtual bool bToBeOutput(void) const
Definition: output.cc:890
AerodynamicOutput::eOutput GetOutput(void) const
Definition: aeroelem.cc:125
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
const StructNode * pNode
Definition: aeroelem.h:258
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
void Output_int(OutputHandler &OH) const
Definition: aeroelem.cc:544
std::vector< Aero_output > OutputData
Definition: aeroelem.h:107
virtual integer iGetNum(void) const
Definition: gauss.h:96
unsigned int GetLabel(void) const
Definition: withlab.cc:62
bool UseText(int out) const
Definition: output.cc:446
std::ostream & Aerodynamic(void) const
Definition: output.h:485

Here is the call graph for this function:

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

Implements Elem.

Definition at line 698 of file aeroelem.cc.

References Aerodynamic2DElem< 1 >::aerodata, Aerodynamic2DElem< 1 >::Chord, DEBUGCOUTFNAME, dHalfSpan, f, Aerodynamic2DElem< 1 >::ForcePoint, Aerodynamic2DElem< 1 >::GDI, WithLabel::GetLabel(), Mat3x3::GetVec(), NumIntData::iGetNum(), DriveOwner::pGetDriveCaller(), ShapeOwner::pGetShape(), Aerodynamic2DElem< 1 >::pIndVel, pNode, Ra, Shape::Restart(), AeroData::Restart(), DriveCaller::Restart(), Aerodynamic2DElem< 1 >::Twist, Aerodynamic2DElem< 1 >::VelocityPoint, Write(), and Vec3::Write().

699 {
700  DEBUGCOUTFNAME("AerodynamicBody::Restart");
701 
702  out << " aerodynamic body: " << GetLabel() << ", "
703  << pNode->GetLabel();
704  if (pIndVel != 0) {
705  out << ", rotor, " << pIndVel->GetLabel();
706  }
707  out << ", reference, node, ", f.Write(out, ", ")
708  << ", " << dHalfSpan*2.
709  << ", reference, node, 1, ", (Ra.GetVec(1)).Write(out, ", ")
710  << ", 2, ", (Ra.GetVec(2)).Write(out, ", ")
711  << ", ";
712  Chord.pGetShape()->Restart(out) << ", ";
713  ForcePoint.pGetShape()->Restart(out) << ", ";
714  VelocityPoint.pGetShape()->Restart(out) << ", ";
715  Twist.pGetShape()->Restart(out) << ", "
716  << ", " << GDI.iGetNum() << ", control, ";
717  pGetDriveCaller()->Restart(out) << ", ";
718  aerodata->Restart(out);
719  return out << ";" << std::endl;
720 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual std::ostream & Restart(std::ostream &out) const =0
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
virtual const Shape * pGetShape(void) const
Definition: shape.cc:72
const Vec3 f
Definition: aeroelem.h:260
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
virtual std::ostream & Restart(std::ostream &out) const =0
virtual std::ostream & Restart(std::ostream &out) const =0
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
const StructNode * pNode
Definition: aeroelem.h:258
GaussDataIterator GDI
Definition: aeroelem.h:163
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
virtual integer iGetNum(void) const
Definition: gauss.h:96
const Mat3x3 Ra
Definition: aeroelem.h:262
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal dHalfSpan
Definition: aeroelem.h:261

Here is the call graph for this function:

Member Data Documentation

doublereal AerodynamicBody::dHalfSpan
protected

Definition at line 261 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

const Vec3 AerodynamicBody::f
protected

Definition at line 260 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

Vec3 AerodynamicBody::F
protected

Definition at line 265 of file aeroelem.h.

Referenced by AssVec(), and Output().

Vec3 AerodynamicBody::M
protected

Definition at line 266 of file aeroelem.h.

Referenced by AssVec(), and Output().

const StructNode* AerodynamicBody::pNode
protected

Definition at line 258 of file aeroelem.h.

Referenced by AerodynamicBody(), AssJac(), AssRes(), AssVec(), InitialAssRes(), Output(), and Restart().

const Mat3x3 AerodynamicBody::Ra
protected

Definition at line 262 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

const Vec3 AerodynamicBody::Ra3
protected

Definition at line 263 of file aeroelem.h.

Referenced by AssJac(), and AssVec().


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