JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGExternalForce.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGExternalForce.h
4  Author: Jon Berndt, Dave Culp
5  Date started: 9/21/07
6 
7  ------------- Copyright (C) 2007 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 
27  HISTORY
28 --------------------------------------------------------------------------------
29 9/21/07 JB Created
30 
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 SENTRY
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
34 
35 #ifndef FGEXTERNALFORCE_H
36 #define FGEXTERNALFORCE_H
37 
38 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 INCLUDES
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41 
42 #include <string>
43 #include "FGFDMExec.h"
44 #include "FGJSBBase.h"
45 #include "models/propulsion/FGForce.h"
46 #include "input_output/FGPropertyManager.h"
47 #include "math/FGColumnVector3.h"
48 #include "math/FGFunction.h"
49 
50 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 DEFINITIONS
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53 
54 #define ID_EXTERNALFORCE "$Id: FGExternalForce.h,v 1.13 2014/11/25 01:44:17 dpculp Exp $"
55 
56 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 FORWARD DECLARATIONS
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59 
60 namespace JSBSim {
61 
62 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 CLASS DOCUMENTATION
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
65 
136 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 CLASS DECLARATION
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
139 
140 class FGExternalForce : public FGForce
141 {
142 public:
146  FGExternalForce(FGFDMExec *FDMExec);
147 
153  FGExternalForce(FGFDMExec *FDMExec, Element *el, int index);
154 
158  FGExternalForce(const FGExternalForce& extForce);
159 
162 
163  void SetMagnitude(double mag);
164  void SetAzimuth(double az) {azimuth = az;}
165 
166  const FGColumnVector3& GetBodyForces(void);
167  double GetMagnitude(void) const {return magnitude;}
168  double GetAzimuth(void) const {return azimuth;}
169  double GetX(void) const {return vDirection(eX);}
170  double GetY(void) const {return vDirection(eY);}
171  double GetZ(void) const {return vDirection(eZ);}
172  void SetX(double x) {vDirection(eX) = x;}
173  void SetY(double y) {vDirection(eY) = y;}
174  void SetZ(double z) {vDirection(eZ) = z;}
175  double GetLocX(void) const {return vActingXYZn(eX);}
176  double GetLocY(void) const {return vActingXYZn(eY);}
177  double GetLocZ(void) const {return vActingXYZn(eZ);}
178  void SetLocX(double x) {vXYZn(eX) = x; vActingXYZn(eX) = x;}
179  void SetLocY(double y) {vXYZn(eY) = y; vActingXYZn(eY) = y;}
180  void SetLocZ(double z) {vXYZn(eZ) = z; vActingXYZn(eZ) = z;}
181 
182 private:
183 
184  std::string Frame;
185  std::string Name;
186  FGFunction* Magnitude_Function;
187  FGColumnVector3 vDirection;
188  double magnitude;
189  double azimuth;
190  void Debug(int from);
191 };
192 }
193 #endif
194 
Encapsulates code that models an individual arbitrary force.
Represents a mathematical function.
Definition: FGFunction.h:699
This class implements a 3 element column vector.
FGExternalForce(FGFDMExec *FDMExec)
Constructor.
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
Utility class that aids in the conversion of forces between coordinate systems and calculation of mom...
Definition: FGForce.h:225