1 #ifndef RIGID_BODY_MOTION_H
2 #define RIGID_BODY_MOTION_H
10 using namespace DBase;
13 class GenericGraphicsInterface;
22 positionHasNoConstraint=0,
30 rotationHasNoConstraint=0,
38 leapFrogTrapezoidal=0,
45 polynomialTwilightZone=0,
46 trigonometricTwilightZone
52 timePolynomialBodyForce=0,
58 defaultOrderOfAccuracy=-1234
65 bool centerOfMassHasBeenInitialized()
const;
69 const RealArray & force,
70 const RealArray & torque,
72 RealArray & rotation );
76 const RealArray & force,
77 const RealArray & torque,
78 const RealArray & A11,
const RealArray & A12,
const RealArray & A21,
const RealArray & A22,
80 RealArray & rotation );
83 int get(
const GenericDataBase &
dir,
const aString & name);
85 int getAcceleration( real t, RealArray & vCM )
const;
88 int getAddedMassMatrices(
const real t, RealArray & A11 , RealArray & A12 , RealArray & A21, RealArray & A22 )
const;
90 int getAngularAcceleration( real t, RealArray & omegaDot )
const;
92 int getAngularVelocities( real t, RealArray &
omega )
const;
94 int getAxesOfInertia( real t, RealArray & axesOfInertia )
const;
96 int getBodyForces(
const real t, RealArray & bodyForce, RealArray & bodyTorque )
const;
98 bool getCorrectionHasConverged();
101 int getCoordinates( real t,
102 RealArray & xCM = Overture::nullRealArray(),
103 RealArray & vCM = Overture::nullRealArray(),
104 RealArray & rotation = Overture::nullRealArray(),
105 RealArray &
omega = Overture::nullRealArray(),
106 RealArray & omegaDot = Overture::nullRealArray(),
107 RealArray & aCM = Overture::nullRealArray(),
108 RealArray & axesOfInertia = Overture::nullRealArray() )
const;
110 real getDensity()
const;
113 int getExactSolution(
const int deriv,
const real t, RealArray &
xe, RealArray & ve , RealArray & we )
const;
116 int getForce(
const real t, RealArray & fv, RealArray & gv )
const;
118 int getInitialConditions(RealArray & x0 = Overture::nullRealArray() ,
119 RealArray & v0 = Overture::nullRealArray() ,
120 RealArray & w0 = Overture::nullRealArray() ,
121 RealArray & axesOfInertia = Overture::nullRealArray() )
const ;
123 real getMass()
const;
125 real getMaximumRelativeCorrection();
127 RealArray getMomentsOfInertia()
const;
129 int getPosition( real t, RealArray & xCM )
const;
132 int getPointAcceleration( real t,
const RealArray & p, RealArray & ap)
const;
133 int getPointVelocity( real t,
const RealArray & p, RealArray & vp)
const;
137 int getPointTransformationMatrix( real t,
138 RealArray & rDotRt = Overture::nullRealArray(),
139 RealArray & rDotDotRt = Overture::nullRealArray() )
const ;
141 real getTimeStepEstimate()
const;
144 aString getTimeSteppingMethodName()
const;
146 int getVelocity( real t, RealArray & vCM )
const;
148 int getRotationMatrix(real t,
150 RealArray & rDot = Overture::nullRealArray(),
151 RealArray & rDotDot = Overture::nullRealArray() )
const;
154 int includeAddedMass(
bool trueOrFalse =
true );
157 int integrate( real tf,
158 const RealArray & force,
159 const RealArray & torque,
162 RealArray & rotation );
165 int integrate( real tf,
166 const RealArray & force,
167 const RealArray & torque,
169 const RealArray & A11,
const RealArray & A12,
const RealArray & A21,
const RealArray & A22,
171 RealArray & rotation );
173 bool massHasBeenInitialized()
const;
175 int momentumTransfer( real t, RealArray &
v );
179 int put( GenericDataBase &
dir,
const aString & name)
const;
184 int setInitialCentreOfMass(
const RealArray & x0 );
186 int setInitialConditions( real t0=0.,
187 const RealArray & x0 = Overture::nullRealArray() ,
188 const RealArray & v0 = Overture::nullRealArray() ,
189 const RealArray & w0 = Overture::nullRealArray() ,
190 const RealArray & axesOfInertia = Overture::nullRealArray() );
192 void setMass(
const real totalMass );
195 int setNewtonTolerance( real
tol );
198 int setPastTimeForcing( real t,
const RealArray & force,
const RealArray & torque );
199 int setPastTimeForcing( real t,
const RealArray & force,
const RealArray & torque,
200 const RealArray & A11,
const RealArray & A12,
const RealArray & A21,
const RealArray & A22 );
202 int setPositionConstraint( PositionConstraintEnum constraint,
const RealArray & values );
204 int setProperties(real totalMass,
205 const RealArray & momentsOfInertia,
206 const int numberOfDimensions = 3 );
208 int setRotationConstraint( RotationConstraintEnum constraint,
const RealArray & values );
210 int setTwilightZone(
bool trueOrFalse, TwilightZoneTypeEnum type = trigonometricTwilightZone );
213 int setTimeSteppingMethod(
const TimeSteppingMethodEnum method,
int orderOfAccuracy=defaultOrderOfAccuracy );
215 int update( GenericGraphicsInterface & gi );
218 bool useAddedMass()
const;
229 applyConstraintsToPosition=0,
231 applyConstraintsToForces
235 int applyConstraints(
const int step,
const ConstraintApplicationEnum option );
237 int buildBodyForceOptionsDialog(DialogData & dialog );
240 int dirkImplicitSolve(
const real dt,
const real aii,
const real
tc,
const RealArray & yv,
const RealArray &yv0,
243 int getBodyForceOption(
const aString & answer, DialogData & dialog );
246 int getForceInternal(
const real t, RealArray & fv, RealArray & gv, RealArray *pA=NULL )
const;
249 int takeStepImplicitRungeKutta(
const real t0,
const real dt );
252 int takeStepLeapFrog(
const real t0,
const real dt );
255 int takeStepTrapezoid(
const real t0,
const real dt );
261 int takeStepExtrapolation(
const real t0,
const real dt );
279 RealArray
x0, v0, w0;