HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_SPHForces.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_SPHForces.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_SPHForces__
12 #define __GAS_SPHForces__
13 
14 #include "GAS_API.h"
15 
16 #include <GU/GU_Detail.h>
17 
19 
20 #include "GAS_SubSolver.h"
21 #include "GAS_Utils.h"
22 
23 class GU_Detail;
24 class GAS_SPH;
25 
27 {
28 public:
29  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
30  GET_DATA_FUNC_F("gasconstant", GasConstant);
31  GET_DATA_FUNC_B("dopressure", DoPressure);
32  GET_DATA_FUNC_B("doviscosity", DoViscosity);
33  GET_DATA_FUNC_B("dotension", DoTension);
34  GET_DATA_FUNC_B("computev", ComputeVelocity);
35 
36 protected:
37  explicit GAS_SPHForces(const SIM_DataFactory *factory);
38  ~GAS_SPHForces() override;
39 
40  /// Moves the fields given by FieldName by the given velocity
41  /// field. Moves the points given by GeometryName likewise.
42  bool solveGasSubclass(SIM_Engine &engine,
43  SIM_Object *obj,
44  SIM_Time time,
45  SIM_Time timestep) override;
46 
47  bool shouldMultiThread() { return true; }
48 
49 protected:
50  void calculatePressure(GU_Detail *gdp, fpreal gasconstant,
51  GA_Range r);
52  void accumulatePressureForce(GU_Detail *gdp, const GAS_SPH *sph,
53  GA_Range r);
54  void accumulateViscousForce(GU_Detail *gdp, const GAS_SPH *sph,
55  GA_Range r);
56  void accumulateSurfaceForce(GU_Detail *gdp, const GAS_SPH *sph,
57  GA_Range r);
58 
59  THREADED_METHOD2(GAS_SPHForces, shouldMultiThread(), calcPressure,
60  GU_Detail *, gdp,
61  fpreal, gasconstant)
62  void calcPressurePartial(GU_Detail *gdp,
63  fpreal gasconstant,
64  const UT_JobInfo &info);
65 
66  THREADED_METHOD5(GAS_SPHForces, shouldMultiThread(), calcForces,
67  GU_Detail *, gdp,
68  const GAS_SPH &, sph,
69  bool, dopressure,
70  bool, doviscosity, bool, dotension)
71  void calcForcesPartial(GU_Detail *gdp,
72  const GAS_SPH &sph,
73  bool dopressure, bool diviscosity,
74  bool dotension, const UT_JobInfo &info);
75 
76 private:
77  static const SIM_DopDescription *getDopDescription();
78 
80  DECLARE_DATAFACTORY(GAS_SPHForces,
82  "Gas SPH Forces",
83  getDopDescription());
84 };
85 
86 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
void
Definition: png.h:1083
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
A range of elements in an index-map.
Definition: GA_Range.h:42
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
bool shouldMultiThread()
Definition: GAS_SPHForces.h:47
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
fpreal64 fpreal
Definition: SYS_Types.h:277
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
GLboolean r
Definition: glcorearb.h:1222
#define GET_DATA_FUNC_S(DataName, FuncName)