namespace JSBSim {
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGAerodynamics.cpp,v 1.31 2009/11/28 14:30:11 andgi Exp $";
static const char *IdHdr = ID_AERODYNAMICS;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
delete[] Coeff;
- for (i=0; i<variables.size(); i++)
- delete variables[i];
-
delete AeroRPShift;
Debug(1);
bool FGAerodynamics::Run(void)
{
- unsigned int axis_ctr, ctr, i;
+ unsigned int axis_ctr, ctr;
double alpha, twovel;
if (FGModel::Run()) return true;
if (FDMExec->Holding()) return false; // if paused don't execute
+ RunPreFunctions();
+
// calculate some oft-used quantities for speed
twovel = 2*Auxiliary->GetVt();
vFw.InitMatrix();
vFnative.InitMatrix();
- // Tell the variable functions to cache their values, so while the aerodynamic
- // functions are being calculated for each axis, these functions do not get
- // calculated each time, but instead use the values that have already
- // been calculated for this frame.
-
- for (i=0; i<variables.size(); i++) variables[i]->cacheValue(true);
-
for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
for (ctr=0; ctr < Coeff[axis_ctr].size(); ctr++) {
vFnative(axis_ctr+1) += Coeff[axis_ctr][ctr]->GetValue();
}
}
+ RunPostFunctions();
+
return false;
}
document = element;
}
- FGModel::Load(element); // Perform base class Load
+ FGModel::Load(document); // Perform base class Pre-Load
DetermineAxisSystem(); // Detemine if Lift/Side/Drag, etc. is used.
AeroRPShift = new FGFunction(PropertyManager, function_element);
}
- function_element = document->FindElement("function");
- while (function_element) {
- variables.push_back( new FGFunction(PropertyManager, function_element) );
- function_element = document->FindNextElement("function");
- }
-
axis_element = document->FindElement("axis");
while (axis_element) {
CoeffArray ca;
axis_element = document->FindNextElement("axis");
}
+ FGModel::PostLoad(document); // Perform base class Post-Load
+
return true;
}
bool firstime = true;
unsigned int axis, sd;
- for (sd = 0; sd < variables.size(); sd++) {
- if (firstime) {
- firstime = false;
- } else {
- CoeffStrings += delimeter;
- }
- CoeffStrings += variables[sd]->GetName();
- }
-
for (axis = 0; axis < 6; axis++) {
for (sd = 0; sd < Coeff[axis].size(); sd++) {
if (firstime) {
{
ostringstream buf;
- buf.precision(6);
- for (unsigned int sd = 0; sd < variables.size(); sd++) {
- if (buf.tellp() > 0) buf << delimeter;
- buf << setw(9) << variables[sd]->GetValue();
- }
-
for (unsigned int axis = 0; axis < 6; axis++) {
for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) {
if (buf.tellp() > 0) buf << delimeter;