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_S(GAS_NAME_TRACKERADDR, TrackerAddress);
44  GET_DATA_FUNC_I("slice", Slice);
45  GET_DATA_FUNC_I("numslice", NumSlice);
46 
47  GET_DATA_FUNC_B("airincompressibility", AirIncompressibility);
48  GET_DATA_FUNC_B("applyaircollisions", ApplyAirCollisions);
49  GET_DATA_FUNC_F("minairregionsize", MinAirRegionSize);
50 
51  GET_DATA_FUNC_F("waterline",Waterline);
52  GET_DATA_FUNC_B("usewaterline",UseWaterline);
53  GET_DATA_FUNC_V3("waterlinedirection",WaterlineDirection);
54 
57 
58 protected:
59  explicit GAS_ProjectNonDivergentVariational(const SIM_DataFactory *factory);
61 
62  /// The overloaded callback that GAS_SubSolver will invoke to
63  /// perform our actual computation. We are giving a single object
64  /// at a time to work on.
65  virtual bool solveGasSubclass(SIM_Engine &engine,
66  SIM_Object *obj,
67  SIM_Time time,
68  SIM_Time timestep);
69 
70  virtual void initializeSubclass();
71 
73  divergence.shouldMultiThread(),
74  computeDivergenceWeighted,
75  const SIM_VectorField *, velocity,
76  const SIM_VectorField *, collisionvel,
77  const SIM_RawField **, weights,
79  const SIM_RawIndexField &, index);
80 
81  void computeDivergenceWeightedPartial(const SIM_VectorField *velocity,
82  const SIM_VectorField *collisionvel,
83  const SIM_RawField *weights[3],
85  const SIM_RawIndexField &index,
86  const UT_JobInfo &info);
87 
89  {
91  const SIM_RawField *weights[3];
92  const SIM_RawField *surfweights[3];
96 
98  int thisslice;
99  SIM_BoundaryLine indexblines[3];
100  };
101 
103  surface.shouldMultiThread(),
104  classifyVoxels,
105  const classifyVoxelsParms &, parms,
106  const SIM_RawField &, surface);
107 
108  void classifyVoxelsPartial(
109  const classifyVoxelsParms &parms,
110  const SIM_RawField &surface,
111  const UT_JobInfo &info) const;
112 
113  exint buildIndex(const SIM_RawField &surface,
114  const SIM_RawField &collision,
115  const SIM_VectorField *velocity,
116  const SIM_RawField *weights[3],
117  const SIM_RawField *surfweights[3],
118  const SIM_RawIndexField *sliceindex,
119  int thisslice,
120  SIM_RawIndexField &index,
121  UT_Array<UT_Array<gas_VoxelIndex> *> &sliceoverflow,
122  UT_ExintArray &slicebase,
123  SIM_BoundaryLine indexblines[3]);
124 
126  {
136  int axis;
138  };
139 
141  applyPressureGradientFace,
142  const applyPressureParms &, parms,
143  SIM_RawField &, u);
144 
145  void applyPressureGradientFacePartial(
146  const applyPressureParms &parms,
147  SIM_RawField &u,
148  const UT_JobInfo &info) const;
149 
150 
152  {
160  SIM_BoundaryLine indexblines[3];
161  };
162 
163 
165  comp.shouldMultiThread(),
166  findOpenSurfaceCells,
167  const openSurfaceCellsParms &, parms,
168  const SIM_RawIndexField &, comp);
169 
170  void findOpenSurfaceCellsPartial(
171  const openSurfaceCellsParms & parms,
172  const SIM_RawIndexField & comp,
173  const UT_JobInfo &info) const;
174 
175 private:
176  /// We define this to be a DOP_Auto node which means we do not
177  /// need to implement a DOP_Node derivative for this data. Instead,
178  /// this description is used to define the interface.
179  static const SIM_DopDescription *getDopDescription();
180 
181  /// These macros are necessary to bind our node to the factory and
182  /// ensure useful constants like BaseClass are defined.
186  "Gas Project Non Divergent Variational",
187  getDopDescription());
188 
189 };
190 
191 
192 #endif
193 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define SIM_NAME_TOLERANCE
Definition: SIM_Names.h:201
#define GET_DATA_FUNC_V3(DataName, FuncName)
GT_API const UT_StringHolder time
#define GAS_NAME_USETIMESTEP
Definition: GAS_Utils.h:37
#define GAS_API
Definition: GAS_API.h:10
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#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)
int64 exint
Definition: SYS_Types.h:116
#define GAS_NAME_TRACKERADDR
Definition: GAS_Utils.h:41
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
#define GAS_NAME_TRACKERPORT
Definition: GAS_Utils.h:42
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
#define THREADED_METHOD2_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
double fpreal
Definition: SYS_Types.h:270
#define GAS_NAME_JOBNAME
Definition: GAS_Utils.h:43
#define GET_DATA_FUNC_B(DataName, FuncName)
GLuint index
Definition: glcorearb.h:785
#define GET_DATA_FUNC_F(DataName, FuncName)
This class holds a three dimensional scalar field.
#define SIM_NAME_OPENCL
Definition: SIM_Names.h:221
#define GAS_NAME_TIMESCALE
Definition: GAS_Utils.h:38
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()