69 while (force_element) {
71 Forces.back()->setForce(force_element);
78 while (moment_element) {
80 Forces.back()->setMoment(moment_element);
86 if (!Forces.empty()) bind();
95 for (
unsigned int i=0;
i<Forces.size();
i++)
delete Forces[
i];
106 vTotalForces.InitMatrix();
107 vTotalMoments.InitMatrix();
117 if (Holding)
return false;
118 if (Forces.empty())
return true;
122 vTotalForces.InitMatrix();
123 vTotalMoments.InitMatrix();
125 for (
unsigned int i=0;
i<Forces.size();
i++) {
126 vTotalForces += Forces[
i]->GetBodyForces();
127 vTotalMoments += Forces[
i]->GetMoments();
137void FGExternalReactions::bind(
void)
168void FGExternalReactions::Debug(
int from)
176 cout << endl <<
" External Reactions: " << endl;
180 if (from == 0) cout <<
"Instantiated: FGExternalReactions" << endl;
181 if (from == 1) cout <<
"Destroyed: FGExternalReactions" << endl;
Element * FindElement(const std::string &el="")
Searches for a specified element.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
Encapsulates code that models an individual arbitrary force, moment or a combination thereof.
Manages the external and/or arbitrary forces and moments.
~FGExternalReactions(void) override
Destructor.
FGExternalReactions(FGFDMExec *fdmex)
Constructor.
bool InitModel(void) override
bool Run(bool Holding) override
Sum all the constituent forces for this cycle.
const FGColumnVector3 & GetForces(void) const
Retrieves the total forces defined in the external reactions.
const FGColumnVector3 & GetMoments(void) const
Retrieves the total moment resulting from the forces defined in the external reactions.
bool Load(Element *el) override
Loads the external forces from the XML configuration file.
void RunPostFunctions(void)
void PostLoad(Element *el, FGFDMExec *fdmex, std::string prefix="")
void RunPreFunctions(void)
FGPropertyManager * PropertyManager
bool InitModel(void) override
FGModel(FGFDMExec *)
Constructor.
bool Upload(Element *el, bool preLoad)
Uploads this model in memory.
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
void Tie(const std::string &name, T *pointer)
Tie a property to an external variable.