HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_ProjectNonDivergentVariational.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_ProjectNonDivergentVariational.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_ProjectNonDivergentVariational_h__
12 #define __GAS_ProjectNonDivergentVariational_h__
13 
14 #include "GAS_SubSolver.h"
15 #include "GAS_Utils.h"
17 #include <SIM/SIM_RawIndexField.h>
18 
19 class SIM_VectorField;
20 class SIM_RawField;
21 class SIM_ScalarField;
22 class gas_VoxelIndex;
23 
24 template <typename T, bool colmajor, bool exint>
26 
28 {
29 public:
30  /// These macros are used to create the accessors
31  /// getFieldDstName and getFieldSrcName functions we'll use
32  /// to access our data options.
34  GET_DATA_FUNC_F("mindensity", MinDensity);
35  GET_DATA_FUNC_F("maxdensity", MaxDensity);
37  GET_DATA_FUNC_F("extrapdist", ExtrapolationDistance);
38  GET_DATA_FUNC_B("usepreconditioner", UsePreconditioner);
39  GET_DATA_FUNC_B(SIM_NAME_OPENCL, UseOpenCL);
40 
41  GET_DATA_FUNC_B("usesharpcollisions", UseSharpCollisions);
42 
43  GET_DATA_FUNC_B("useoldpressure", UseOldPressure);
44 
45  GET_DATA_FUNC_S(GAS_NAME_TRACKERADDR, TrackerAddress);
48  GET_DATA_FUNC_I("slice", Slice);
49  GET_DATA_FUNC_I("numslice", NumSlice);
50 
51  GET_DATA_FUNC_B("airincompressibility", AirIncompressibility);
52  GET_DATA_FUNC_B("applyaircollisions", ApplyAirCollisions);
53  GET_DATA_FUNC_F("minairregionsize", MinAirRegionSize);
54 
55  GET_DATA_FUNC_F("waterline",Waterline);
56  GET_DATA_FUNC_B("usewaterline",UseWaterline);
57  GET_DATA_FUNC_V3("waterlinedirection",WaterlineDirection);
58 
61 
62 protected:
63  explicit GAS_ProjectNonDivergentVariational(const SIM_DataFactory *factory);
65 
66  /// The overloaded callback that GAS_SubSolver will invoke to
67  /// perform our actual computation. We are giving a single object
68  /// at a time to work on.
69  bool solveGasSubclass(SIM_Engine &engine,
70  SIM_Object *obj,
71  SIM_Time time,
72  SIM_Time timestep) override;
73 
74  void initializeSubclass() override;
75 
77  divergence.shouldMultiThread(),
78  computeDivergenceWeighted,
79  const SIM_VectorField *, velocity,
80  const SIM_VectorField *, collisionvel,
81  const SIM_RawField **, weights,
83  const SIM_RawIndexField &, index,
84  const bool, apply_smoothed_collision)
85 
86  void computeDivergenceWeightedPartial(const SIM_VectorField *velocity,
87  const SIM_VectorField *collisionvel,
88  const SIM_RawField *weights[3],
90  const SIM_RawIndexField &index,
91  const bool apply_smoothed_collision,
92  const UT_JobInfo &info);
93 
95  {
97  const SIM_RawField *weights[3];
98  const SIM_RawField *surfweights[3];
102 
105  SIM_BoundaryLine indexblines[3];
106  };
107 
109  surface.shouldMultiThread(),
110  classifyVoxels,
111  const classifyVoxelsParms &, parms,
112  const SIM_RawField &, surface);
113 
114  void classifyVoxelsPartial(
115  const classifyVoxelsParms &parms,
116  const SIM_RawField &surface,
117  const UT_JobInfo &info) const;
118 
119  exint buildIndex(const SIM_RawField &surface,
120  const SIM_RawField &collision,
121  const SIM_VectorField *velocity,
122  const SIM_RawField *weights[3],
123  const SIM_RawField *surfweights[3],
124  const SIM_RawIndexField *sliceindex,
125  int thisslice,
127  UT_Array<UT_Array<gas_VoxelIndex> *> &sliceoverflow,
128  UT_ExintArray &slicebase,
129  SIM_BoundaryLine indexblines[3]);
130 
132  {
142  int axis;
144  };
145 
147  applyPressureGradientFace,
148  const applyPressureParms &, parms,
149  SIM_RawField &, u);
150 
151  void applyPressureGradientFacePartial(
152  const applyPressureParms &parms,
153  SIM_RawField &u,
154  const UT_JobInfo &info) const;
155 
156 
158  {
166  SIM_BoundaryLine indexblines[3];
167  };
168 
169 
171  comp.shouldMultiThread(),
172  findOpenSurfaceCells,
173  const openSurfaceCellsParms &, parms,
174  const SIM_RawIndexField &, comp);
175 
176  void findOpenSurfaceCellsPartial(
177  const openSurfaceCellsParms & parms,
178  const SIM_RawIndexField & comp,
179  const UT_JobInfo &info) const;
180 
181 private:
182  /// We define this to be a DOP_Auto node which means we do not
183  /// need to implement a DOP_Node derivative for this data. Instead,
184  /// this description is used to define the interface.
185  static const SIM_DopDescription *getDopDescription();
186 
187  /// These macros are necessary to bind our node to the factory and
188  /// ensure useful constants like BaseClass are defined.
192  "Gas Project Non Divergent Variational",
193  getDopDescription());
194 
195 };
196 
197 
198 #endif
199 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define SIM_NAME_TOLERANCE
Definition: SIM_Names.h:202
#define GET_DATA_FUNC_V3(DataName, FuncName)
GT_API const UT_StringHolder time
#define GAS_NAME_USETIMESTEP
Definition: GAS_Utils.h:39
#define GAS_API
Definition: GAS_API.h:10
int64 exint
Definition: SYS_Types.h:125
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define GAS_NAME_VELOCITY
Definition: GAS_Utils.h:42
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
#define GET_DATA_FUNC_I(DataName, FuncName)
#define GAS_NAME_TRACKERADDR
Definition: GAS_Utils.h:43
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
GLhandleARB obj
Definition: glew.h:6266
#define GAS_NAME_TRACKERPORT
Definition: GAS_Utils.h:44
#define THREADED_METHOD2_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
#define GAS_NAME_JOBNAME
Definition: GAS_Utils.h:45
fpreal64 fpreal
Definition: SYS_Types.h:277
#define GET_DATA_FUNC_B(DataName, FuncName)
GLuint index
Definition: glcorearb.h:785
GLbyte * weights
Definition: glew.h:7581
#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)
This class holds a three dimensional scalar field.
#define SIM_NAME_OPENCL
Definition: SIM_Names.h:222
#define GAS_NAME_TIMESCALE
Definition: GAS_Utils.h:40
VectorToScalarConverter< GridType >::Type::Ptr divergence(const GridType &grid, bool threaded, InterruptT *interrupt)
Compute the divergence of the given vector-valued grid.
This class holds a three dimensional vector field.
#define GET_DATA_FUNC_S(DataName, FuncName)
virtual void initializeSubclass()