HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_VectorField.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: SIM_VectorField.h ( SIM Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SIM_VectorField__
12 #define __SIM_VectorField__
13 
14 #include "SIM_API.h"
15 
16 #include <UT/UT_VoxelArray.h>
17 #include <UT/UT_DMatrix3.h>
19 
20 #include "SIM_Names.h"
21 #include "SIM_OptionsUser.h"
22 #include "SIM_DataUtils.h"
23 #include "SIM_RawField.h"
24 
25 class UT_IStream;
26 class SIM_Geometry;
27 class SIM_RawField;
28 class SIM_ScalarField;
29 class SIM_MatrixField;
30 class SIM_IndexField;
31 class GEO_PrimVDB;
32 
33 /// This class holds a three dimensional vector field.
35  public SIM_OptionsUser
36 {
37 public:
39 
40  /// Accesses the relative path to the position data associated with
41  /// this geometry.
43 
44  /// Control the number of divisions.
48  GETSET_DATA_FUNCS_V3(SIM_NAME_DIV, RawDivisions);
49  GETSET_DATA_FUNCS_I("uniformdiv", RawUniformDivisions);
50  GETSET_DATA_FUNCS_F("divsize", RawDivisionSize);
53 
54  GETSET_DATA_FUNCS_V3("slicediv", SliceDivisions);
55  GETSET_DATA_FUNCS_V3("sliceoverlapneg", SliceOverlapNeg);
56  GETSET_DATA_FUNCS_V3("sliceoverlappos", SliceOverlapPos);
57  GETSET_DATA_FUNCS_I("slice", Slice)
58  exint getNumSlices() const { UT_Vector3D nslice = getSliceDivisions(); return exint(nslice.x() * nslice.y() * nslice.z()); }
59 
60  GETSET_DATA_FUNCS_I("totalvoxels", TotalVoxels);
61  GETSET_DATA_FUNCS_V3("totalvoxelres", TotalVoxelRes);
62 
64  GETSET_DATA_FUNCS_B("closedends", ClosedEnds);
65  GETSET_DATA_FUNCS_B("closexneg", CloseXNeg);
66  GETSET_DATA_FUNCS_B("closeyneg", CloseYNeg);
67  GETSET_DATA_FUNCS_B("closezneg", CloseZNeg);
68  GETSET_DATA_FUNCS_B("closexpos", CloseXPos);
69  GETSET_DATA_FUNCS_B("closeypos", CloseYPos);
70  GETSET_DATA_FUNCS_B("closezpos", CloseZPos);
71 
72  GETSET_DATA_FUNCS_V3(SIM_NAME_DIRECTION, ExternalDirection);
74  GETSET_DATA_FUNCS_B("usefp16", UseFP16);
75  GETSET_DATA_FUNCS_I("border", RawBorder);
76  UT_VoxelBorderType getBorder() const { return (UT_VoxelBorderType) getRawBorder(); }
77  void setBorder(UT_VoxelBorderType border) { setRawBorder(border); }
78 
79  /// Controls the dimensions of where the field is properly defined
80  /// in the field space.
81  void getBBox(UT_BoundingBox &bbox) const;
82 
84  {
85  return getCenter() - getSize()/2;
86  }
87 
88  /// Calculate the size and divisions according to options
89  /// such as 2d or equal sized voxels.
90  UT_Vector3 getDivisions() const;
91  UT_Vector3 getSize() const;
92  UT_Vector3 getCenter() const;
93 
94  /// Adjusts the size/divisions of this field, overriding
95  /// and twod or uniform voxel settings.
96  void setDivisions(const UT_Vector3 &div);
97  void setSize(const UT_Vector3 &div);
98  void setCenter(const UT_Vector3 &div);
99 
100  /// Resizes our field keeping our field data.
101  /// The final size will be an integer number of voxels matching
102  /// our current voxel size. The final center will be an integer
103  /// number of voxel offset from our current center. This allows
104  /// us to do a perfect copy of the data.
105  void resizeKeepData(const UT_Vector3 &size, const UT_Vector3 &center, bool keepdata, const char *address = 0, int port = -1);
106 
107  /// Match this field to the given reference field. We will
108  /// end up with the same size/divisions/twod/uniform,
109  /// but not the same sampling pattern
110  void matchField(const SIM_ScalarField *field);
111  void matchField(const SIM_VectorField *field, bool matchsample = false);
112  void matchField(const SIM_MatrixField *field);
113  void matchField(const SIM_IndexField *field);
114 
115  void matchVolume(const GEO_PrimVolume *vol, const UT_DMatrix4 &xform);
116  void matchVDB(const GEO_PrimVDB *vdb, const UT_DMatrix4 &xform);
117 
118  bool isAligned(const SIM_ScalarField *field) const;
119  bool isAligned(const SIM_MatrixField *field) const;
120  /// True if we are component-wise aligned, our x/y/z fields
121  /// may still be unaligned with respect to each other.
122  bool isAligned(const SIM_VectorField *field) const;
123  bool isAligned(const SIM_RawField *field) const;
124 
125  /// Determines if we match in terms of voxel cells - same bounding
126  /// box and number of cells. Due to sampling, this does not mean
127  /// the sample points will match
128  /// Because our internal fields are always matching by definition,
129  /// we can just test the first field.
130  bool isMatching(const SIM_VectorField *field) const
131  { return getField(0)->isMatching(field->getField(0)); }
132 
133  bool isFaceSampled() const
134  { return getVoxelSample(0) == SIM_SAMPLE_FACEX &&
135  getVoxelSample(1) == SIM_SAMPLE_FACEY &&
136  getVoxelSample(2) == SIM_SAMPLE_FACEZ; }
137 
138  bool isCenterSampled() const
139  { return getVoxelSample(0) == SIM_SAMPLE_CENTER &&
140  getVoxelSample(1) == SIM_SAMPLE_CENTER &&
141  getVoxelSample(2) == SIM_SAMPLE_CENTER; }
142 
143  /// True if our internal fields are aligned.
144  bool isSelfAligned() const
145  { return getVoxelSample(0) == getVoxelSample(1) &&
146  getVoxelSample(1) == getVoxelSample(2); }
147 
148 
149  SIM_FieldSample getVoxelSample(int axis) const;
150  const UT_Vector3 &getVoxelSize(int axis) const { return myFields[axis]->getVoxelSize(); }
151  fpreal getVoxelDiameter(int axis) const { return myFields[axis]->getVoxelDiameter(); }
152  // Independent of sampling pattern, so constant between fields.
153  UT_Vector3 getVoxelSize() const { return getVoxelSize(0); }
154 
155  /// Access the field value given a world space location.
156  /// This does trilinear interpolation.
157  UT_Vector3 getValue(const UT_Vector3 &pos) const;
158 
159  /// Computes the gradient of the vector field in world space..
160  UT_DMatrix3 getGradient(const UT_Vector3 &pos) const;
161 
162  /// Computes the curl at a given worldspace
163  UT_Vector3 getCurl(const UT_Vector3 &pos) const;
164 
165  /// Gets the velocity at the given *voxel* location, interpolating
166  /// if we have corner or face velocities.
167  UT_Vector3 getCellValue(int x, int y, int z) const;
168 
169  /// Adds a velocity to the given *voxel*. If this is face,
170  /// it is divided in two and spread on each of 6 faces. If it is
171  /// corner, it is divided by 8 and spread along each of 8 corners.
172  void addToCell(int x, int y, int z, const UT_Vector3 &dv);
173 
174  /// Treats this field as a velocity field and advects the given
175  /// position for the given length of time.
176  /// Uses first order explicit euler integration
177  void advect(UT_Vector3 &pos, float time, float cfl = 1.0f) const
178  {
179  SIM_RawField::advect(pos, getXField(), getYField(), getZField(), time, 0, cfl);
180  }
181 
182  /// Uses second order explicit runge-kutta integration.
183  void advectMidpoint(UT_Vector3 &pos, float time, float cfl = 1.0f) const
184  {
185  SIM_RawField::advectMidpoint(pos, getXField(), getYField(), getZField(), time, 0, cfl);
186  }
187 
188  /// Uses third order explicit runge-kutta integration.
189  void advectRK3(UT_Vector3 &pos, float time, float cfl = 1.0f) const
190  {
191  SIM_RawField::advectRK3(pos, getXField(), getYField(), getZField(), time, 0, cfl);
192  }
193 
194  /// Uses fourth order explicit runge-kutta integration.
195  void advectRK4(UT_Vector3 &pos, float time, float cfl = 1.0f) const
196  {
197  SIM_RawField::advectRK4(pos, getXField(), getYField(), getZField(), time, 0, cfl);
198  }
199 
200  /// Advects this field by the other given field. Handles the possibility
201  /// that the other field is this field.
202  void advect(const SIM_VectorField *vel, float timestep,
203  const SIM_RawField *collision,
204  SIM_FieldAdvection advectmethod,
205  float cfl);
206  void advect(sim_PointVelocity getVelocity, float timestep,
207  float voxelsize,
208  const SIM_RawField *collision = 0,
209  float cfl = 1.0f);
210 
211  /// Advects this by the velocity field, storing our min/max
212  /// interpolants into the min/max fields
213  void advectMinMax(SIM_VectorField *minfield,
214  SIM_VectorField *maxfield,
215  const SIM_VectorField *vel, float timestep,
216  const SIM_RawField *collision,
217  SIM_FieldAdvection advectmethod,
218  float cfl);
219 
220  /// Projects the field into the space of non-divergent fields.
221  /// All divergent components of this field are removed.
222  void projectToNonDivergent(const SIM_RawField *pressureboundary = 0, const SIM_RawField *collision = 0, SIM_RawField *pressureout = 0, bool preservebubble = true, const SIM_RawField *goaldiv = 0, SIM_RawIndexField *compout = 0, bool ghostfluid = true, bool variational = true, SIM_RawField::PCG_METHOD pcgmethod = SIM_RawField::PCG_MIC, int numiterforcenter = 20);
223  void projectToNonDivergentCenter(const SIM_RawField *pressureboundary, const SIM_RawField *goaldiv, int numiter);
224  void projectToNonDivergentFace(const SIM_RawField *pressureboundary, const SIM_RawField *collision, SIM_RawField *pressureout = 0, bool preservebubble = true, const SIM_RawField *goaldiv = 0, SIM_RawIndexField *compout = 0, bool ghostfluid = true, bool variational = true, SIM_RawField::PCG_METHOD pcgmethod = SIM_RawField::PCG_MIC);
225 
226  /// Evaluates the divergence field for this velocity field.
227  THREADED_METHOD1_CONST(SIM_VectorField, getField(0)->shouldMultiThread(),
228  buildDivergenceCenter,
229  SIM_RawField &, div)
230  void buildDivergenceCenterPartial(SIM_RawField &div,
232 
233  /// Evaluates the divergence field for this velocity field.
234  THREADED_METHOD1_CONST(SIM_VectorField, getField(0)->shouldMultiThread(),
235  buildDivergenceCorner,
236  SIM_RawField &, div)
237  void buildDivergenceCornerPartial(SIM_RawField &div,
238  const UT_JobInfo &info) const;
239 
240  /// Applies a pressure differential to the given component of our
241  /// velocity field
242  THREADED_METHOD5(SIM_VectorField, getField(axis)->shouldMultiThread(),
243  applyPressureGradientFace,
244  int, axis,
245  const SIM_RawField *, pressure,
246  const SIM_RawField *, surface,
247  const SIM_RawIndexField *, comp,
248  bool, pressureBoundaryAtFace)
249  void applyPressureGradientFacePartial(int axis,
250  const SIM_RawField *pressure,
251  const SIM_RawField *surface,
252  const SIM_RawIndexField *comp,
253  bool pressureBoundaryAtFace,
254  const UT_JobInfo &info);
255 
256 
257  THREADED_METHOD1(SIM_VectorField, getField(0)->shouldMultiThread(),
258  applyPressureGradientCenter,
259  const SIM_RawField *, pressure)
260  void applyPressureGradientCenterPartial(
261  const SIM_RawField *pressure,
262  const UT_JobInfo &info);
263 
264  THREADED_METHOD1(SIM_VectorField, getField(0)->shouldMultiThread(),
265  applyPressureGradientCorner,
266  const SIM_RawField *, pressure)
267  void applyPressureGradientCornerPartial(
268  const SIM_RawField *pressure,
269  const UT_JobInfo &info);
270 
271  /// Distributes any divergence in the boundary condition among
272  /// all voxels equally.
273  void distributeBoundaryDivergenceToVolumeFace(SIM_RawField &div, const SIM_RawField *pressureboundary = 0, int compnum = -1, const SIM_RawIndexField *comp = 0);
274 
275  /// Determines if the given component has any surface cells.
276  /// result should be preloaded with false.
277  THREADED_METHOD6_CONST(SIM_VectorField, div.shouldMultiThread(),
278  hasSurfaceCell,
279  bool *, result,
280  SIM_RawField &, div,
281  const SIM_RawField *, pressureboundary,
282  const SIM_RawField *, collision,
283  int, compnum,
284  const SIM_RawIndexField &, comp)
285  void hasSurfaceCellPartial(bool *result, SIM_RawField &div, const SIM_RawField *pressureboundary, const SIM_RawField *collision, int compnum, const SIM_RawIndexField &comp, const UT_JobInfo &info) const;
286 
287  /// Distributes any divergence in the boundary condition among
288  /// all voxels that are on the boundary of the pressureboundary
289  /// but not on the collision boundary.
290  void distributeBoundaryDivergenceToSurfaceFace(SIM_RawField &div, const SIM_RawField *pressureboundary, const SIM_RawField *collision, int compnum, const UT_VoxelArray<int64> &comp);
291 
292  /// Enforces boundary conditions on the array.
293  /// Boundary line should be given in world space
294  void enforceBoundary(const SIM_ScalarField *collision=0,
295  const SIM_VectorField *cvel = 0,
296  const SIM_VectorField *bvel = 0, // Apply velocity to the SIM_BOUNDARY
297  const SIM_BoundaryLine &worldbline = SIM_BoundaryLine());
298 
299  typedef UT_Vector3 (*ut_velocityCalc)(const UT_Vector3 &pos, void *vp);
300  typedef void (*ut_physParmCalc)(const UT_Vector3 &pos, void *vp,
301  fpreal &bounce,
302  fpreal &friction,
303  fpreal &dynfriction);
304 
305 
306  /// Enforces boundary conditions on a velocity field by making
307  /// sure we are lifting from the surface, allowing tangential
308  /// motion.
309  /// forbidinterference keeps the normal enforcement behaviour of
310  /// explicitly setting all side boundaries that have a inward
311  /// pointing velocity to zero relative motion
312  /// SIM_BoundaryLine is given in world space and allows for an
313  /// open boundary to exist above a "line" in an otherwise closed
314  /// boundary.
315 
316  void enforceVelBoundary(const SIM_ScalarField *collision,
317  ut_velocityCalc calcVelocity,
318  void *vvp,
319  ut_physParmCalc calcPhysParms,
320  void *vpp,
321  bool forbidinterference,
322  const SIM_BoundaryLine &worldbline = SIM_BoundaryLine());
323 
324  /// Enforces boundary conditions on a velocity field by making
325  /// sure we are lifting from the surface, allowing tangential
326  /// motion.
327  /// forbidinterference keeps the normal enforcement behaviour of
328  /// explicitly setting all side boundaries that have a inward
329  /// pointing velocity to zero relative motion.
330  void enforceVelBoundaryVariational(const SIM_ScalarField *collision,
331  const SIM_VectorField *weights,
332  ut_velocityCalc calcVelocity,
333  void *vvp,
334  ut_physParmCalc calcPhysParms,
335  void *vpp,
336  bool threadsafe,
337  fpreal bandwidth);
338 
340  {
341  public:
342  SIM_RawField *u;
343  const SIM_VectorField *velocity;
345  ut_velocityCalc calcVelocity;
346  void *vvp;
347  ut_physParmCalc calcPhysParms;
348  void *vpp;
349  const SIM_RawField *weights;
351  int axis;
352  };
353 
354  THREADED_METHOD1(SIM_VectorField, parms.u->shouldMultiThread(),
355  enforceVelBoundaryVariationalAxis,
357 
358 
359  void enforceVelBoundaryVariationalAxisPartial(
361  const UT_JobInfo &info);
362 
363  /// Converts an integer index into a worldspace position.
364  bool indexToPos(int axis, int x, int y, int z, UT_Vector3 &pos) const;
365 
366  /// Converts a worldspace position into an integer index.
367  bool posToIndex(int axis, const UT_Vector3 &pos, int &x, int &y, int &z) const;
368 
369  /// Retrieve raw field.
370  SIM_RawField *getField(int axis) const { return myFields[axis]; }
371  SIM_RawField *getXField() const { return myFields[0]; }
372  SIM_RawField *getYField() const { return myFields[1]; }
373  SIM_RawField *getZField() const { return myFields[2]; }
374 
375  /// Sets the field to the given field, gaining ownership of it.
376  /// The new field must already match the field it will replace.
377  void setField(int axis, SIM_RawField *field);
378 
379  /// True if we contain any NANs
380  bool hasNan() const
381  { return getField(0)->hasNan() || getField(1)->hasNan() || getField(2)->hasNan(); }
382 
383  /// True if we have a constant value. Ignores end conditions
384  /// in determining this. Used as a rough guess that the field
385  /// is unused.
386  bool appearsToBeUnused() const
387  {
388  for (int i = 0; i < 3; i++)
389  if (!getField(i)->field()->isConstant(0)) return false;
390  return true;
391  }
392 
393  /// Steals the field, replacing this copy with an empty field and
394  /// returning the old version.
395  SIM_RawField *stealField(int axis);
396 
397  void testForNan() const;
398 
400  {
401  testForNan();
403  }
404 
406  { for (int i = 0; i < 3; i++) getField(i)->markGridAsChanged(); }
407 
408  /// Recomputes total number of voxels to be stored
409  /// on our options data for ease of reading
410  void updateTotalVoxels();
411 
412  /// Creates a GDP with us as a Volume Primitive inside it.
413  GU_ConstDetailHandle createSmokeRepresentation(const SIM_RootData &root) const;
414 
415  /// Adds a volume primitive version of our field to the given
416  /// gdp.
417  void addSmokeRepresentation(const SIM_RootData &root, GU_Detail *gdp) const;
418 
419 protected:
420  explicit SIM_VectorField(const SIM_DataFactory *factory);
421  virtual ~SIM_VectorField();
422 
423  /// Overrides to properly implement this class as a SIM_Data.
424  virtual void initializeSubclass();
425  /// myField aware copy constructor.
426  virtual void makeEqualSubclass(const SIM_Data *source);
427 
428  /// Saves our attributes, and our internal data if it has been set.
429  virtual void saveSubclass(std::ostream &os) const;
430  /// Loads our attributes and internal data if it was set when we saved.
431  virtual bool loadSubclass(UT_IStream &is);
432 
433  virtual int64 getMemorySizeSubclass() const;
434 
435  /// Override the setDivisions to rebuild our voxel array on demand.
436  virtual void optionChangedSubclass(const char *name);
437 
438 private:
439  static const SIM_DopDescription *getVectorFieldDopDescription();
440 
441  SIM_RawField *myFields[3];
442 
443  void rebuildFields();
444 
446 
448  SIM_Data,
449  "VectorField",
450  getVectorFieldDopDescription());
451 };
452 #endif
453 
#define SIM_NAME_VOXELPLANE
Definition: SIM_Names.h:217
#define SIM_NAME_POSITIONPATH
Definition: SIM_Names.h:168
virtual void makeEqualSubclass(const SIM_Data *source)
bool appearsToBeUnused() const
#define SIM_NAME_VOXELSAMPLE
Definition: SIM_Names.h:216
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
GA_API const UT_StringHolder div
SIM_RawField * getField(int axis) const
Retrieve raw field.
virtual bool loadSubclass(UT_IStream &is)
#define SIM_NAME_TOLERANCE
Definition: SIM_Names.h:201
#define THREADED_METHOD6_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6)
virtual void optionChangedSubclass(const char *name)
static void advectRK3(UT_Vector3 &pos, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision=0, float cfl=1.0F)
Advect a point with TVD-RK3 method.
const UT_Vector3 & getVoxelSize(int axis) const
#define GETSET_DATA_FUNCS_B(DataName, FuncName)
#define SIM_NAME_DIRECTION
Definition: SIM_Names.h:101
#define SIM_NAME_CENTER
Definition: SIM_Names.h:82
#define THREADED_METHOD1(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
#define GETSET_DATA_FUNCS_S(DataName, FuncName)
#define SIM_NAME_DIV
Definition: SIM_Names.h:108
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
bool isSelfAligned() const
True if our internal fields are aligned.
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
virtual int64 getMemorySizeSubclass() const
static void advectRK4(UT_Vector3 &pos, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision=0, float cfl=1.0F)
Advect a point with TVD-RK4 method.
UT_VoxelBorderType
Definition: UT_VoxelArray.h:69
static void advectMidpoint(UT_Vector3 &pos, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision=0, float cfl=1.0F)
Advect a point with the midpoint method.
GLint y
Definition: glcorearb.h:102
This class holds a three dimensional scalar field.
SIM_RawField rawfield_type
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
void setBorder(UT_VoxelBorderType border)
png_uint_32 i
Definition: png.h:2877
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
GLsizeiptr size
Definition: glcorearb.h:663
SIM_FieldSample
Definition: SIM_RawField.h:38
UT_Vector3(* sim_PointVelocity)(const UT_Vector3 &, int)
Definition: SIM_RawField.h:95
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
#define SIM_NAME_SIZE
Definition: SIM_Names.h:183
void pubHandleModification()
long long int64
Definition: SYS_Types.h:100
GLfloat f
Definition: glcorearb.h:1925
UT_Vector3 getVoxelSize() const
int64 exint
Definition: SYS_Types.h:109
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
virtual void saveSubclass(std::ostream &os) const
#define SIM_NAME_UNIFORMVOXELS
Definition: SIM_Names.h:207
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
#define SIM_NAME_TWOD
Definition: SIM_Names.h:206
bool isMatching(const SIM_VectorField *field) const
GLuint const GLchar * name
Definition: glcorearb.h:785
UT_VoxelBorderType getBorder() const
UT_Vector3 getOrig() const
This class holds a three dimensional tensor field.
SIM_RawField * getYField() const
SIM_RawField * getZField() const
bool isFaceSampled() const
#define THREADED_METHOD1_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
bool hasNan() const
True if we contain any NANs.
static void advect(UT_Vector3 &pos, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision=0, float cfl=1.0F)
Verbs that can be performed on these fields.
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
double fpreal
Definition: SYS_Types.h:263
GLint GLint GLsizei GLint border
Definition: glcorearb.h:107
void handleModification(int code=-1)
bool isCenterSampled() const
SIM_FieldAdvection
Definition: SIM_RawField.h:60
#define SIM_API
Definition: SIM_API.h:10
GLint GLenum GLint x
Definition: glcorearb.h:408
This class holds a three dimensional scalar field.
void advectRK3(UT_Vector3 &pos, float time, float cfl=1.0f) const
Uses third order explicit runge-kutta integration.
void advect(UT_Vector3 &pos, float time, float cfl=1.0f) const
#define const
Definition: zconf.h:214
SIM_RawField * getXField() const
fpreal getVoxelDiameter(int axis) const
This class holds a three dimensional vector field.
void advectRK4(UT_Vector3 &pos, float time, float cfl=1.0f) const
Uses fourth order explicit runge-kutta integration.
virtual void initializeSubclass()
void advectMidpoint(UT_Vector3 &pos, float time, float cfl=1.0f) const
Uses second order explicit runge-kutta integration.