53 Name =
"FGBuoyantForces";
57 vTotalForces.InitMatrix();
58 vTotalMoments.InitMatrix();
60 gasCellJ.InitMatrix();
69 for (
unsigned int i=0;
i<Cells.size();
i++)
delete Cells[
i];
81 vTotalForces.InitMatrix();
82 vTotalMoments.InitMatrix();
92 if (Holding)
return false;
93 if (NoneDefined)
return true;
97 vTotalForces.InitMatrix();
98 vTotalMoments.InitMatrix();
100 for (
unsigned int i=0;
i<Cells.size();
i++) {
101 Cells[
i]->Calculate(
FDMExec->GetDeltaT());
102 vTotalForces += Cells[
i]->GetBodyForces();
103 vTotalMoments += Cells[
i]->GetMoments();
123 gas_cell_element = document->
FindElement(
"gas_cell");
124 while (gas_cell_element) {
145 for (
unsigned int i = 0;
i < Cells.size();
i++) {
146 Gw += Cells[
i]->GetMass();
157 for (
unsigned int i = 0;
i < Cells.size();
i++) {
158 vXYZgasCell_arm += Cells[
i]->GetMassMoment();
160 return vXYZgasCell_arm;
167 size_t size = Cells.size();
169 if (size == 0)
return gasCellJ;
173 for (
unsigned int i=0;
i < size;
i++) {
174 gasCellJ += Cells[
i]->GetInertia();
184 string CoeffStrings =
"";
214 string SDValues =
"";
242void FGBuoyantForces::bind(
void)
278void FGBuoyantForces::Debug(
int from)
284 cout << endl <<
" Buoyant Forces: " << endl;
288 if (from == 0) cout <<
"Instantiated: FGBuoyantForces" << endl;
289 if (from == 1) cout <<
"Destroyed: FGBuoyantForces" << 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 the Buoyant forces calculations.
std::string GetBuoyancyStrings(const std::string &delimeter)
Gets the strings for the current set of gas cells.
bool Run(bool Holding) override
Runs the Buoyant forces model; called by the Executive Can pass in a value indicating if the executiv...
double GetGasMass(void) const
Gets the total gas mass.
const FGColumnVector3 & GetForces(void) const
Gets the total Buoyant force vector.
bool InitModel(void) override
bool Load(Element *element) override
Loads the Buoyant forces model.
const FGColumnVector3 & GetGasMassMoment(void)
Gets the total moment from the gas mass.
const FGColumnVector3 & GetMoments(void) const
Gets the total Buoyancy moment vector.
FGBuoyantForces(FGFDMExec *Executive)
Constructor.
const FGMatrix33 & GetGasMassInertia(void)
Gets the total moments of inertia for the gas mass in the body frame.
std::string GetBuoyancyValues(const std::string &delimeter)
Gets the coefficient values.
~FGBuoyantForces() override
Destructor.
This class implements a 3 element column vector.
Handles matrix math operations.
void InitMatrix(void)
Initialize the matrix.
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.