HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_SubStep.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GAS_SubStep.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_SubStep__
12 #define __GAS_SubStep__
13 
14 #include "GAS_API.h"
15 
16 #include "GAS_SubSolver.h"
17 #include "GAS_Utils.h"
18 
20 {
21 public:
23  GET_DATA_FUNC_S(GAS_NAME_VELOCITY, VelocityName);
24  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
25  GETSET_DATA_FUNCS_I("substeps", Substeps);
26  GETSET_DATA_FUNCS_I("minimumsubsteps", MinimumSubsteps);
27  GETSET_DATA_FUNCS_F("cflcond", CFLCond);
28  GET_DATA_FUNC_B("createsubstepdata", CreateSubstepData);
29  GET_DATA_FUNC_B("cflonce", CFLOnce);
30  GET_DATA_FUNC_B("quantize", Quantize);
31 
32  GET_DATA_FUNC_S(GAS_NAME_TRACKERADDR, TrackerAddress);
35  GET_DATA_FUNC_I("slice", Slice);
36  GET_DATA_FUNC_I("numslice", NumSlice);
37 
38  /// We to change the way in which our timestep is used so we have
39  /// to preempt the solveGasSubclass.
41  SIM_ObjectArray &objects,
42  SIM_ObjectArray &newobjects,
43  SIM_ObjectArray &feedbacktoobjects,
44  const SIM_Time &timestep) override;
45 
46 protected:
47  explicit GAS_SubStep(const SIM_DataFactory *factory);
48  ~GAS_SubStep() override;
49 
51  SIM_Object *obj,
52  SIM_Time time,
53  SIM_Time timestep) override
54  {
55  return true;
56  }
57 
59  const SIM_Object &object,
60  const UT_Vector3 &impulseworldpos,
61  UT_DMatrix3 &immatrix) const override;
63  const SIM_Object &object,
64  int ptnum,
65  UT_DMatrix3 &immatrix) const override;
68  const SIM_Object &object) const override;
69 
70 private:
71  static const SIM_DopDescription *getDopDescription();
72 
73  /// Gets the solver to use for getting object properties.
74  const SIM_Solver *getCurrentSolver() const;
75 
76  /// Finds the new substep recommended by a solver that has indicated
77  /// a substep needs to be repeated.
78  SIM_Time getAdjustedSubStep(
79  SIM_ObjectArray &objects);
80 
81  SIM_Solver *myCurrentSolver;
82 
86  "Gas SubStep",
87  getDopDescription());
88 };
89 
90 #endif
91 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define SIM_NAME_PRIMARYSOLVER
Definition: SIM_Names.h:170
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
#define GAS_NAME_VELOCITY
Definition: GAS_Utils.h:42
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
SIM_Result solveObjectsSubclass(SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep) override
Merely calls solve on each object.
#define GET_DATA_FUNC_I(DataName, FuncName)
Holds pointers to a number of SIM_Object objects.
#define GAS_NAME_TRACKERADDR
Definition: GAS_Utils.h:43
#define GAS_NAME_TRACKERPORT
Definition: GAS_Utils.h:44
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 GAS_NAME_JOBNAME
Definition: GAS_Utils.h:45
bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep) override
Definition: GAS_SubStep.h:50
#define GET_DATA_FUNC_B(DataName, FuncName)
virtual void getPointImpulseMassMatrixSubclass(const SIM_Object &object, int ptnum, UT_DMatrix3 &immatrix) const
#define GET_DATA_FUNC_S(DataName, FuncName)