64 pModalNode(pN), pModalJoint(pMJ),
70 pA(pAMat), pB(pBMat), pC(pCMat),
71 pD0(pD0Mat), pD1(pD1Mat), pD2(pD2Mat),
72 pq(0), pqPrime(0), pqSec(0),
75 gustVff(Vff), gustXi(0.707),
144 return out <<
" /* aerodynamic modal: not implemented yet */" << std::endl;
154 DEBUGCOUT(
"Entering AerodynamicModal::AssJac()" << std::endl);
164 for (
unsigned int iCnt = 1; iCnt <=
NStModes; iCnt++) {
212 for (
unsigned int i = 1; i <=
NStModes; i++) {
213 for (
unsigned int j = 1; j <=
NStModes; j++) {
223 for (
unsigned int i = 1; i <=
NStModes; i++) {
225 -dCoef*qd*
pC->operator()(
RigidF + i, j));
227 -dCoef*(2*nV/Chord)*
pB->operator()(j,
RigidF + i));
234 1.*(i == j) - dCoef*(2*nV/Chord)*
pA->operator()(i, j));
239 for (
unsigned int i = 1; i <=
NStModes; i++) {
259 for (
unsigned int i = 0; i <
NGust; i++) {
269 1. + dCoef*2*
gustXi*gustVff);
288 for (
int iCnt = 1; iCnt <=
RigidF; iCnt++) {
316 for (
unsigned int iCnt = 1; iCnt <=
NStModes; iCnt++) {
327 for (
unsigned int iCnt = 1; iCnt <=
NStModes; iCnt++) {
334 for (
unsigned int iCnt = 1; iCnt <=
NAeroStates; iCnt++) {
339 for (
unsigned int iCnt = 1; iCnt <= 2*
NGust; iCnt++) {
363 for (
int iCnt = 1; iCnt <=
RigidF; iCnt++) {
376 if (d > std::numeric_limits<doublereal>::epsilon()) {
396 for (
unsigned int iCnt = 1; iCnt <=
NStModes; iCnt++) {
406 for (
unsigned int iCnt = 1; iCnt <=
NStModes; iCnt++) {
413 for (
unsigned int iCnt = 1; iCnt <=
NAeroStates; iCnt++) {
418 for (
unsigned int iCnt = 1; iCnt <= 2*
NGust; iCnt++) {
465 TmpA.
IncCoef(i,
pB->operator()(i, j)*(
pq->operator()(j)));
482 Tmp.
IncCoef(i,
pD0->operator()(i, j)*(
pq->operator()(j)));
490 Tmp.
IncCoef(i,
pC->operator()(i, j)*(
pxa->operator()(j)));
498 for (
unsigned int i = 1; i <= 3; i++) {
499 F.
Put(i, qd*Tmp(i) + qd1*TmpP(i) + qd2*TmpS(i));
500 M.
Put(i, qd*Tmp(i + 3) + qd1*TmpP(i + 3) + qd2*TmpS(i + 3));
520 WorkVec.
IncCoef(i, qd*Tmp(i) + qd1*TmpP(i) + qd2*TmpS(i));
530 (2*nV/Chord)*
pB->operator()(i, RigidF +
NStModes + 1)*
pgs->operator()(1)
531 + (2*nV/Chord)*
pB->operator()(i, RigidF +
NStModes + 2)*
pgs->operator()(3));
538 for (
unsigned int i = 1; i <= 3; i++) {
541 + qd1*
pD1->operator()(i, RigidF +
NStModes + 1)*
pgs->operator()(2)
542 + qd1*
pD1->operator()(i, RigidF +
NStModes + 2)*
pgs->operator()(4)
546 + qd*
pD0->operator()(i + 3, RigidF +
NStModes + 2)*
pgs->operator()(3)
547 + qd1*
pD1->operator()(i + 3, RigidF +
NStModes + 1)*
pgs->operator()(2)
548 + qd1*
pD1->operator()(i + 3, RigidF +
NStModes + 2)*
pgs->operator()(4)
563 + qd1*
pD1->operator()(i, RigidF +
NStModes + 1)*
pgs->operator()(2)
564 + qd1*
pD1->operator()(i, RigidF +
NStModes + 2)*
pgs->operator()(4)
569 for (
unsigned int i = 0; i <
NGust; i++) {
571 -
pgsPrime->operator()(1 + i*2) +
pgs->operator()(2 + i*2));
599 for (
unsigned int iCnt = 1; iCnt <=
NAeroStates; iCnt++) {
617 DEBUGCOUTFNAME(
"ReadAerodynamicModal(" << uLabel <<
")" << std::endl);
646 unsigned int AeroN = HP.
GetInt();
648 unsigned int NModes = pModalJoint->
uGetNModes();
657 unsigned int GustN = 0;
666 std::ifstream fdat(sFileData);
667 DEBUGCOUT(
"Reading Aerodynamic State Space Matrices from file '"
668 << sFileData <<
'\'' << std::endl);
670 int save_errno = errno;
671 silent_cerr(std::endl <<
"Unable to open file \"" << sFileData <<
"\" "
672 "(" << save_errno <<
": " << strerror(save_errno) <<
")" << std::endl);
694 while (!fdat.eof()) {
695 fdat.getline(str,
sizeof(str));
698 if (!strncmp(
"*** MATRIX A", str,
STRLENOF(
"*** MATRIX A"))) {
699 for (
unsigned int iCnt = 1; iCnt <= AeroN; iCnt++) {
700 for (
unsigned int jCnt = 1; jCnt <= AeroN; jCnt++) {
707 }
else if (!strncmp(
"*** MATRIX B", str,
STRLENOF(
"*** MATRIX B"))) {
708 for (
unsigned int iCnt = 1; iCnt <= AeroN; iCnt++) {
709 for (
unsigned int jCnt = 1; jCnt <= NModes + GustN; jCnt++) {
716 }
else if (!strncmp(
"*** MATRIX C", str,
STRLENOF(
"*** MATRIX C"))) {
717 for (
unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
718 for (
unsigned int jCnt = 1; jCnt <= AeroN; jCnt++) {
725 }
else if (!strncmp(
"*** MATRIX D0", str,
STRLENOF(
"*** MATRIX D0"))) {
726 for (
unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
727 for (
unsigned int jCnt = 1; jCnt <= NModes + GustN; jCnt++) {
729 pD0Mat->
PutCoef(iCnt, jCnt, d);
734 }
else if (!strncmp(
"*** MATRIX D1", str,
STRLENOF(
"*** MATRIX D1"))) {
735 for (
unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
736 for (
unsigned int jCnt = 1; jCnt <= NModes + GustN; jCnt++) {
738 pD1Mat->
PutCoef(iCnt, jCnt, d);
743 }
else if (!strncmp(
"*** MATRIX D2", str,
STRLENOF(
"*** MATRIX D2"))) {
744 for (
unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
745 for (
unsigned int jCnt = 1; jCnt <= NModes + GustN; jCnt++) {
747 pD2Mat->
PutCoef(iCnt, jCnt, d);
760 Ra, pDO, Chord, NModes - rigidF,
761 AeroN, rigidF, GustN, Vff,
762 pAMat, pBMat, pCMat, pD0Mat, pD1Mat, pD2Mat, fOut));
766 silent_cerr(
"semicolon expected at line "
flag fReadOutput(MBDynParser &HP, const T &t) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const ModalNode * pGetModalNode(void) const
Mat3x3 GetRotRel(const ReferenceFrame &rf)
const StructNode * pModalNode
void PutColIndex(integer iSubCol, integer iCol)
const Vec3 Zero3(0., 0., 0.)
void AssVec(SubVectorHandler &WorkVec)
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
virtual bool bToBeOutput(void) const
#define MBDYN_EXCEPT_ARGS
Elem * ReadAerodynamicModal(DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
#define DEBUGCOUTFNAME(fname)
virtual void ResizeReset(integer)
virtual integer GetInt(integer iDefval=0)
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
virtual Node::Type GetNodeType(void) const
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
std::ostream & AeroModals(void) const
virtual VectorHandler & MatVecIncMul(VectorHandler &out, const VectorHandler &in) const
integer uGetNModes(void) const
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
virtual const char * GetFileName(enum Delims Del=DEFAULTDELIM)
virtual void Put(integer iRow, const Vec3 &v)
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
const Modal * pModalJoint
MyVectorHandler * pxaPrime
virtual void PutCoef(integer iRow, const doublereal &dCoef)
Vec3 VecRot(const Mat3x3 &Phi)
Vec3 MulTV(const Vec3 &v) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const ReferenceFrame AbsRefFrame(0, Vec3(0., 0., 0), Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), Vec3(0., 0., 0), Vec3(0., 0., 0), EULER_123)
std::ostream & Restart(std::ostream &out) const
virtual void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
virtual bool IsKeyWord(const char *sKeyWord)
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual integer iGetFirstMomentumIndex(void) const =0
virtual const Vec3 & GetWCurr(void) const
virtual const Vec3 & GetWPCurr(void) const
#define ASSERT(expression)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual const Vec3 & GetXCurr(void) const
virtual void Add(integer iRow, const Vec3 &v)
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &, const VectorHandler &)
virtual void ResizeReset(integer, integer)
void Output(OutputHandler &OH) const
MyVectorHandler * pqPrime
void PutCoef(integer ix, integer iy, const doublereal &val)
integer iGetModalIndex(void) const
AerodynamicModal(unsigned int uLabel, const StructNode *pN, const Modal *pMJ, const Mat3x3 &RaTmp, const DofOwner *pDO, doublereal Cd, const int NModal, const int NAero, RigidF_t rgF, const int Gust, const doublereal Vff, SpMapMatrixHandler *pAMat, FullMatrixHandler *pBMat, FullMatrixHandler *pCMat, FullMatrixHandler *pD0Mat, FullMatrixHandler *pD1Mat, FullMatrixHandler *pD2Mat, flag fout)
void PutRowIndex(integer iSubRow, integer iRow)
MyVectorHandler * pgsPrime
virtual const Vec3 & GetVCurr(void) const
virtual flag fGetAirVelocity(Vec3 &Velocity, const Vec3 &X) const
GradientExpression< UnaryExpr< FuncAtan, Expr > > atan(const GradientExpression< Expr > &u)
virtual const Vec3 & GetXPPCurr(void) const
virtual integer iGetFirstIndex(void) const
virtual HighParser::ErrOut GetLineData(void) const
unsigned int GetLabel(void) const
void Put(unsigned short int iRow, const doublereal &dCoef)
virtual doublereal GetReal(const doublereal &dDefval=0.0)
virtual void IncCoef(integer iRow, const doublereal &dCoef)