13 #ifndef __GAS_Integrator__
14 #define __GAS_Integrator__
34 #define GAS_RK_45_NUMSTEPS 6
35 #define GAS_RK_4_NUMSTEPS 4
36 #define GAS_RK_21_NUMSTEPS 3
37 #define GAS_RK_32_NUMSTEPS 4
38 #define GAS_EULER_NUMSTEPS 1
39 #define GAS_MIDPOINT_NUMSTEPS 2
97 OBJECTSTATE_INITIAL = 0,
159 struct RungeKuttaDataTable {
170 RungeKuttaDataTable() : myNumSteps(0) {}
175 return myPositionStepData(i);
180 return myVelocityStepData(i);
185 return myOrientationStepData(i);
190 return myAngVelocityStepData(i);
193 void resizeIfNeeded(
int npts,
bool doangular =
false)
195 for (
int i = 0; i < myNumSteps; i++)
197 myPositionStepData(i).entries(npts);
198 myVelocityStepData(i).entries(npts);
202 myOrientationStepData(i).entries(npts);
203 myAngVelocityStepData(i).entries(npts);
208 void addStepsIfNeeded(
int numsteps)
210 while (myNumSteps < numsteps)
212 myPositionStepData.append();
213 myVelocityStepData.append();
214 myOrientationStepData.append();
215 myAngVelocityStepData.append();
240 bool cplUpdate=
true);
250 int numsteps,
int stepnum,
253 bool cplUpdate=
true);
258 int numsteps, stepnum;
269 RungeKuttaDataTable &,
data,
271 const rkInfoParms &, parms,
273 void reinitializeSystemPartial(
GU_Detail *gdp,
275 RungeKuttaDataTable &
data,
277 const rkInfoParms &parms,
285 int numsteps,
const fpreal64 *coefficients);
293 RungeKuttaDataTable &,
data,
299 void computeFinalStatePartial(
GU_Detail *gdp,
301 RungeKuttaDataTable &
data,
302 ObjectInfo &inf,
int numsteps,
324 void objectStateToGeoPartial(
GU_Detail *gdp,
340 void geoToObjectState(
const GU_Detail *gdp,
352 void geoToObjectStatePartial(
const GU_Detail *gdp,
399 bool integrationSucceeded(
GU_Detail *gdp,
442 SIM_Result doRungeKuttaFehlberg(
SIM_Engine &engine,
516 void leapfrogVelocityUpdate(
SIM_Engine &engine,
541 int numRungeKuttaSteps = 0);
552 bool incremental =
false);
616 computeVelocityChanges,
624 void computeVelocityChangesPartial(
655 advectParticlesEuler,
660 void advectParticlesEulerPartial(
GU_Detail *gdp,
675 void directIntegratePosPartial(
GU_Detail *gdp,
681 directIntegrateOrient,
685 void directIntegrateOrientPartial(
GU_Detail *gdp,
699 void computeXSPHVelPartial(
GU_Detail *gdp,
718 bool bounceParticleFromImpact(
GU_Detail *gdp,
737 const char *impactdataname,
738 bool clearimpacts =
false);
746 bool clearimpacts =
false);
754 bool clearimpacts =
false);
799 static const fpreal64 RK_21_TOLERANCE_COEF;
818 getDopDescription());
#define DECLARE_STANDARD_GETCASTTOTYPE()
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
#define THREADED_METHOD7(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7)
#define SIM_NAME_PRIMARYSOLVER
const GA_PointGroup * ptgrp
#define GAS_NAME_GEOMETRY
GT_API const UT_StringHolder time
#define GAS_NAME_USETIMESTEP
exint GA_Size
Defines the bit width for index and offset types in GA.
#define GAS_RK_32_NUMSTEPS
#define THREADED_METHOD3(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3)
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
GA_API const UT_StringHolder scale
SIM_Result solveObjectsSubclass(SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time ×tep) override
Merely calls solve on each object.
#define GET_DATA_FUNC_I(DataName, FuncName)
IMATH_NAMESPACE::V2f float
#define GAS_MIDPOINT_NUMSTEPS
Holds pointers to a number of SIM_Object objects.
virtual void getImpulseMassMatrixSubclass(const SIM_Object &object, const UT_Vector3 &impulseworldpos, UT_DMatrix3 &immatrix) const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
virtual SIM_PointImpulseMassMatrixResolver * getPointImpulseMassMatrixResolverSubclass(const SIM_Object &object) const
Builds a resolver for evaluating mass matrices swiftly.
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
#define THREADED_METHOD4(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4)
#define GAS_RK_45_NUMSTEPS
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep) override
#define GAS_RK_4_NUMSTEPS
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
#define THREADED_METHOD6(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6)
#define GAS_NAME_TIMESCALE
#define GAS_EULER_NUMSTEPS
virtual void getPointImpulseMassMatrixSubclass(const SIM_Object &object, int ptnum, UT_DMatrix3 &immatrix) const
#define GET_DATA_FUNC_S(DataName, FuncName)
#define GAS_RK_21_NUMSTEPS
const GA_PointGroup SIM_Time timestep
This implements a SIM_Geometry that copies the source geometry.