]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/FGAerodynamics.cpp
Andreas Gaeb: fix #222 (JSBSIm reset problems)
[flightgear.git] / src / FDM / JSBSim / models / FGAerodynamics.cpp
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Module:       FGAerodynamics.cpp
4  Author:       Jon S. Berndt
5  Date started: 09/13/00
6  Purpose:      Encapsulates the aerodynamic forces
7
8  ------------- Copyright (C) 2000  Jon S. Berndt (jon@jsbsim.org) -------------
9
10  This program is free software; you can redistribute it and/or modify it under
11  the terms of the GNU Lesser General Public License as published by the Free Software
12  Foundation; either version 2 of the License, or (at your option) any later
13  version.
14
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
18  details.
19
20  You should have received a copy of the GNU Lesser General Public License along with
21  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22  Place - Suite 330, Boston, MA  02111-1307, USA.
23
24  Further information about the GNU Lesser General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26
27 FUNCTIONAL DESCRIPTION
28 --------------------------------------------------------------------------------
29
30 HISTORY
31 --------------------------------------------------------------------------------
32 09/13/00   JSB   Created
33 04/22/01   JSB   Moved code into here from FGAircraft
34
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 INCLUDES
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
38
39 #include <iostream>
40 #include <sstream>
41 #include <iomanip>
42 #include <cstdlib>
43 #include <FGFDMExec.h>
44 #include "FGAerodynamics.h"
45 #include "FGPropagate.h"
46 #include "FGAircraft.h"
47 #include "FGAuxiliary.h"
48 #include "FGMassBalance.h"
49 #include "input_output/FGPropertyManager.h"
50
51 using namespace std;
52
53 namespace JSBSim {
54
55 static const char *IdSrc = "$Id: FGAerodynamics.cpp,v 1.36 2011/01/19 12:41:19 jberndt Exp $";
56 static const char *IdHdr = ID_AERODYNAMICS;
57
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 CLASS IMPLEMENTATION
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61
62
63 FGAerodynamics::FGAerodynamics(FGFDMExec* FDMExec) : FGModel(FDMExec)
64 {
65   Name = "FGAerodynamics";
66
67   AxisIdx["DRAG"]   = 0;
68   AxisIdx["SIDE"]   = 1;
69   AxisIdx["LIFT"]   = 2;
70   AxisIdx["ROLL"]   = 3;
71   AxisIdx["PITCH"]  = 4;
72   AxisIdx["YAW"]    = 5;
73
74   AxisIdx["AXIAL"]  = 0;
75   AxisIdx["NORMAL"] = 2;
76
77   AxisIdx["X"] = 0;
78   AxisIdx["Y"] = 1;
79   AxisIdx["Z"] = 2;
80
81   axisType = atNone;
82
83   Coeff = new CoeffArray[6];
84
85   impending_stall = stall_hyst = 0.0;
86   alphaclmin = alphaclmax = 0.0;
87   alphahystmin = alphahystmax = 0.0;
88   clsq = lod = 0.0;
89   alphaw = 0.0;
90   bi2vel = ci2vel = 0.0;
91   AeroRPShift = 0;
92   vDeltaRP.InitMatrix();
93
94   bind();
95
96   Debug(0);
97 }
98
99 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100
101 FGAerodynamics::~FGAerodynamics()
102 {
103   unsigned int i,j;
104
105   for (i=0; i<6; i++)
106     for (j=0; j<Coeff[i].size(); j++)
107       delete Coeff[i][j];
108
109   delete[] Coeff;
110
111   delete AeroRPShift;
112
113   Debug(1);
114 }
115
116 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117
118 bool FGAerodynamics::InitModel(void)
119 {
120   if (!FGModel::InitModel()) return false;
121
122   impending_stall = stall_hyst = 0.0;
123   alphaclmin = alphaclmax = 0.0;
124   alphahystmin = alphahystmax = 0.0;
125   clsq = lod = 0.0;
126   alphaw = 0.0;
127   bi2vel = ci2vel = 0.0;
128   AeroRPShift = 0;
129   vDeltaRP.InitMatrix();
130
131   return true;
132 }
133 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134
135 bool FGAerodynamics::Run(void)
136 {
137
138   if (FGModel::Run()) return true;
139   if (FDMExec->Holding()) return false; // if paused don't execute
140
141   unsigned int axis_ctr, ctr;
142   const double alpha=FDMExec->GetAuxiliary()->Getalpha();
143   const double twovel=2*FDMExec->GetAuxiliary()->GetVt();
144   const double qbar = FDMExec->GetAuxiliary()->Getqbar();
145   const double wingarea = FDMExec->GetAircraft()->GetWingArea();
146   const double wingspan = FDMExec->GetAircraft()->GetWingSpan();
147   const double wingchord = FDMExec->GetAircraft()->Getcbar();
148   const double wingincidence = FDMExec->GetAircraft()->GetWingIncidence();
149   RunPreFunctions();
150
151   // calculate some oft-used quantities for speed
152
153   if (twovel != 0) {
154     bi2vel = wingspan / twovel;
155     ci2vel = wingchord / twovel;
156   }
157   alphaw = alpha + wingincidence;
158   qbar_area = wingarea * qbar;
159
160   if (alphaclmax != 0) {
161     if (alpha > 0.85*alphaclmax) {
162       impending_stall = 10*(alpha/alphaclmax - 0.85);
163     } else {
164       impending_stall = 0;
165     }
166   }
167
168   if (alphahystmax != 0.0 && alphahystmin != 0.0) {
169     if (alpha > alphahystmax) {
170        stall_hyst = 1;
171     } else if (alpha < alphahystmin) {
172        stall_hyst = 0;
173     }
174   }
175
176   vFw.InitMatrix();
177   vFnative.InitMatrix();
178
179   for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
180     for (ctr=0; ctr < Coeff[axis_ctr].size(); ctr++) {
181       vFnative(axis_ctr+1) += Coeff[axis_ctr][ctr]->GetValue();
182     }
183   }
184
185   // Note that we still need to convert to wind axes here, because it is
186   // used in the L/D calculation, and we still may want to look at Lift
187   // and Drag.
188
189   switch (axisType) {
190     case atBodyXYZ:       // Forces already in body axes; no manipulation needed
191       vFw = GetTb2w()*vFnative;
192       vForces = vFnative;
193       break;
194     case atLiftDrag:      // Copy forces into wind axes
195       vFw = vFnative;
196       vFw(eDrag)*=-1; vFw(eLift)*=-1;
197       vForces = GetTw2b()*vFw;
198       break;
199     case atAxialNormal:   // Convert native forces into Axial|Normal|Side system
200       vFw = GetTb2w()*vFnative;
201       vFnative(eX)*=-1; vFnative(eZ)*=-1;
202       vForces = vFnative;
203       break;
204     default:
205       cerr << endl << "  A proper axis type has NOT been selected. Check "
206                    << "your aerodynamics definition." << endl;
207       exit(-1);
208   }
209
210   // Calculate aerodynamic reference point shift, if any
211   if (AeroRPShift) vDeltaRP(eX) = AeroRPShift->GetValue()*wingchord*12.0;
212
213   // Calculate lift coefficient squared
214   if ( qbar > 0) {
215     clsq = vFw(eLift) / (wingarea*qbar);
216     clsq *= clsq;
217   }
218
219   // Calculate lift Lift over Drag
220   if ( fabs(vFw(eDrag)) > 0.0) lod = fabs( vFw(eLift) / vFw(eDrag) );
221
222   vDXYZcg = FDMExec->GetMassBalance()->StructuralToBody(FDMExec->GetAircraft()->GetXYZrp() + vDeltaRP);
223
224   vMoments = vDXYZcg*vForces; // M = r X F
225
226   for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
227     for (ctr = 0; ctr < Coeff[axis_ctr+3].size(); ctr++) {
228       vMoments(axis_ctr+1) += Coeff[axis_ctr+3][ctr]->GetValue();
229     }
230   }
231
232   RunPostFunctions();
233
234   return false;
235 }
236
237 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238 //
239 // From Stevens and Lewis, "Aircraft Control and Simulation", 3rd Ed., the
240 // transformation from body to wind axes is defined (where "a" is alpha and "B"
241 // is beta):
242 //
243 //   cos(a)*cos(B)     sin(B)    sin(a)*cos(B)
244 //  -cos(a)*sin(B)     cos(B)   -sin(a)*sin(B)
245 //  -sin(a)              0       cos(a)
246 //
247 // The transform from wind to body axes is then,
248 //
249 //   cos(a)*cos(B)  -cos(a)*sin(B)  -sin(a)
250 //          sin(B)          cos(B)     0
251 //   sin(a)*cos(B)  -sin(a)*sin(B)   cos(a)
252
253 FGMatrix33& FGAerodynamics::GetTw2b(void)
254 {
255   double ca, cb, sa, sb;
256
257   double alpha = FDMExec->GetAuxiliary()->Getalpha();
258   double beta  = FDMExec->GetAuxiliary()->Getbeta();
259
260   ca = cos(alpha);
261   sa = sin(alpha);
262   cb = cos(beta);
263   sb = sin(beta);
264
265   mTw2b(1,1) =  ca*cb;
266   mTw2b(1,2) = -ca*sb;
267   mTw2b(1,3) = -sa;
268   mTw2b(2,1) =  sb;
269   mTw2b(2,2) =  cb;
270   mTw2b(2,3) =  0.0;
271   mTw2b(3,1) =  sa*cb;
272   mTw2b(3,2) = -sa*sb;
273   mTw2b(3,3) =  ca;
274
275   return mTw2b;
276 }
277
278 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279
280 FGMatrix33& FGAerodynamics::GetTb2w(void)
281 {
282   double alpha,beta;
283   double ca, cb, sa, sb;
284
285   alpha = FDMExec->GetAuxiliary()->Getalpha();
286   beta  = FDMExec->GetAuxiliary()->Getbeta();
287
288   ca = cos(alpha);
289   sa = sin(alpha);
290   cb = cos(beta);
291   sb = sin(beta);
292
293   mTb2w(1,1) = ca*cb;
294   mTb2w(1,2) = sb;
295   mTb2w(1,3) = sa*cb;
296   mTb2w(2,1) = -ca*sb;
297   mTb2w(2,2) = cb;
298   mTb2w(2,3) = -sa*sb;
299   mTb2w(3,1) = -sa;
300   mTb2w(3,2) = 0.0;
301   mTb2w(3,3) = ca;
302
303   return mTb2w;
304 }
305
306 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
307
308 bool FGAerodynamics::Load(Element *element)
309 {
310   string parameter, axis, scratch;
311   string scratch_unit="";
312   string fname="", file="";
313   Element *temp_element, *axis_element, *function_element;
314
315   string separator = "/";
316
317   fname = element->GetAttributeValue("file");
318   if (!fname.empty()) {
319     file = FDMExec->GetFullAircraftPath() + separator + fname;
320     document = LoadXMLDocument(file);
321   } else {
322     document = element;
323   }
324
325   FGModel::Load(document); // Perform base class Pre-Load
326
327   DetermineAxisSystem(); // Detemine if Lift/Side/Drag, etc. is used.
328
329   Debug(2);
330
331   if ((temp_element = document->FindElement("alphalimits"))) {
332     scratch_unit = temp_element->GetAttributeValue("unit");
333     if (scratch_unit.empty()) scratch_unit = "RAD";
334     alphaclmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "RAD");
335     alphaclmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "RAD");
336   }
337
338   if ((temp_element = document->FindElement("hysteresis_limits"))) {
339     scratch_unit = temp_element->GetAttributeValue("unit");
340     if (scratch_unit.empty()) scratch_unit = "RAD";
341     alphahystmin = temp_element->FindElementValueAsNumberConvertFromTo("min", scratch_unit, "RAD");
342     alphahystmax = temp_element->FindElementValueAsNumberConvertFromTo("max", scratch_unit, "RAD");
343   }
344
345   if ((temp_element = document->FindElement("aero_ref_pt_shift_x"))) {
346     function_element = temp_element->FindElement("function");
347     AeroRPShift = new FGFunction(PropertyManager, function_element);
348   }
349
350   axis_element = document->FindElement("axis");
351   while (axis_element) {
352     CoeffArray ca;
353     axis = axis_element->GetAttributeValue("name");
354     function_element = axis_element->FindElement("function");
355     while (function_element) {
356       string current_func_name = function_element->GetAttributeValue("name");
357       try {
358         ca.push_back( new FGFunction(PropertyManager, function_element) );
359       } catch (string const str) {
360         cerr << endl << fgred << "Error loading aerodynamic function in " 
361              << current_func_name << ":" << str << " Aborting." << reset << endl;
362         return false;
363       }
364       function_element = axis_element->FindNextElement("function");
365     }
366     Coeff[AxisIdx[axis]] = ca;
367     axis_element = document->FindNextElement("axis");
368   }
369
370   PostLoad(document, PropertyManager); // Perform base class Post-Load
371
372   return true;
373 }
374
375 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376 //
377 // This private class function checks to verify consistency in the choice of
378 // aerodynamic axes used in the config file. One set of LIFT|DRAG|SIDE, or 
379 // X|Y|Z, or AXIAL|NORMAL|SIDE must be chosen; mixed system axes are not allowed.
380 // Note that if the "SIDE" axis specifier is entered first in a config file, 
381 // a warning message will be given IF the AXIAL|NORMAL specifiers are also given.
382 // This is OK, and the warning is due to the SIDE specifier used for both
383 // the Lift/Drag and Axial/Normal axis systems.
384
385 void FGAerodynamics::DetermineAxisSystem()
386 {
387   Element* axis_element = document->FindElement("axis");
388   string axis;
389   while (axis_element) {
390     axis = axis_element->GetAttributeValue("name");
391     if (axis == "LIFT" || axis == "DRAG") {
392       if (axisType == atNone) axisType = atLiftDrag;
393       else if (axisType != atLiftDrag) {
394         cerr << endl << "  Mixed aerodynamic axis systems have been used in the"
395                      << " aircraft config file. (LIFT DRAG)" << endl;
396       }
397     } else if (axis == "SIDE") {
398       if (axisType != atNone && axisType != atLiftDrag && axisType != atAxialNormal) {
399         cerr << endl << "  Mixed aerodynamic axis systems have been used in the"
400                      << " aircraft config file. (SIDE)" << endl;
401       }
402     } else if (axis == "AXIAL" || axis == "NORMAL") {
403       if (axisType == atNone) axisType = atAxialNormal;
404       else if (axisType != atAxialNormal) {
405         cerr << endl << "  Mixed aerodynamic axis systems have been used in the"
406                      << " aircraft config file. (NORMAL AXIAL)" << endl;
407       }
408     } else if (axis == "X" || axis == "Y" || axis == "Z") {
409       if (axisType == atNone) axisType = atBodyXYZ;
410       else if (axisType != atBodyXYZ) {
411         cerr << endl << "  Mixed aerodynamic axis systems have been used in the"
412                      << " aircraft config file. (XYZ)" << endl;
413       }
414     } else if (axis != "ROLL" && axis != "PITCH" && axis != "YAW") { // error
415       cerr << endl << "  An unknown axis type, " << axis << " has been specified"
416                    << " in the aircraft configuration file." << endl;
417       exit(-1);
418     }
419     axis_element = document->FindNextElement("axis");
420   }
421   if (axisType == atNone) {
422     axisType = atLiftDrag;
423     cerr << endl << "  The aerodynamic axis system has been set by default"
424                  << " to the Lift/Side/Drag system." << endl;
425   }
426 }
427
428 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429
430 string FGAerodynamics::GetCoefficientStrings(const string& delimeter) const
431 {
432   string CoeffStrings = "";
433   bool firstime = true;
434   unsigned int axis, sd;
435
436   for (axis = 0; axis < 6; axis++) {
437     for (sd = 0; sd < Coeff[axis].size(); sd++) {
438       if (firstime) {
439         firstime = false;
440       } else {
441         CoeffStrings += delimeter;
442       }
443       CoeffStrings += Coeff[axis][sd]->GetName();
444     }
445   }
446   return CoeffStrings;
447 }
448
449 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
450
451 string FGAerodynamics::GetCoefficientValues(const string& delimeter) const
452 {
453   ostringstream buf;
454
455   for (unsigned int axis = 0; axis < 6; axis++) {
456     for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) {
457       if (buf.tellp() > 0) buf << delimeter;
458       buf << setw(9) << Coeff[axis][sd]->GetValue();
459     }
460   }
461
462   return buf.str();
463 }
464
465 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466
467 void FGAerodynamics::bind(void)
468 {
469   typedef double (FGAerodynamics::*PMF)(int) const;
470
471   PropertyManager->Tie("forces/fbx-aero-lbs", this,1,
472                        (PMF)&FGAerodynamics::GetForces);
473   PropertyManager->Tie("forces/fby-aero-lbs", this,2,
474                        (PMF)&FGAerodynamics::GetForces);
475   PropertyManager->Tie("forces/fbz-aero-lbs", this,3,
476                        (PMF)&FGAerodynamics::GetForces);
477   PropertyManager->Tie("moments/l-aero-lbsft", this,1,
478                        (PMF)&FGAerodynamics::GetMoments);
479   PropertyManager->Tie("moments/m-aero-lbsft", this,2,
480                        (PMF)&FGAerodynamics::GetMoments);
481   PropertyManager->Tie("moments/n-aero-lbsft", this,3,
482                        (PMF)&FGAerodynamics::GetMoments);
483   PropertyManager->Tie("forces/fwx-aero-lbs", this,1,
484                        (PMF)&FGAerodynamics::GetvFw);
485   PropertyManager->Tie("forces/fwy-aero-lbs", this,2,
486                        (PMF)&FGAerodynamics::GetvFw);
487   PropertyManager->Tie("forces/fwz-aero-lbs", this,3,
488                        (PMF)&FGAerodynamics::GetvFw);
489   PropertyManager->Tie("forces/lod-norm", this,
490                        &FGAerodynamics::GetLoD);
491   PropertyManager->Tie("aero/cl-squared", this,
492                        &FGAerodynamics::GetClSquared);
493   PropertyManager->Tie("aero/qbar-area", &qbar_area);
494   PropertyManager->Tie("aero/alpha-max-rad", this,
495                        &FGAerodynamics::GetAlphaCLMax,
496                        &FGAerodynamics::SetAlphaCLMax,
497                        true);
498   PropertyManager->Tie("aero/alpha-min-rad", this,
499                        &FGAerodynamics::GetAlphaCLMin,
500                        &FGAerodynamics::SetAlphaCLMin,
501                        true);
502   PropertyManager->Tie("aero/bi2vel", this,
503                        &FGAerodynamics::GetBI2Vel);
504   PropertyManager->Tie("aero/ci2vel", this,
505                        &FGAerodynamics::GetCI2Vel);
506   PropertyManager->Tie("aero/alpha-wing-rad", this,
507                        &FGAerodynamics::GetAlphaW);
508   PropertyManager->Tie("systems/stall-warn-norm", this,
509                         &FGAerodynamics::GetStallWarn);
510   PropertyManager->Tie("aero/stall-hyst-norm", this,
511                         &FGAerodynamics::GetHysteresisParm);
512 }
513
514 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515 //    The bitmasked value choices are as follows:
516 //    unset: In this case (the default) JSBSim would only print
517 //       out the normally expected messages, essentially echoing
518 //       the config files as they are read. If the environment
519 //       variable is not set, debug_lvl is set to 1 internally
520 //    0: This requests JSBSim not to output any messages
521 //       whatsoever.
522 //    1: This value explicity requests the normal JSBSim
523 //       startup messages
524 //    2: This value asks for a message to be printed out when
525 //       a class is instantiated
526 //    4: When this value is set, a message is displayed when a
527 //       FGModel object executes its Run() method
528 //    8: When this value is set, various runtime state variables
529 //       are printed out periodically
530 //    16: When set various parameters are sanity checked and
531 //       a message is printed out when they go out of bounds
532
533 void FGAerodynamics::Debug(int from)
534 {
535   if (debug_lvl <= 0) return;
536
537   if (debug_lvl & 1) { // Standard console startup message output
538     if (from == 2) { // Loader
539       switch (axisType) {
540         case (atLiftDrag):
541           cout << endl << "  Aerodynamics (Lift|Side|Drag axes):" << endl << endl;
542           break;
543         case (atAxialNormal):
544           cout << endl << "  Aerodynamics (Axial|Side|Normal axes):" << endl << endl;
545           break;
546         case (atBodyXYZ):
547           cout << endl << "  Aerodynamics (X|Y|Z axes):" << endl << endl;
548           break;
549       case (atNone):
550           cout << endl << "  Aerodynamics (undefined axes):" << endl << endl;
551           break;
552       }
553     }
554   }
555   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
556     if (from == 0) cout << "Instantiated: FGAerodynamics" << endl;
557     if (from == 1) cout << "Destroyed:    FGAerodynamics" << endl;
558   }
559   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
560   }
561   if (debug_lvl & 8 ) { // Runtime state variables
562   }
563   if (debug_lvl & 16) { // Sanity checking
564   }
565   if (debug_lvl & 64) {
566     if (from == 0) { // Constructor
567       cout << IdSrc << endl;
568       cout << IdHdr << endl;
569     }
570   }
571 }
572
573 } // namespace JSBSim