HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_Advect.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_Advect.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_Advect__
12 #define __GAS_Advect__
13 
14 #include "GAS_API.h"
15 
16 #include <UT/UT_ValArray.h>
18 
19 #include <GU/GU_Detail.h>
20 
21 #include "GAS_SubSolver.h"
22 #include "GAS_Utils.h"
23 
24 class GAS_SPH;
25 class GU_Detail;
26 class SIM_VectorField;
27 class UT_Lock;
28 
30 {
31 public:
32  GET_DATA_FUNC_S(GAS_NAME_FIELD, FieldName);
33  GET_DATA_FUNC_S("minfield", MinFieldName);
34  GET_DATA_FUNC_S("maxfield", MaxFieldName);
35  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
36  GET_DATA_FUNC_S(GAS_NAME_PTGROUP, PointGroupName);
37  GET_DATA_FUNC_S(GAS_NAME_COLLISION, CollisionName);
38  GET_DATA_FUNC_S(GAS_NAME_VELOCITY, VelocityName);
39  GET_DATA_FUNC_B("usegeometryvelocity", UseGeometryVelocity);
40  GET_DATA_FUNC_B("useneighbour", UseNeighbour);
41  GET_DATA_FUNC_B("updatep", UpdatePosition);
42  GETSET_DATA_FUNCS_S("attribute", Attribute);
43  GET_DATA_FUNC_B("updatev", UpdateVelocity);
44  GETSET_DATA_FUNCS_S("velattribute", VelAttribute);
45  GETSET_DATA_FUNCS_F("cflcond", CFLCond);
46 
47  GET_DATA_FUNC_I("advectmethod", AdvectMethod);
48 
51 
52  /// Public velocity evaluation function.
53  static UT_Vector3 getVelocity(const UT_Vector3 &p, int jobnum, void *vdata);
54 
55 protected:
56  explicit GAS_Advect(const SIM_DataFactory *factory);
57  ~GAS_Advect() override;
58 
59  /// Moves the fields given by FieldName by the given velocity
60  /// field. Moves the points given by GeometryName likewise.
61  bool solveGasSubclass(SIM_Engine &engine,
62  SIM_Object *obj,
63  SIM_Time time,
64  SIM_Time timestep) override;
65 
66  /// Moves the markers according to the velocity field given.
67  THREADED_METHOD8(GAS_Advect, gdp->getNumPoints() > 2048, advectPoints,
68  GU_Detail *, gdp,
69  const GA_PointGroup *, grp,
70  const UT_DMatrix4 &, xform_togeo,
71  const UT_DMatrix4 &, xform_toworld,
72  const SIM_VectorField *, velocity,
74  const GA_RWHandleV3 &, p_h,
75  const GA_RWHandleV3 &, v_h)
76  void advectPointsPartial(GU_Detail *gdp,
77  const GA_PointGroup *grp,
78  const UT_DMatrix4 &xform_togeo,
79  const UT_DMatrix4 &xform_toworld,
80  const SIM_VectorField *velocity,
81  fpreal timestep,
82  const GA_RWHandleV3 &p_h,
83  const GA_RWHandleV3 &v_h,
84  const UT_JobInfo &info);
85 
86  THREADED_METHOD9(GAS_Advect, gdp->getNumPoints() > 2048, advectPointsGeo,
87  GU_Detail *, gdp,
88  const GA_PointGroup *, grp,
89  const GAS_SPH *, sph,
90  const UT_DMatrix4 &, xform_togeo,
91  const UT_DMatrix4 &, xform_toworld,
92  fpreal, timestep,
93  fpreal, voxelsize,
94  const GA_RWHandleV3 &, p_h,
95  const GA_RWHandleV3 &, v_h)
96  void advectPointsGeoPartial(GU_Detail *gdp,
97  const GA_PointGroup *grp,
98  const GAS_SPH *sph,
99  const UT_DMatrix4 &xform_togeo,
100  const UT_DMatrix4 &xform_toworld,
101  fpreal timestep,
102  fpreal voxelsize,
103  const GA_RWHandleV3 &p_h,
104  const GA_RWHandleV3 &v_h,
105  const UT_JobInfo &info);
106 
107  // Advect the points against their own velocities.
108  THREADED_METHOD6(GAS_Advect, gdp->getNumPoints() > 2048, advectPointsVel,
109  SIM_Object *, obj,
110  GU_Detail *, gdp,
111  const GA_PointGroup *, ptgrp,
112  fpreal, timestep,
113  const GA_RWHandleV3 &, p_h,
114  const GA_ROHandleV3 &, v_h)
115  void advectPointsVelPartial(SIM_Object *obj,
116  GU_Detail *gdp,
117  const GA_PointGroup *grp,
118  fpreal timestep,
119  const GA_RWHandleV3 &p_h,
120  const GA_ROHandleV3 &v_h,
121  const UT_JobInfo &info);
122 
123 private:
124  static const SIM_DopDescription *getDopDescription();
125 
129  "Gas Advect",
130  getDopDescription());
131 };
132 
133 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
const GA_PointGroup * ptgrp
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
#define THREADED_METHOD8(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7, PARMTYPE8, PARMNAME8)
GT_API const UT_StringHolder time
#define GAS_NAME_USETIMESTEP
Definition: GAS_Utils.h:39
#define GAS_API
Definition: GAS_API.h:10
#define GETSET_DATA_FUNCS_S(DataName, FuncName)
#define GAS_NAME_COLLISION
Definition: GAS_Utils.h:21
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
void advectPoints(PointDataGridT &points, const VelGridT &velocity, const Index integrationOrder, const double dt, const Index timeSteps, const AdvectFilterT &advectFilter=NullFilter(), const FilterT &filter=NullFilter(), const bool cached=true)
Advect points in a PointDataGrid through a velocity grid.
Definition: PointAdvect.h:218
#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
#define GAS_NAME_FIELD
Definition: GAS_Utils.h:27
#define GET_DATA_FUNC_I(DataName, FuncName)
fpreal64 fpreal
Definition: SYS_Types.h:277
#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
Definition: GAS_Utils.h:40
#define GAS_NAME_PTGROUP
Definition: GAS_Utils.h:34
#define THREADED_METHOD9(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7, PARMTYPE8, PARMNAME8, PARMTYPE9, PARMNAME9)
This class holds a three dimensional vector field.
#define GET_DATA_FUNC_S(DataName, FuncName)
const GA_PointGroup SIM_Time timestep