Initialize mass marker and gravity so that they don't need to be defined in assembly.

This commit is contained in:
Paddle
2023-10-05 13:47:45 +02:00
parent 0c16154c22
commit 73f9877779
5 changed files with 8 additions and 7 deletions

View File

@@ -105,7 +105,7 @@ namespace MbD {
std::shared_ptr<std::vector<std::shared_ptr<ASMTJoint>>> joints = std::make_shared<std::vector<std::shared_ptr<ASMTJoint>>>();
std::shared_ptr<std::vector<std::shared_ptr<ASMTMotion>>> motions = std::make_shared<std::vector<std::shared_ptr<ASMTMotion>>>();
std::shared_ptr<std::vector<std::shared_ptr<ASMTForceTorque>>> forcesTorques = std::make_shared<std::vector<std::shared_ptr<ASMTForceTorque>>>();
std::shared_ptr<ASMTConstantGravity> constantGravity;
std::shared_ptr<ASMTConstantGravity> constantGravity = std::make_shared<ASMTConstantGravity>();
std::shared_ptr<ASMTSimulationParameters> simulationParameters;
std::shared_ptr<ASMTAnimationParameters> animationParameters;
std::shared_ptr<std::vector<double>> times;

View File

@@ -25,7 +25,7 @@ namespace MbD {
void setg(double a, double b, double c);
FColDsptr g;
FColDsptr g = std::make_shared<FullColumn<double>>(ListD{ 0.,0.,0. });
};
}

View File

@@ -23,8 +23,9 @@ namespace MbD {
// Overloads to simplify syntax.
void setMomentOfInertias(double a, double b, double c);
double mass, density;
DiagMatDsptr momentOfInertias;
double mass = 0.0;
double density = 0.0;
DiagMatDsptr momentOfInertias = std::make_shared<DiagonalMatrix<double>>(ListD{ 0.,0.,0. });
};
}

View File

@@ -13,7 +13,7 @@
#include "ASMTRefPoint.h"
#include "ASMTRefCurve.h"
#include "ASMTRefSurface.h"
#include "ASMTPrincipalMassMarker.h"
//#include "ASMTPrincipalMassMarker.h"
using namespace MbD;

View File

@@ -12,7 +12,7 @@
//#include "ASMTRefPoint.h"
//#include "ASMTRefCurve.h"
//#include "ASMTRefSurface.h"
//#include "ASMTPrincipalMassMarker.h"
#include "ASMTPrincipalMassMarker.h"
//#include "Units.h"
//#include "ASMTPart.h"
//#include "ASMTJoint.h"
@@ -80,7 +80,7 @@ namespace MbD {
FRowDsptr inxs, inys, inzs, inbryxs, inbryys, inbryzs;
FRowDsptr invxs, invys, invzs, inomexs, inomeys, inomezs;
FRowDsptr inaxs, inays, inazs, inalpxs, inalpys, inalpzs;
std::shared_ptr<ASMTPrincipalMassMarker> principalMassMarker;
std::shared_ptr<ASMTPrincipalMassMarker> principalMassMarker = std::make_shared<ASMTPrincipalMassMarker>();
};
}