HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_ParticlePressure.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_ParticlePressure.h ( GAS Library, C++)
7  *
8  * COMMENTS: This node is intended to produce a pressure-like
9  * force acting on the particles of a particle fluid
10  * simulation. This force is fairly similar to the
11  * SPH style pressure calculation in GAS_SPHForces,
12  * but uses an idea referred to as "double density
13  * relaxation" (see paper repository).
14  *
15  */
16 
17 #ifndef __GAS_ParticlePressure__
18 #define __GAS_ParticlePressure__
19 
20 #include "GAS_API.h"
21 
22 #include "GAS_SubSolver.h"
23 #include "GAS_Utils.h"
24 #include "GAS_SPH.h"
25 
26 #include <UT/UT_ValArray.h>
27 #include <UT/UT_Array.h>
29 
30 class GU_Detail;
31 class GAS_SPH;
32 
34 {
35 public:
36  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
37  GET_DATA_FUNC_F("gasconstant", GasConstant);
38  GET_DATA_FUNC_F("repulsionstrength", RepulsionStrength);
39  GET_DATA_FUNC_B("dopressure", DoPressure);
40  GET_DATA_FUNC_B("computev", ComputeVelocity);
41 
42  bool shouldMultiThread() { return true; }
43 
44 protected:
45  explicit GAS_ParticlePressure(const SIM_DataFactory *factory);
46  virtual ~GAS_ParticlePressure();
47 
48  /// Computes a pressure force for the given particle field
49  /// and either adjusts the velocity directly, or just
50  /// adds to the force variable.
51  virtual bool solveGasSubclass(SIM_Engine &engine,
52  SIM_Object *obj,
53  SIM_Time time,
54  SIM_Time timestep);
55 
56 protected:
57  THREADED_METHOD6(GAS_ParticlePressure, shouldMultiThread(),
58  calculatePressureForce,
59  GU_Detail *, gdp,
60  const GAS_SPH &, sph,
61  fpreal, gasconstant,
62  fpreal, repulsionstrength,
63  SIM_Time, timestep,
64  UT_Array<UT_Vector3Array> &, forcelists)
65  void calculatePressureForcePartial(GU_Detail *gdp,
66  const GAS_SPH &sph,
67  fpreal gasconstant,
68  fpreal repulsionstrength,
69  SIM_Time timestep,
70  UT_Array<UT_Vector3Array> &forcelists,
71  const UT_JobInfo &info);
72 
73  THREADED_METHOD2(GAS_ParticlePressure, shouldMultiThread(),
74  writeBackForces,
75  GU_Detail *, gdp,
76  const UT_Array<UT_Vector3Array> &, forcelists)
77  void writeBackForcesPartial(GU_Detail *gdp,
78  const UT_Array<UT_Vector3Array> &forcelists,
79  const UT_JobInfo &info);
80 
81 private:
82  static const SIM_DopDescription *getDopDescription();
83 
85  DECLARE_DATAFACTORY(GAS_ParticlePressure,
87  "Gas Particle Pressure",
88  getDopDescription());
89 };
90 
91 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:28
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
double fpreal
Definition: SYS_Types.h:270
#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 const
Definition: zconf.h:214
#define GET_DATA_FUNC_S(DataName, FuncName)