JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGExternalReactions.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGExternalReactions.h
4  Author: David P. Culp
5  Date started: 17/11/06
6 
7  ------------- Copyright (C) 2006 David P. Culp (daveculp@cox.net) -------------
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 HISTORY
27 --------------------------------------------------------------------------------
28 17/11/06 DPC Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGEXTERNALREACTIONS_H
35 #define FGEXTERNALREACTIONS_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include <vector>
42 #include "FGModel.h"
43 #include "math/FGColumnVector3.h"
44 
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 FORWARD DECLARATIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48 
49 namespace JSBSim {
50 
51 class Element;
52 class FGExternalForce;
53 
54 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 CLASS DOCUMENTATION
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57 
117 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 CLASS DECLARATION
119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
120 
122 {
123 public:
128 
133  ~FGExternalReactions(void) override;
134 
135  bool InitModel(void) override;
136 
144  bool Run(bool Holding) override;
145 
152  bool Load(Element* el) override;
153 
157  const FGColumnVector3& GetForces(void) const {return vTotalForces;}
158  double GetForces(int idx) const {return vTotalForces(idx);}
159 
163  const FGColumnVector3& GetMoments(void) const {return vTotalMoments;}
164  double GetMoments(int idx) const {return vTotalMoments(idx);}
165 
166 private:
167 
168  std::vector <FGExternalForce*> Forces;
169  //unsigned int numForces;
170  FGColumnVector3 vTotalForces;
171  FGColumnVector3 vTotalMoments;
172 
173  void bind(void);
174  void Debug(int from) override;
175 };
176 }
177 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178 #endif
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGExternalReactions::Load
bool Load(Element *el) override
Loads the external forces from the XML configuration file.
Definition: FGExternalReactions.cpp:58
JSBSim::FGColumnVector3
This class implements a 3 element column vector.
Definition: FGColumnVector3.h:63
JSBSim::FGExternalReactions
Manages the external and/or arbitrary forces and moments.
Definition: FGExternalReactions.h:121
JSBSim::FGModel
Base class for all scheduled JSBSim models.
Definition: FGModel.h:68
JSBSim::FGExternalReactions::GetMoments
const FGColumnVector3 & GetMoments(void) const
Retrieves the total moment resulting from the forces defined in the external reactions.
Definition: FGExternalReactions.h:163
JSBSim::FGExternalReactions::FGExternalReactions
FGExternalReactions(FGFDMExec *fdmex)
Constructor.
Definition: FGExternalReactions.cpp:51
JSBSim::FGExternalReactions::GetForces
const FGColumnVector3 & GetForces(void) const
Retrieves the total forces defined in the external reactions.
Definition: FGExternalReactions.h:157
JSBSim::FGExternalReactions::Run
bool Run(bool Holding) override
Sum all the constituent forces for this cycle.
Definition: FGExternalReactions.cpp:114
JSBSim::FGExternalReactions::~FGExternalReactions
~FGExternalReactions(void) override
Destructor.
Definition: FGExternalReactions.cpp:93
JSBSim::Element
Definition: FGXMLElement.h:143