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

#include <aerodata_impl.h>

Inheritance diagram for C81InterpolatedAeroData:
Collaboration diagram for C81InterpolatedAeroData:

Public Member Functions

 C81InterpolatedAeroData (int i_p, int i_dim, AeroData::UnsteadyModel u, std::vector< unsigned > &p, std::vector< doublereal > &ub, std::vector< const c81_data * > &d, doublereal dcltol, DriveCaller *ptime=0)
 
 ~C81InterpolatedAeroData (void)
 
std::ostream & Restart (std::ostream &out) const
 
void SetSectionData (const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
 
int GetForces (int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
 
int GetForcesJac (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 
- Public Member Functions inherited from AeroData
 AeroData (int i_p, int i_dim, UnsteadyModel u=STEADY, DriveCaller *pt=0)
 
virtual ~AeroData (void)
 
std::ostream & RestartUnsteady (std::ostream &out) const
 
virtual void SetAirData (const doublereal &rho, const doublereal &c)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
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)
 
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)
 
virtual void AfterConvergence (int i, const VectorHandler &X, const VectorHandler &XP)
 
AeroData::UnsteadyModel Unsteady (void) const
 
- Public Member Functions inherited from AeroMemory
 AeroMemory (DriveCaller *pt)
 
virtual ~AeroMemory (void)
 
void Predict (int i, doublereal alpha, doublereal &alf1, doublereal &alf2)
 
void Update (int i)
 
void SetNumPoints (int i)
 
int GetNumPoints (void) const
 

Protected Attributes

std::vector< unsigned > profiles
 
std::vector< doublerealupper_bounds
 
std::vector< const c81_data * > data
 
std::vector< c81_datai_data
 
- Protected Attributes inherited from AeroData
UnsteadyModel unsteadyflag
 
vam_t VAM
 
doublereal Omega
 
- Protected Attributes inherited from AeroMemory
DriveCallerpTime
 

Additional Inherited Members

- Public Types inherited from AeroData
enum  UnsteadyModel { STEADY = 0, HARRIS = 1, BIELAWA = 2, LAST }
 
enum  {
  VX = 0, VY = 1, VZ = 2, WX = 3,
  WY = 4, WZ = 5, FX = 0, FY = 1,
  FZ = 2, MX = 3, MY = 4, MZ = 5
}
 
- Protected Member Functions inherited from AeroData
int StorageSize (void) const
 
int GetForcesJacForwardDiff_int (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 
int GetForcesJacCenteredDiff_int (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 

Detailed Description

Definition at line 121 of file aerodata_impl.h.

Constructor & Destructor Documentation

C81InterpolatedAeroData::C81InterpolatedAeroData ( int  i_p,
int  i_dim,
AeroData::UnsteadyModel  u,
std::vector< unsigned > &  p,
std::vector< doublereal > &  ub,
std::vector< const c81_data * > &  d,
doublereal  dcltol,
DriveCaller ptime = 0 
)

Definition at line 244 of file aerodata_impl.cc.

References ASSERT, c81_data_merge(), data, PntWght::dGetPnt(), GaussDataIterator::fGetNext(), GaussDataIterator::GetFirst(), i_data, MBDYN_EXCEPT_ARGS, profiles, grad::sqrt(), and upper_bounds.

253 : AeroData(i_p, i_dim, u, ptime),
254 profiles(p), upper_bounds(ub), data(d),
255 i_data(i_p*i_dim)
256 {
257  ASSERT(!profiles.empty());
258  ASSERT(!upper_bounds.empty());
259  ASSERT(!data.empty());
260  ASSERT(profiles.size() == upper_bounds.size());
261  ASSERT(profiles.size() == data.size());
262 
263  ASSERT(i_dim >= 1);
264  ASSERT(i_dim <= 3);
265  ASSERT(!i_data.empty());
266 
267  const doublereal bs[3][4] = {
268  { -1., 1. },
269  { -1., 0., 1. },
270  { -1., -1./std::sqrt(3.), 1./std::sqrt(3.), 1. }
271  };
272 
273  int i_point = 0;
274  for (int b = 0; b < i_dim; b++) {
275  GaussDataIterator GDI(i_p);
276  PntWght PW = GDI.GetFirst();
277  do {
278  doublereal dCsi = PW.dGetPnt();
279 
280  doublereal bl = bs[i_dim - 1][b + 1] - bs[i_dim - 1][b];
281  doublereal bm = bs[i_dim - 1][b + 1] + bs[i_dim - 1][b];
282  dCsi = (bm + dCsi*bl)/2.;
283 
284  if (c81_data_merge(data.size(), &data[0], &upper_bounds[0],
285  dCsi, dcltol, &i_data[i_point]))
286  {
287  // function logs error
289  }
290 
291  i_point++;
292  } while (GDI.fGetNext(PW));
293  }
294 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
std::vector< doublereal > upper_bounds
std::vector< c81_data > i_data
std::vector< unsigned > profiles
std::vector< const c81_data * > data
int c81_data_merge(unsigned ndata, const c81_data **data, const doublereal *upper_bounds, doublereal dCsi, doublereal dcltol, c81_data *i_data)
Definition: c81data.cc:396
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
doublereal dGetPnt(void) const
Definition: gauss.h:55
double doublereal
Definition: colamd.c:52
AeroData(int i_p, int i_dim, UnsteadyModel u=STEADY, DriveCaller *pt=0)
Definition: aerodata.cc:181
Definition: gauss.h:50

Here is the call graph for this function:

C81InterpolatedAeroData::~C81InterpolatedAeroData ( void  )

Definition at line 296 of file aerodata_impl.cc.

References c81_data_destroy(), and i_data.

297 {
298  for (unsigned i = 0; i < i_data.size(); i++) {
300  }
301 }
std::vector< c81_data > i_data
void c81_data_destroy(c81_data *data)
Definition: c81data.cc:276

Here is the call graph for this function:

Member Function Documentation

int C81InterpolatedAeroData::GetForces ( int  i,
const doublereal W,
doublereal TNG,
outa_t OUTA 
)
virtual

Reimplemented from AeroData.

Definition at line 330 of file aerodata_impl.cc.

References outa_t::alf1, outa_t::alf2, grad::atan2(), AeroData::BIELAWA, c81_aerod2_u(), AeroData::HARRIS, i_data, AeroMemory::Predict(), AeroData::unsteadyflag, AeroData::VAM, AeroData::VX, and AeroData::VY.

331 {
332 
333  switch (unsteadyflag) {
334  case AeroData::HARRIS:
335  case AeroData::BIELAWA: {
336  Predict(i, atan2(-W[VY], W[VX]), OUTA.alf1, OUTA.alf2);
337  break;
338  }
339 
340  default:
341  break;
342  }
343 
344  return c81_aerod2_u(const_cast<doublereal *>(W), &VAM, TNG, &OUTA,
345  const_cast<c81_data *>(&i_data[i]), unsteadyflag);
346 }
vam_t VAM
Definition: aerodata.h:117
std::vector< c81_data > i_data
doublereal alf1
Definition: aerodc81.h:70
int c81_aerod2_u(doublereal *W, const vam_t *VAM, doublereal *TNG, outa_t *OUTA, c81_data *data, long unsteadyflag)
Definition: aerodc81.c:243
void Predict(int i, doublereal alpha, doublereal &alf1, doublereal &alf2)
Definition: aerodata.cc:65
doublereal alf2
Definition: aerodc81.h:71
UnsteadyModel unsteadyflag
Definition: aerodata.h:116
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962

Here is the call graph for this function:

int C81InterpolatedAeroData::GetForcesJac ( int  i,
const doublereal W,
doublereal TNG,
Mat6x6 J,
outa_t OUTA 
)
virtual

Reimplemented from AeroData.

Definition at line 349 of file aerodata_impl.cc.

References AeroData::GetForcesJacForwardDiff_int().

350 {
351  return AeroData::GetForcesJacForwardDiff_int(i, W, TNG, J, OUTA);
352 }
int GetForcesJacForwardDiff_int(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:271

Here is the call graph for this function:

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

Implements AeroData.

Definition at line 304 of file aerodata_impl.cc.

References profiles, AeroData::RestartUnsteady(), and upper_bounds.

305 {
306  out << "C81, interpolated";
307  for (unsigned i = 0; i < profiles.size(); i++) {
308  out << ", " << profiles[i] << ", " << upper_bounds[i];
309  }
310 
311  return RestartUnsteady(out);
312 }
std::ostream & RestartUnsteady(std::ostream &out) const
Definition: aerodata.cc:252
std::vector< doublereal > upper_bounds
std::vector< unsigned > profiles

Here is the call graph for this function:

void C81InterpolatedAeroData::SetSectionData ( const doublereal abscissa,
const doublereal chord,
const doublereal forcepoint,
const doublereal velocitypoint,
const doublereal twist,
const doublereal omega = 0. 
)
virtual

Reimplemented from AeroData.

Definition at line 315 of file aerodata_impl.cc.

References ASSERT, and AeroData::SetSectionData().

322 {
323  ASSERT(abscissa >= -1. && abscissa <= 1.);
324 
325  AeroData::SetSectionData(abscissa, chord, forcepoint, velocitypoint,
326  twist, omega);
327 }
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
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

Member Data Documentation

std::vector<const c81_data *> C81InterpolatedAeroData::data
protected

Definition at line 125 of file aerodata_impl.h.

Referenced by C81InterpolatedAeroData().

std::vector<c81_data> C81InterpolatedAeroData::i_data
protected

Definition at line 127 of file aerodata_impl.h.

Referenced by C81InterpolatedAeroData(), GetForces(), and ~C81InterpolatedAeroData().

std::vector<unsigned> C81InterpolatedAeroData::profiles
protected

Definition at line 123 of file aerodata_impl.h.

Referenced by C81InterpolatedAeroData(), and Restart().

std::vector<doublereal> C81InterpolatedAeroData::upper_bounds
protected

Definition at line 124 of file aerodata_impl.h.

Referenced by C81InterpolatedAeroData(), and Restart().


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