HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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);
45 
46 protected:
47  explicit GAS_SubStep(const SIM_DataFactory *factory);
48  virtual ~GAS_SubStep();
49 
50  virtual bool solveGasSubclass(SIM_Engine &engine,
51  SIM_Object *obj,
52  SIM_Time time,
53  SIM_Time timestep)
54  {
55  return true;
56  }
57 
58  virtual void getImpulseMassMatrixSubclass(
59  const SIM_Object &object,
60  const UT_Vector3 &impulseworldpos,
61  UT_DMatrix3 &immatrix) const;
63  const SIM_Object &object,
64  int ptnum, UT_DMatrix3 &immatrix) const;
66  const SIM_Object &object) const;
67 
68 private:
69  static const SIM_DopDescription *getDopDescription();
70 
71  /// Gets the solver to use for getting object properties.
72  const SIM_Solver *getCurrentSolver() const;
73 
74  /// Finds the new substep recommended by a solver that has indicated
75  /// a substep needs to be repeated.
76  SIM_Time getAdjustedSubStep(
77  SIM_ObjectArray &objects);
78 
79  SIM_Solver *myCurrentSolver;
80 
84  "Gas SubStep",
85  getDopDescription());
86 };
87 
88 #endif
89 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define SIM_NAME_PRIMARYSOLVER
Definition: SIM_Names.h:169
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:28
#define GAS_API
Definition: GAS_API.h:10
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
3D Vector class.
#define GAS_NAME_VELOCITY
Definition: GAS_Utils.h:40
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
#define GET_DATA_FUNC_I(DataName, FuncName)
Holds pointers to a number of SIM_Object objects.
#define GAS_NAME_TRACKERADDR
Definition: GAS_Utils.h:41
#define GAS_NAME_TRACKERPORT
Definition: GAS_Utils.h:42
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)
Definition: GAS_SubStep.h:50
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.
virtual SIM_Result solveObjectsSubclass(SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep)
Merely calls solve on each object.
#define GAS_NAME_JOBNAME
Definition: GAS_Utils.h:43
#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)