JSBSim Flight Dynamics Model 1.3.3 (16 Oct 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
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
26HISTORY
27--------------------------------------------------------------------------------
2817/11/06 DPC Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGEXTERNALREACTIONS_H
35#define FGEXTERNALREACTIONS_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include <memory>
42#include <vector>
43#include "FGModel.h"
44#include "math/FGColumnVector3.h"
45
46/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47FORWARD DECLARATIONS
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49
50namespace JSBSim {
51
52class Element;
53class FGExternalForce;
54
55/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56CLASS DOCUMENTATION
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58
118/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119CLASS DECLARATION
120%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
121
122class JSBSIM_API FGExternalReactions : public FGModel
123{
124public:
129
133 ~FGExternalReactions(void) override;
134
137 FGExternalReactions& operator=(const FGExternalReactions&) = delete;
138
139 bool InitModel(void) override;
140
148 bool Run(bool Holding) override;
149
156 bool Load(Element* el) override;
157
167 void Add(std::unique_ptr<FGExternalForce> force);
168
172 const FGColumnVector3& GetForces(void) const {return vTotalForces;}
173 double GetForces(int idx) const {return vTotalForces(idx);}
174
178 const FGColumnVector3& GetMoments(void) const {return vTotalMoments;}
179 double GetMoments(int idx) const {return vTotalMoments(idx);}
180
181private:
182
183 std::vector<std::unique_ptr<FGExternalForce>> Forces;
184 //unsigned int numForces;
185 FGColumnVector3 vTotalForces;
186 FGColumnVector3 vTotalMoments;
187
188 void bind(void);
189 void Debug(int from) override;
190};
191}
192//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193#endif
This class implements a 3 element column vector.
Manages the external and/or arbitrary forces and moments.
const FGColumnVector3 & GetMoments(void) const
Retrieves the total moment resulting from the forces defined in the external reactions.
FGExternalReactions(const FGExternalReactions &)=delete
The model owns its forces, so it cannot be copied.
const FGColumnVector3 & GetForces(void) const
Retrieves the total forces defined in the external reactions.
Encapsulates the JSBSim simulation executive.
Definition FGFDMExec.h:185
Base class for all scheduled JSBSim models.
Definition FGModel.h:79
Main namespace for the JSBSim Flight Dynamics Model.
Definition FGFDMExec.cpp:73