HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_RawField Class Reference

#include <SIM_RawField.h>

Classes

struct  sim_advectParms
 
struct  sim_extrapolateCacheElem
 
struct  sim_extrapolateFromIndexParms
 
struct  sim_particleToFieldParms
 

Public Types

enum  REDUCE_NAMES {
  REDUCE_MAX, REDUCE_MIN, REDUCE_AVERAGE, REDUCE_SUM,
  REDUCE_SUMABS, REDUCE_SUMSQUARE, REDUCE_RMS, REDUCE_MEDIAN,
  REDUCE_MAXABS, REDUCE_MINABS
}
 Types of reductions supported by reduceOp. More...
 
enum  MIX_NAMES {
  MIX_COPY, MIX_ADD, MIX_SUB, MIX_MUL,
  MIX_DIV, MIX_MAX, MIX_MIN, MIX_AVERAGE,
  NUM_MIX
}
 
enum  PCG_METHOD { PCG_NONE, PCG_JACOBI, PCG_CHOLESKY, PCG_MIC }
 
typedef fpreal32 ScalarType
 

Public Member Functions

 SIM_RawField ()
 
virtual ~SIM_RawField ()
 
 SIM_RawField (const SIM_RawField &src)
 Copy constructor: More...
 
const SIM_RawFieldoperator= (const SIM_RawField &src)
 Assigment operator: More...
 
void init (SIM_FieldSample sample, const UT_Vector3 &orig, const UT_Vector3 &size, int xres, int yres, int zres)
 
void init (SIM_FieldSample sample, const UT_Vector3 &orig, const UT_Vector3 &size, int xres, int yres, int zres, const UT_Vector3 &voxelsize)
 
void init (SIM_FieldSample sample, const UT_Vector3 &orig, const UT_Vector3 &size, UT_VoxelArrayF *voxels)
 
void init (SIM_FieldSample sample, const UT_Vector3 &orig, const UT_Vector3 &size, UT_VoxelArrayF *voxels, const UT_Vector3 &voxelsize)
 
void getPartialRange (UT_VoxelArrayIteratorF &vit, const UT_JobInfo &info) const
 
bool shouldMultiThread () const
 Returns true if this should be multithreaded. More...
 
void match (const SIM_RawField &src)
 
void match (const SIM_RawIndexField &src)
 
void makeConstant (float cval)
 Initializes this field to a constant value. More...
 
void resample (SIM_FieldSample sample, const SIM_RawField *src)
 
void getSamplePattern (SIM_FieldSample sample, int x, int y, int z, int &numsample, int *ix, int *iy, int *iz, bool clamp) const
 
UT_Vector3 getSampleVoxelOffset (SIM_FieldSample sample) const
 
void extrapolate (const SIM_RawField *depths, const SIM_RawField *valid, fpreal isocontour, fpreal dir, fpreal maxdist, bool clamp, fpreal clampval)
 
void extrapolateFromIndex (const SIM_RawField *depths, const SIM_RawIndexField *index, const SIM_RawField *collision, const SIM_RawField *valid, const GU_Detail *gdp, const UT_DMatrix4 &xform, fpreal isocontour, fpreal isotol, fpreal dir, fpreal maxdist, bool clamp, fpreal clampval)
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), extrapolateFromIndexInternal, sim_extrapolateFromIndexParms &, parms)
 
void extrapolateFromIndexInternalPartial (sim_extrapolateFromIndexParms &p, const UT_JobInfo &info)
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), moveAlongCurvature, fpreal, b_val, const SIM_RawField &, source, fpreal, timestep) void moveAlongCurvaturePartial(fpreal b_val
 
void moveAlongCurvature (fpreal amount, fpreal cflcond, int miniter, int maxiter)
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), moveAlongNormal, const SIM_RawField &, speed, const SIM_RawField &, source, fpreal, timestep, fpreal, bandwidth) void moveAlongNormalPartial(const SIM_RawField &speed
 
void moveAlongNormalMidpoint (const SIM_RawField &speed, const SIM_RawField &source, fpreal timestep, fpreal bandwidth)
 
void reinitializeSignedDistance (int maxiter, bool usemidpoint, fpreal bandwidth)
 
void negatePartial (const UT_JobInfo &info)
 Negates all values in this field. More...
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), scale, fpreal, scale) void scalePartial(fpreal scale
 Scales all values in this field. More...
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), maximum, const SIM_RawField *, other) void maximumPartial(const SIM_RawField *other
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), minimum, const SIM_RawField *, other) void minimumPartial(const SIM_RawField *other
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), average, const SIM_RawField &, other) void averagePartial(const SIM_RawField &other
 
 THREADED_METHOD3_CONST (SIM_RawField, shouldMultiThread(), sumPerComponent, UT_DoubleArray &, result, UT_Int64Array &, activevoxels, const SIM_RawIndexField *, comp) void sumPerComponentPartial(UT_DoubleArray &result
 
 THREADED_METHOD5_CONST (SIM_RawField, shouldMultiThread(), sumComponent, double &, result, int64 &, activevoxels, int, compnum, const SIM_RawIndexField *, comp, const SIM_RawField *, pressureboundary) void sumComponentPartial(double &result
 
 THREADED_METHOD2 (SIM_RawField, shouldMultiThread(), addValuePerComponent, const UT_DoubleArray &, valuelist, const SIM_RawIndexField *, comp) void addValuePerComponentPartial(const UT_DoubleArray &valuelist
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), addValueToComponent, double, value, int, compnum, const SIM_RawIndexField *, comp, const SIM_RawField *, pressureboundary) void addValueToComponentPartial(double value
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), setScaleAdd, const SIM_RawField &, A, fpreal, scale, const SIM_RawField &, B) void setScaleAddPartial(const SIM_RawField &A
 
 THREADED_METHOD2 (SIM_RawField, shouldMultiThread(), smearedSign, const SIM_RawField &, sdf, fpreal, bandwidth) void smearedSignPartial(const SIM_RawField &sdf
 
void convertToHeavisidePartial (const UT_JobInfo &info)
 
fpreal toHeaviside (fpreal val) const
 Defines width as maxcomponent of our voxels. More...
 
fpreal fromHeaviside (fpreal val) const
 
fpreal reduceOp (REDUCE_NAMES op) const
 
fpreal average () const
 Prebuilt versions. More...
 
void localReduceOp (REDUCE_NAMES op, const UT_Vector3 &radius)
 
void boxBlur (float radius)
 
fpreal reduceMaskedOp (REDUCE_NAMES op, const SIM_RawField *mask, bool maskissdf) const
 
fpreal findProportionalValue (fpreal position, const SIM_RawField *mask, bool maskissdf) const
 
bool isMatching (const SIM_RawField *field) const
 
bool isMatching (const SIM_RawIndexField *field) const
 
bool isAligned (const SIM_RawField *field) const
 
bool isAligned (const SIM_RawIndexField *field) const
 
bool isAligned (const GEO_PrimVolume *vold) const
 
bool isColocated (const SIM_RawField *field, UT_Vector3I &offset) const
 
bool isColocated (const SIM_RawIndexField *field, UT_Vector3I &offset) const
 
bool isColocated (const GEO_Primitive *prim, UT_Vector3I &offset) const
 
bool hasNan () const
 Returns true if our field has any NANs. More...
 
void testForNan () const
 
const UT_VoxelArrayFfield () const
 Fetches the raw field. More...
 
UT_VoxelArrayFfieldNC () const
 
CE_Gridgrid () const
 Fetches the compute grid, returns 0 if not present. More...
 
CE_GridrequireGrid () const
 Fetches the compute grid but throws cl::Error() on failure. More...
 
void markGridAsChanged ()
 Mark the field as out of date, but only if we have a valid grid. More...
 
void clearGrid () const
 
bool gridIsAuthoritative () const
 Returns true if the OpenCL grid has more up-to-date data than the voxel array. More...
 
void updateGridFromField () const
 Copies our field into the grid. More...
 
void updateFieldFromGrid () const
 Copies our grid into our field. More...
 
UT_VoxelArrayFsteal ()
 
void adopt (UT_VoxelArrayF *newf)
 
const UT_Vector3getOrig () const
 
const UT_Vector3getSize () const
 
const UT_Vector3getBBoxOrig () const
 
const UT_Vector3getBBoxSize () const
 
const UT_Vector3getVoxelSize () const
 
void setVoxelSize (const UT_Vector3 &voxelsize)
 
fpreal getVoxelDiameter () const
 
fpreal getVoxelVolume () const
 
SIM_FieldSample getSample () const
 
int64 getMemoryUsage () const
 
void getVoxelRes (int &xres, int &yres, int &zres) const
 
UT_Vector3I getVoxelRes () const
 
exint getXRes () const
 
exint getYRes () const
 
exint getZRes () const
 
fpreal getValue (UT_Vector3 pos) const
 Functions to resolve quantities about the field. More...
 
fpreal getValueIndex (UT_Vector3I index) const
 Returns the field value at the given voxel. More...
 
fpreal getCellValue (int x, int y, int z) const
 Returns an averaged value for the center of the given voxel. More...
 
void addToCell (int x, int y, int z, fpreal v)
 
void setCellValue (int x, int y, int z, fpreal v)
 
UT_Vector3 getGradient (UT_Vector3 pos) const
 
UT_Vector3 getGradientAtIndex (int x, int y, int z) const
 
fpreal64 getLaplacian (UT_Vector3 pos) const
 
fpreal64 getLaplacianAtIndex (int x, int y, int z) const
 
fpreal64 getCurvature (UT_Vector3 pos) const
 
fpreal64 getCurvatureAtIndex (int x, int y, int z) const
 
fpreal64 getCurvatureTimesGradAtIndex (int x, int y, int z) const
 
fpreal64 calculateHJWENO (fpreal64 v1, fpreal64 v2, fpreal64 v3, fpreal64 v4, fpreal64 v5) const
 
fpreal64 calculateDerivative (int x, int y, int z, int axis, bool positivegradient) const
 
SIM_BoundaryLine boundaryLineToIndex (const SIM_BoundaryLine &worldbline) const
 
bool indexToPos (int x, int y, int z, UT_Vector3 &pos) const
 
bool indexToPos (exint x, exint y, exint z, UT_Vector3D &pos) const
 
bool indexToPos (UT_Vector3I index, UT_Vector3 &pos) const
 
UT_Vector3 indexToPos (UT_Vector3I index) const
 
bool posToIndex (UT_Vector3 pos, int &x, int &y, int &z) const
 Converts a worldspace position into an integer index. More...
 
bool posToIndex (UT_Vector3 wpos, UT_Vector3 &ipos) const
 
UT_Vector3I posToIndex (UT_Vector3 pos) const
 
bool posToIndex (UT_Vector3 pos, int &x, int &y, int &z, fpreal &dx, fpreal &dy, fpreal &dz) const
 
bool cellIndexToPos (int x, int y, int z, UT_Vector3 &pos) const
 
bool posToCellIndex (UT_Vector3 pos, int &x, int &y, int &z) const
 
bool movePtToIso (UT_Vector3 &pos, fpreal goaliso, fpreal maxtime, fpreal tol=1e-4) const
 
void advect (const SIM_RawField *source, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision, SIM_FieldAdvection advectmethod, float cfl)
 
void advectMinMax (const SIM_RawField *source, SIM_RawField *minf, SIM_RawField *maxf, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision, SIM_FieldAdvection advectmethod, float cfl)
 
 THREADED_METHOD7 (SIM_RawField, shouldMultiThread(), advectSingle, const SIM_RawField *, source, const SIM_RawField *, velx, const SIM_RawField *, vely, const SIM_RawField *, velz, float, time, const SIM_RawField *, collision, float, cfl) void advectSinglePartial(const SIM_RawField *source
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), advectSingleMinMax, const sim_advectParms &, parms) void advectSingleMinMaxPartial(const sim_advectParms &parms
 
 THREADED_METHOD7 (SIM_RawField, shouldMultiThread(), advectTrace, const SIM_RawField *, source, const SIM_RawField *, velx, const SIM_RawField *, vely, const SIM_RawField *, velz, float, time, const SIM_RawField *, collision, float, cfl) void advectTracePartial(const SIM_RawField *source
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), advectTraceMinMax, const sim_advectParms &, parms) void advectTraceMinMaxPartial(const sim_advectParms &parms
 
 THREADED_METHOD8 (SIM_RawField, shouldMultiThread(), advectMultistep, const SIM_RawField *, source, const SIM_RawField *, velx, const SIM_RawField *, vely, const SIM_RawField *, velz, float, time, const SIM_RawField *, collision, float, cfl, SIM_FieldAdvection, advectmethod) void advectMultistepPartial(const SIM_RawField *source
 
 THREADED_METHOD1 (SIM_RawField, shouldMultiThread(), advectMultistepMinMax, const sim_advectParms &, parms) void advectMultistepMinMaxPartial(const sim_advectParms &parms
 
 THREADED_METHOD5 (SIM_RawField, shouldMultiThread(), advectHJWENO, const SIM_RawField &, source, const SIM_RawField *, velx, const SIM_RawField *, vely, const SIM_RawField *, velz, fpreal, timestep) void advectHJWENOPartial(const SIM_RawField &source
 Advects the field using HJWENO. More...
 
 THREADED_METHOD5 (SIM_RawField, shouldMultiThread(), advectUpwind, const SIM_RawField &, source, const SIM_RawField *, velx, const SIM_RawField *, vely, const SIM_RawField *, velz, fpreal, timestep) void advectUpwindPartial(const SIM_RawField &source
 Advects the field using upwind. More...
 
 THREADED_METHOD5 (SIM_RawField, shouldMultiThread(), buoyancy, const SIM_RawField *, stencil, const SIM_RawField *, temperature, fpreal, up, fpreal, Tamb, fpreal, buoyancy) void buoyancyPartial(const SIM_RawField *stencil
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), applyParticles, const GU_Detail *, particles, GEO_PointTreeGAOffset *, pttree, sim_particleToFieldParms &, parms) void applyParticlesPartial(const GU_Detail *particles
 
void accumulateParticles (const GU_Detail *particles, sim_particleToFieldParms &parms, const GA_PointGroup *ptgrp=NULL)
 
 THREADED_METHOD6 (SIM_RawField, shouldMultiThread(), advect2, const SIM_RawField *, source, sim_PointVelocity, getVelocity, float, time, float, voxelsize, const SIM_RawField *, collision, float, cfl) void advect2Partial(const SIM_RawField *source
 
void advectSelf (const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision, SIM_FieldAdvection advectmethod, float cfl)
 
void advectSelf (sim_PointVelocity getVelocity, float time, float voxelsize, const SIM_RawField *collision, float cfl)
 
void advectMinMaxSelf (SIM_RawField *minfield, SIM_RawField *maxfield, const SIM_RawField *velx, const SIM_RawField *vely, const SIM_RawField *velz, float time, const SIM_RawField *collision, SIM_FieldAdvection advectmethod, float cfl)
 Like advectSelf, but also generates min/max fields. More...
 
void diffuse (fpreal diffrate, int numiter, const SIM_RawField *collision=0)
 
void computeConnectedComponents (UT_VoxelArray< int64 > &comp, int &numcomponent) const
 Determine all components connected according to < 0 semantic. More...
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), buildDivergenceFace, const SIM_VectorField *, vel, const SIM_RawField *, surface, const SIM_RawField *, stencil) void buildDivergenceFacePartial(const SIM_VectorField *vel
 
void solvePressure (const SIM_RawField *divergence, const SIM_RawField *collision, int numiter=20)
 
void solvePressurePCG (const SIM_RawField &divergence, SIM_RawIndexField &index, SIM_VectorField *vel, const SIM_RawIndexField *comp=0, const UT_IntArray *expandable=0, const SIM_RawField *surface=0, bool variational=true, bool ghostfluid=true, PCG_METHOD pcgmethod=PCG_MIC)
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), gaussSeidelIteration, const SIM_RawField *, B, fpreal32, weight, fpreal32, sumweight, int, parity) void gaussSeidelIterationPartial(const SIM_RawField *B
 
 THREADED_METHOD4_CONST (SIM_RawField, shouldMultiThread(), gaussSeidelIterationFlat, fpreal32 *, A, fpreal32, weight, fpreal32, sumweight, int, parity) void gaussSeidelIterationFlatPartial(fpreal32 *A
 
 THREADED_METHOD4_CONST (SIM_RawField, shouldMultiThread(), gaussSeidelIterationFlat2D, fpreal32 *, A, fpreal32, weight, fpreal32, sumweight, int, parity) void gaussSeidelIterationFlat2DPartial(fpreal32 *A
 
void enforceBoundary (SIM_FieldBoundary collisionboundary=SIM_BOUNDARY_NONE, const SIM_RawField *collision=0, const SIM_RawField *cvalue=0, const SIM_RawField *boundary=0, const SIM_BoundaryLine &indexbline=SIM_BoundaryLine())
 
void enforceCollisionBoundary (SIM_FieldBoundary boundary, const SIM_RawField *collision, const SIM_RawField *cvalue=0)
 
void enforceSideBoundary (int axis, int side, SIM_FieldBoundary bound, fpreal boundaryvalue, const SIM_BoundaryLine &indexbline=SIM_BoundaryLine(), const SIM_RawField *boundaryfield=0)
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), enforceCollisionBoundaryInternal, SIM_FieldBoundary, boundary, const SIM_RawField *, collision, const SIM_RawField *, cvalue) void enforceCollisionBoundaryInternalPartial(SIM_FieldBoundary boundary
 
void enforceBoundaryFlat (fpreal32 *values, const SIM_RawIndexField *collision_lookup)
 
 THREADED_METHOD2 (SIM_RawField, shouldMultiThread(), enforceCollisionBoundaryFlat, fpreal32 *, values, const SIM_RawIndexField *, collision_lookup) void enforceCollisionBoundaryFlatPartial(fpreal32 *values
 
void enforceSideBoundaryFlat (fpreal32 *values, int axis, int side, SIM_FieldBoundary bound, fpreal boundval)
 
void setBoundary (int axis, int side, SIM_FieldBoundary bound)
 
SIM_FieldBoundary getBoundary (int axis, int side) const
 
void setBoundaryValue (int axis, int side, fpreal v)
 
fpreal getBoundaryValue (int axis, int side) const
 
void setAsExtrapolatedField (UT_Vector3 scale)
 
UT_VoxelBorderType getBorder () const
 
float getBorderValue () const
 
void setBorder (UT_VoxelBorderType border, float bval)
 
void setCompressionOptions (const UT_VoxelCompressOptions &options)
 These adjust the native UT_VoxelArray comrpression options. More...
 
const UT_VoxelCompressOptionsgetCompressionOptions () const
 
void setCompressionTolerance (fpreal tol)
 These adjust the native UT_VoxelArray comrpression tolerance.. More...
 
fpreal getCompressionTolerance () const
 
void waveletTransform (UT_Wavelet::WAVELET_NAMES wavelettype, const SIM_RawField *field, int maxpasses=-1)
 
void waveletInverseTransform (UT_Wavelet::WAVELET_NAMES wavelettype, const SIM_RawField *wavelet, int maxpasses=-1)
 
void waveletComputePSD (const SIM_RawField *wavelet, int level)
 Computes the sum of squares of the given level's detail vector. More...
 
void waveletExtractComponent (const SIM_RawField *wavelet, int level, int component)
 Extracts the given component from a packed wavelet array. More...
 
void buildFromPrim (const GEO_Primitive *vol, int volidx, const UT_DMatrix4 &xform, fpreal scale)
 
void buildFromGeo (const GEO_PrimVolume *vol, const UT_DMatrix4 &xform, fpreal scale)
 Builds from a GEO_PrimVolume. More...
 
void computeSDFWeightsSampled (const SIM_RawField *sdf, int samplesperaxis, bool invert, fpreal minweight, fpreal dilatedist=0)
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), computeSDFWeightsFace, const SIM_RawField *, sdf, int, axis, bool, invert, fpreal, minweight)
 
void computeSDFWeightsFacePartial (const SIM_RawField *sdf, int axis, bool invert, fpreal minweight, const UT_JobInfo &info)
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), computeSDFWeightsVolumeFraction, const SIM_RawField *, sdf, bool, invert, fpreal, minweight)
 
void computeSDFWeightsVolumeFractionPartial (const SIM_RawField *sdf, bool invert, fpreal minweight, const UT_JobInfo &info)
 
fpreal computeVoxelSDFWeightFace (int x, int y, int z, const SIM_RawField *sdf, int axis) const
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), setScaleDivideThreshold, fpreal, scale, const SIM_RawField *, B, const SIM_RawField *, C, fpreal, threshold) void setScaleDivideThresholdPartial(fpreal scale
 

Static Public Member Functions

static fpreal toHeaviside (fpreal val, fpreal diam)
 Perform heaviside & inverse heaviside in a consistent fashion. More...
 
static fpreal fromHeaviside (fpreal val, fpreal diam)
 
static fpreal64 getCurvatureAtProbe (UT_VoxelROProbeCubeF &probe, const UT_Vector3 &invvoxelsize)
 Computes the curvature according to a 3^3 voxel probe. More...
 
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. More...
 
static void advect (UT_Vector3 &pos, sim_PointVelocity getVelocity, float time, float voxelsize, int jobnum=0, const SIM_RawField *collision=0, float cfl=1.0F)
 
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. More...
 
static void advectMidpoint (UT_Vector3 &pos, sim_PointVelocity getVelocity, float time, float voxelsize, int jobnum=0, const SIM_RawField *collision=0, float cfl=1.0F)
 
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. More...
 
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. More...
 
static fpreal mixValues (MIX_NAMES mixtype, fpreal d, fpreal s)
 Performs the requires mixing. More...
 
static fpreal applyParticleToFieldParms (fpreal srcval, fpreal dstval, const sim_particleToFieldParms &parms)
 
static void diffuse (float *dstdata, const float *srcdata[3][3][3], float b, float ivsx, float ivsy, float ivsz, int tx, int ty, int max_xtile, int max_ytile, int max_xvox, int max_yvox)
 Raw diffuse algorithm, exposed only for external performance tests. More...
 

Public Attributes

const SIM_RawFieldsource
 
const SIM_RawField fpreal timestep
 
const SIM_RawField fpreal
const UT_JobInfo
jobinfo
 
const SIM_RawField fpreal fpreal bandwidth
 
const SIM_RawField fpreal
fpreal const UT_JobInfo
info
 
const UT_JobInfoinfo
 
const UT_JobInfojobinfo
 
UT_Int64Arrayactivevoxels
 
UT_Int64Array const
SIM_RawIndexField
comp
 
UT_Int64Array const
SIM_RawIndexField const
UT_JobInfo &info 
const { localReduceAxisOp<2>(op, dst, field, radius, info)
 
int64activevoxels
 
int64 int compnum
 
int64 int const SIM_RawIndexFieldcomp
 
int64 int const
SIM_RawIndexField const
SIM_RawField
pressureboundary
 
int64 int const
SIM_RawIndexField const
SIM_RawField const UT_JobInfo
&info 
const
 
const SIM_RawIndexFieldcomp
 
const SIM_RawIndexField const
UT_JobInfo
info
 
int compnum
 
int const SIM_RawIndexFieldcomp
 
int const SIM_RawIndexField
const SIM_RawField
pressureboundary
 
int const SIM_RawIndexField
const SIM_RawField const
UT_JobInfo
info
 
fpreal scale
 
fpreal const SIM_RawFieldB
 
fpreal const SIM_RawField
const UT_JobInfo
jobinfo
 
fpreal bandwidth
 
fpreal const UT_JobInfoinfo
 
const SIM_RawFieldvelx
 
const SIM_RawField const
SIM_RawField
vely
 
const SIM_RawField const
SIM_RawField const
SIM_RawField
velz
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float 
time
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float const
SIM_RawField
collision
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float const
SIM_RawField float 
cfl
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float const
SIM_RawField float const
UT_JobInfo
info
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float const
SIM_RawField float
SIM_FieldAdvection 
advectmethod
 
const SIM_RawField const
SIM_RawField const
SIM_RawField float const
SIM_RawField float
SIM_FieldAdvection const
UT_JobInfo
info
 
const SIM_RawField const
SIM_RawField const
SIM_RawField fpreal 
timestep
 
const SIM_RawField const
SIM_RawField const
SIM_RawField fpreal const
UT_JobInfo
info
 
const SIM_RawFieldtemperature
 
const SIM_RawField fpreal up
 
const SIM_RawField fpreal fpreal Tamb
 
const SIM_RawField fpreal
fpreal fpreal 
buoyancy
 
const SIM_RawField fpreal
fpreal fpreal const UT_JobInfo
info
 
GEO_PointTreeGAOffsetpttree
 
GEO_PointTreeGAOffset
sim_particleToFieldParms
parms
 
GEO_PointTreeGAOffset
sim_particleToFieldParms const
UT_JobInfo
info
 
sim_PointVelocity getVelocity
 
sim_PointVelocity float time
 
sim_PointVelocity float float voxelsize
 
sim_PointVelocity float float
const SIM_RawField
collision
 
sim_PointVelocity float float
const SIM_RawField float 
cfl
 
sim_PointVelocity float float
const SIM_RawField float const
UT_JobInfo
info
 
const SIM_RawFieldsurface
 
const SIM_RawField const
SIM_RawField
stencil
 
const SIM_RawField const
SIM_RawField const UT_JobInfo
info
 
fpreal32 weight
 
fpreal32 fpreal32 sumweight
 
fpreal32 fpreal32 int parity
 
fpreal32 fpreal32 int const
UT_JobInfo
info
 
fpreal32 fpreal32 int const
UT_JobInfo &info 
const
 
const SIM_RawFieldcollision
 
const SIM_RawField const
SIM_RawField
cvalue
 
const SIM_RawIndexFieldcollision_lookup
 
const SIM_RawFieldB
 
const SIM_RawField const
SIM_RawField
C
 
const SIM_RawField const
SIM_RawField fpreal 
threshold
 
const SIM_RawField const
SIM_RawField fpreal const
UT_JobInfo
jobinfo
 

Protected Member Functions

void waveletRebuildFromVoxelArray (UT_VoxelArrayF *array, float scale)
 
 THREADED_METHOD2_CONST (SIM_RawField, shouldMultiThread(), reduceOpInternal, fpreal64 *, sum, REDUCE_NAMES, op) void reduceOpInternalPartial(fpreal64 *sum
 
 THREADED_METHOD5_CONST (SIM_RawField, shouldMultiThread(), reduceMaskedOpInternal, fpreal64 *, sum, fpreal64 *, masktotal, REDUCE_NAMES, op, const SIM_RawField *, mask, bool, maskissdf) void reduceMaskedOpInternalPartial(fpreal64 *sum
 
void sortAllVoxels (UT_FloatArray &voxelvalues) const
 
void sortAllVoxelsMasked (UT_FloatArray &voxelvalues, const SIM_RawField *maskfield, bool maskissdf) const
 
 THREADED_METHOD8 (SIM_RawField, shouldMultiThread(), buildExtrapList, UT_Array< UT_ValArray< gu_sdf_qelem * > > &, lists, const SIM_RawField *, depths, const SIM_RawField *, valid, fpreal, isocontour, fpreal, dir, fpreal, maxdist, bool, clamp, fpreal, clampval) void buildExtrapListPartial(UT_Array< UT_ValArray< gu_sdf_qelem * > > &lists
 Methods for extrapolation. More...
 
void localReduceByAxis (REDUCE_NAMES op, UT_VoxelArrayF &dst, UT_VoxelArrayF &field, UT_Vector3 radius) const
 
template<int AXIS, REDUCE_NAMES OP>
void localReduceAxis (UT_VoxelArrayF &dstfield, const UT_VoxelArrayF &field, float radius, const UT_JobInfo &info) const
 Reduce along a given axis by the specified radius in voxels. More...
 
template<int AXIS, REDUCE_NAMES OP>
void localMinMaxAxis (UT_VoxelArrayF &dstfield, const UT_VoxelArrayF &field, float radius, const UT_JobInfo &info) const
 
template<int AXIS>
void localReduceAxisOp (REDUCE_NAMES op, UT_VoxelArrayF &dstfield, UT_VoxelArrayF &field, float radius, const UT_JobInfo &info) const
 
 THREADED_METHOD4_CONST (SIM_RawField, field.getTileRes(1)*field.getTileRes(2) > 1, localReduceAxisX, REDUCE_NAMES, op, UT_VoxelArrayF &, dst, UT_VoxelArrayF &, field, float, radius) void localReduceAxisXPartial(REDUCE_NAMES op
 Again a triple specialization to engage threading. More...
 
UT_VoxelArrayF UT_VoxelArrayF
float const UT_JobInfo &info
const 
localReduceAxisOp (op, dst, field, radius, info)
 
 THREADED_METHOD4_CONST (SIM_RawField, field.getTileRes(0)*field.getTileRes(2) > 1, localReduceAxisY, REDUCE_NAMES, op, UT_VoxelArrayF &, dst, UT_VoxelArrayF &, field, float, radius) void localReduceAxisYPartial(REDUCE_NAMES op
 
 THREADED_METHOD4_CONST (SIM_RawField, field.getTileRes(0)*field.getTileRes(1) > 1, localReduceAxisZ, REDUCE_NAMES, op, UT_VoxelArrayF &, dst, UT_VoxelArrayF &, field, float, radius) void localReduceAxisZPartial(REDUCE_NAMES op
 
 THREADED_METHOD3 (SIM_RawField, shouldMultiThread(), buildFromGeoSampled, const GEO_PrimVolume *, vol, const UT_DMatrix4 &, xform, fpreal, scale) void buildFromGeoSampledPartial(const GEO_PrimVolume *vol
 
 THREADED_METHOD4 (SIM_RawField, shouldMultiThread(), buildFromVDBSampled, const GEO_PrimVDB *, vdb, int, vdbidx, const UT_DMatrix4 &, xform, fpreal, scale) void buildFromVDBSampledPartial(const GEO_PrimVDB *vdb
 

Static Protected Member Functions

static fpreal applyBoundary (SIM_FieldBoundary bound, fpreal v, fpreal boundval)
 

Protected Attributes

REDUCE_NAMES op
 
REDUCE_NAMES const UT_JobInfo &info const
 
fpreal64masktotal
 
fpreal64 REDUCE_NAMES op
 
fpreal64 REDUCE_NAMES const
SIM_RawField
maskfield
 
fpreal64 REDUCE_NAMES const
SIM_RawField bool 
maskissdf
 
fpreal64 REDUCE_NAMES const
SIM_RawField bool const
UT_JobInfo &info 
const
 
const SIM_RawFielddepths
 
const SIM_RawField const
SIM_RawField
valid
 
const SIM_RawField const
SIM_RawField fpreal 
isocontour
 
const SIM_RawField const
SIM_RawField fpreal fpreal 
dir
 
const SIM_RawField const
SIM_RawField fpreal fpreal
fpreal 
maxdist
 
const SIM_RawField const
SIM_RawField fpreal fpreal
fpreal bool 
clamp
 
const SIM_RawField const
SIM_RawField fpreal fpreal
fpreal bool fpreal 
clampval
 
const SIM_RawField const
SIM_RawField fpreal fpreal
fpreal bool fpreal const
UT_JobInfo
info
 
UT_VoxelArrayFdst
 
UT_VoxelArrayF UT_VoxelArrayFfield
 
UT_VoxelArrayF UT_VoxelArrayF float radius
 
UT_VoxelArrayF UT_VoxelArrayF
float const UT_JobInfo &info 
const { localReduceAxisOp<1>(op, dst, field, radius, info)
 
const UT_DMatrix4xform
 
const UT_DMatrix4 fpreal scale
 
const UT_DMatrix4 fpreal const
UT_JobInfo
info
 
int vdbidx
 
int const UT_DMatrix4xform
 
int const UT_DMatrix4 fpreal scale
 
int const UT_DMatrix4 fpreal
const UT_JobInfo
info
 
SIM_FieldSample mySample
 
UT_VoxelArrayFmyField
 
CE_GridmyGrid
 
bool myFieldOutOfDate
 
UT_Vector3 myOrig
 
UT_Vector3 mySize
 
UT_Vector3 myBBoxOrig
 
UT_Vector3 myBBoxSize
 
UT_Vector3 myVoxelSize
 
fpreal myVoxelDiameter
 
SIM_FieldBoundary myBoundary [3][2]
 
fpreal myBoundaryValue [3][2]
 

Detailed Description

Examples:
SIM/SIM_GasAdd.C, SIM/SIM_GasAdd.h, and SIM/SIM_RadialEmit.h.

Definition at line 108 of file SIM_RawField.h.

Member Typedef Documentation

Definition at line 111 of file SIM_RawField.h.

Member Enumeration Documentation

Enumerator
MIX_COPY 
MIX_ADD 
MIX_SUB 
MIX_MUL 
MIX_DIV 
MIX_MAX 
MIX_MIN 
MIX_AVERAGE 
NUM_MIX 

Definition at line 864 of file SIM_RawField.h.

Enumerator
PCG_NONE 
PCG_JACOBI 
PCG_CHOLESKY 
PCG_MIC 

Definition at line 1037 of file SIM_RawField.h.

Types of reductions supported by reduceOp.

Enumerator
REDUCE_MAX 
REDUCE_MIN 
REDUCE_AVERAGE 
REDUCE_SUM 
REDUCE_SUMABS 
REDUCE_SUMSQUARE 
REDUCE_RMS 
REDUCE_MEDIAN 
REDUCE_MAXABS 
REDUCE_MINABS 

Definition at line 427 of file SIM_RawField.h.

Constructor & Destructor Documentation

SIM_RawField::SIM_RawField ( )
virtual SIM_RawField::~SIM_RawField ( )
virtual
SIM_RawField::SIM_RawField ( const SIM_RawField src)

Copy constructor:

Member Function Documentation

void SIM_RawField::accumulateParticles ( const GU_Detail particles,
sim_particleToFieldParms parms,
const GA_PointGroup ptgrp = NULL 
)
void SIM_RawField::addToCell ( int  x,
int  y,
int  z,
fpreal  v 
)

Adds the value to the given voxel cell, averaging out among adjacent samples if we aren't sampled evenly.

void SIM_RawField::adopt ( UT_VoxelArrayF newf)

Adopts the heap-allocated voxel array. If the new voxel array is not of the right size, this field is left untouched, and the new voxel array is deleted.

static void SIM_RawField::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 
)
static

Verbs that can be performed on these fields.

Advect a point in space according to an array of velocity fields.

static void SIM_RawField::advect ( UT_Vector3 pos,
sim_PointVelocity  getVelocity,
float  time,
float  voxelsize,
int  jobnum = 0,
const SIM_RawField collision = 0,
float  cfl = 1.0F 
)
static
void SIM_RawField::advect ( const SIM_RawField source,
const SIM_RawField velx,
const SIM_RawField vely,
const SIM_RawField velz,
float  time,
const SIM_RawField collision,
SIM_FieldAdvection  advectmethod,
float  cfl 
)

Advect the source field by the given set of velocity fields, setting this to the result. Source cannot be this. this and source are assumed to match.

static void SIM_RawField::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 
)
static

Advect a point with the midpoint method.

static void SIM_RawField::advectMidpoint ( UT_Vector3 pos,
sim_PointVelocity  getVelocity,
float  time,
float  voxelsize,
int  jobnum = 0,
const SIM_RawField collision = 0,
float  cfl = 1.0F 
)
static
void SIM_RawField::advectMinMax ( const SIM_RawField source,
SIM_RawField minf,
SIM_RawField maxf,
const SIM_RawField velx,
const SIM_RawField vely,
const SIM_RawField velz,
float  time,
const SIM_RawField collision,
SIM_FieldAdvection  advectmethod,
float  cfl 
)
void SIM_RawField::advectMinMaxSelf ( SIM_RawField minfield,
SIM_RawField maxfield,
const SIM_RawField velx,
const SIM_RawField vely,
const SIM_RawField velz,
float  time,
const SIM_RawField collision,
SIM_FieldAdvection  advectmethod,
float  cfl 
)

Like advectSelf, but also generates min/max fields.

static void SIM_RawField::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 
)
static

Advect a point with TVD-RK3 method.

static void SIM_RawField::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 
)
static

Advect a point with TVD-RK4 method.

void SIM_RawField::advectSelf ( const SIM_RawField velx,
const SIM_RawField vely,
const SIM_RawField velz,
float  time,
const SIM_RawField collision,
SIM_FieldAdvection  advectmethod,
float  cfl 
)

Advect this field by the given velocity fields. Invokes advect but handles the creation of the intermediate field.

void SIM_RawField::advectSelf ( sim_PointVelocity  getVelocity,
float  time,
float  voxelsize,
const SIM_RawField collision,
float  cfl 
)
static fpreal SIM_RawField::applyBoundary ( SIM_FieldBoundary  bound,
fpreal  v,
fpreal  boundval 
)
staticprotected
static fpreal SIM_RawField::applyParticleToFieldParms ( fpreal  srcval,
fpreal  dstval,
const sim_particleToFieldParms parms 
)
inlinestatic

Definition at line 935 of file SIM_RawField.h.

fpreal SIM_RawField::average ( ) const
inline

Prebuilt versions.

Definition at line 447 of file SIM_RawField.h.

SIM_BoundaryLine SIM_RawField::boundaryLineToIndex ( const SIM_BoundaryLine worldbline) const

Converts the boundary line information from world space to local index space. This applies an inverse transform to the plane normal and regular transform to the height value to put both into index space.

void SIM_RawField::boxBlur ( float  radius)
inline

Inplace box blur. Radius is in world coordinates.

Definition at line 456 of file SIM_RawField.h.

void SIM_RawField::buildFromGeo ( const GEO_PrimVolume vol,
const UT_DMatrix4 xform,
fpreal  scale 
)

Builds from a GEO_PrimVolume.

void SIM_RawField::buildFromPrim ( const GEO_Primitive vol,
int  volidx,
const UT_DMatrix4 xform,
fpreal  scale 
)

Builds from either a GEO_PrimVolume or a GEO_PrimVDB. The provided volidx is the index inside of a vector volume to use for the building.

fpreal64 SIM_RawField::calculateDerivative ( int  x,
int  y,
int  z,
int  axis,
bool  positivegradient 
) const

Calculate the derivitive along the specified axis using an HJ WENO method at the given index. The boolean determines whether the derivitive in the positive or negative direction is computed.

fpreal64 SIM_RawField::calculateHJWENO ( fpreal64  v1,
fpreal64  v2,
fpreal64  v3,
fpreal64  v4,
fpreal64  v5 
) const

Giving the relevent divided differences, compute the HJWENO approxmiation of the derivative.

bool SIM_RawField::cellIndexToPos ( int  x,
int  y,
int  z,
UT_Vector3 pos 
) const

Convert voxel cell indices to world coordinates and vice-versa. Returns values at cell centers. Is equivalent to the indexToPos style functions only when sampling is CENTER.

void SIM_RawField::clearGrid ( ) const
void SIM_RawField::computeConnectedComponents ( UT_VoxelArray< int64 > &  comp,
int numcomponent 
) const

Determine all components connected according to < 0 semantic.

void SIM_RawField::computeSDFWeightsFacePartial ( const SIM_RawField sdf,
int  axis,
bool  invert,
fpreal  minweight,
const UT_JobInfo info 
)
void SIM_RawField::computeSDFWeightsSampled ( const SIM_RawField sdf,
int  samplesperaxis,
bool  invert,
fpreal  minweight,
fpreal  dilatedist = 0 
)
inline

Compute fractional volume weights representing the amount the voxel surrounding each sample point is inside the provided SDF. This method just subsamples the voxel space according to the samplesperaxis parameter.

Definition at line 1242 of file SIM_RawField.h.

void SIM_RawField::computeSDFWeightsVolumeFractionPartial ( const SIM_RawField sdf,
bool  invert,
fpreal  minweight,
const UT_JobInfo info 
)
fpreal SIM_RawField::computeVoxelSDFWeightFace ( int  x,
int  y,
int  z,
const SIM_RawField sdf,
int  axis 
) const

Compute fractional volume weights for the voxel specified by x, y, z. This method uses the normalized area of the square that is in the plane given by the axis parameter as an approximation.

void SIM_RawField::convertToHeavisidePartial ( const UT_JobInfo info)

Sets this to the heaviside function of itself. this = clamp(-this/diam+0.5, 0, 1)

void SIM_RawField::diffuse ( fpreal  diffrate,
int  numiter,
const SIM_RawField collision = 0 
)

Solve the diffusion equation over this field according to the given diffusion rate. One likely wants to roll the desired timestep into the diffusion rate.

static void SIM_RawField::diffuse ( float dstdata,
const float srcdata[3][3][3],
float  b,
float  ivsx,
float  ivsy,
float  ivsz,
int  tx,
int  ty,
int  max_xtile,
int  max_ytile,
int  max_xvox,
int  max_yvox 
)
static

Raw diffuse algorithm, exposed only for external performance tests.

void SIM_RawField::enforceBoundary ( SIM_FieldBoundary  collisionboundary = SIM_BOUNDARY_NONE,
const SIM_RawField collision = 0,
const SIM_RawField cvalue = 0,
const SIM_RawField boundary = 0,
const SIM_BoundaryLine indexbline = SIM_BoundaryLine() 
)

Enforces the boundary conditions on this field. Each axis can have its own conditions The boundary line is expected to be in index space

void SIM_RawField::enforceBoundaryFlat ( fpreal32 values,
const SIM_RawIndexField collision_lookup 
)

Enforces the boundary conditions onto a flat array using the dimensions of this. Does SAME boundaries for collision objects. Index field is where to copy from for each collision voxel.

void SIM_RawField::enforceCollisionBoundary ( SIM_FieldBoundary  boundary,
const SIM_RawField collision,
const SIM_RawField cvalue = 0 
)
void SIM_RawField::enforceSideBoundary ( int  axis,
int  side,
SIM_FieldBoundary  bound,
fpreal  boundaryvalue,
const SIM_BoundaryLine indexbline = SIM_BoundaryLine(),
const SIM_RawField boundaryfield = 0 
)
void SIM_RawField::enforceSideBoundaryFlat ( fpreal32 values,
int  axis,
int  side,
SIM_FieldBoundary  bound,
fpreal  boundval 
)
void SIM_RawField::extrapolate ( const SIM_RawField depths,
const SIM_RawField valid,
fpreal  isocontour,
fpreal  dir,
fpreal  maxdist,
bool  clamp,
fpreal  clampval 
)

Extrapolates the values of this field to all locations which are on the wrong side of the isocontour. dir == 1 means greater than isocontour is wrong, dir == -1 is less than. maxdist, if not negative, represents the greatest absolute distance to extrapolate to. Values outside of this are left unaffected, unless clamp is set, in which case they are set to clampval.

void SIM_RawField::extrapolateFromIndex ( const SIM_RawField depths,
const SIM_RawIndexField index,
const SIM_RawField collision,
const SIM_RawField valid,
const GU_Detail gdp,
const UT_DMatrix4 xform,
fpreal  isocontour,
fpreal  isotol,
fpreal  dir,
fpreal  maxdist,
bool  clamp,
fpreal  clampval 
)

Extrapolates the values of this field to all locations which are on the wrong side of the isocontour. dir == 1 means greater than isocontour is wrong, dir == -1 is less than. maxdist, if not negative, represents the greatest absolute distance to extrapolate to. Values outside of this are left unaffected, unless clamp is set, in which case they are set to clampval. The extrpolated values are found by interpolating at the position of the closest points in the provided GU_Detail, as stored in the index field by point index.

void SIM_RawField::extrapolateFromIndexInternalPartial ( sim_extrapolateFromIndexParms p,
const UT_JobInfo info 
)
const UT_VoxelArrayF* SIM_RawField::field ( ) const
inline

Fetches the raw field.

Definition at line 506 of file SIM_RawField.h.

UT_VoxelArrayF* SIM_RawField::fieldNC ( ) const
inline
Examples:
SIM/SIM_GasAdd.C.

Definition at line 507 of file SIM_RawField.h.

fpreal SIM_RawField::findProportionalValue ( fpreal  position,
const SIM_RawField mask,
bool  maskissdf 
) const

Sorts the valid voxels (as defined by optional mask) and returns the given percentile voxel. 0.5 means median. 0.25 first quartile, etc.

static fpreal SIM_RawField::fromHeaviside ( fpreal  val,
fpreal  diam 
)
static
fpreal SIM_RawField::fromHeaviside ( fpreal  val) const
const UT_Vector3& SIM_RawField::getBBoxOrig ( ) const
inline

Definition at line 538 of file SIM_RawField.h.

const UT_Vector3& SIM_RawField::getBBoxSize ( ) const
inline

Definition at line 539 of file SIM_RawField.h.

UT_VoxelBorderType SIM_RawField::getBorder ( ) const

These adjust the native UT_VoxelArray border values that are used for reading outside the valid range.

float SIM_RawField::getBorderValue ( ) const
SIM_FieldBoundary SIM_RawField::getBoundary ( int  axis,
int  side 
) const
inline

Definition at line 1167 of file SIM_RawField.h.

fpreal SIM_RawField::getBoundaryValue ( int  axis,
int  side 
) const
inline

Definition at line 1171 of file SIM_RawField.h.

fpreal SIM_RawField::getCellValue ( int  x,
int  y,
int  z 
) const

Returns an averaged value for the center of the given voxel.

const UT_VoxelCompressOptions& SIM_RawField::getCompressionOptions ( ) const
fpreal SIM_RawField::getCompressionTolerance ( ) const
fpreal64 SIM_RawField::getCurvature ( UT_Vector3  pos) const

Returns the curvature of the field at a given world space location. Uses interpolation of index based getCurvatureAtIndex.

fpreal64 SIM_RawField::getCurvatureAtIndex ( int  x,
int  y,
int  z 
) const

Computes the curvature at the given voxel index. Uses central differencing. The resulting curvature is clamped according to the resolution of the field to avoid abnormally large values in noisy data.

static fpreal64 SIM_RawField::getCurvatureAtProbe ( UT_VoxelROProbeCubeF probe,
const UT_Vector3 invvoxelsize 
)
static

Computes the curvature according to a 3^3 voxel probe.

fpreal64 SIM_RawField::getCurvatureTimesGradAtIndex ( int  x,
int  y,
int  z 
) const

Computes K |grad(phi|), the curvature times the length of the gradient. By folding the two operations, we can return a non-zero value where grad goes to zero (but curvature doesn't) using L'Hospital's rule. This also does not clamp the curvature.

UT_Vector3 SIM_RawField::getGradient ( UT_Vector3  pos) const

Return the gradient of the field at the given world space location. Uses central differencing with a sample spacing of the voxelsize.

UT_Vector3 SIM_RawField::getGradientAtIndex ( int  x,
int  y,
int  z 
) const

Returns the gradient at the given voxel index. Uses central differencing.

fpreal64 SIM_RawField::getLaplacian ( UT_Vector3  pos) const

Computes the laplacian of the field at the world space coordinate using interpolation of getLaplacianAtIndex

fpreal64 SIM_RawField::getLaplacianAtIndex ( int  x,
int  y,
int  z 
) const

Computes the laplacian of the field at the specific voxel index specified

int64 SIM_RawField::getMemoryUsage ( ) const
const UT_Vector3& SIM_RawField::getOrig ( ) const
inline

Definition at line 536 of file SIM_RawField.h.

void SIM_RawField::getPartialRange ( UT_VoxelArrayIteratorF vit,
const UT_JobInfo info 
) const

Initializes the voxel iterator to only run over a subset of tiles that correspond to the appropriate range for the jobinfo.

SIM_FieldSample SIM_RawField::getSample ( ) const
inline

Definition at line 549 of file SIM_RawField.h.

void SIM_RawField::getSamplePattern ( SIM_FieldSample  sample,
int  x,
int  y,
int  z,
int numsample,
int ix,
int iy,
int iz,
bool  clamp 
) const

Returns the set of samples in this field which correspond to the given location & sampling pattern. ix, iy, and iz should be size 8. If you want the deltas for the sampling pattern, call with x, y, z zero and clamp to false.

UT_Vector3 SIM_RawField::getSampleVoxelOffset ( SIM_FieldSample  sample) const

Returns an offset, in voxel coords, to sample this field giving a voxel based address in a field with sampling pattern sample. The offset will be 0.5, 0, or -0.5 in each axis.

const UT_Vector3& SIM_RawField::getSize ( ) const
inline

Definition at line 537 of file SIM_RawField.h.

fpreal SIM_RawField::getValue ( UT_Vector3  pos) const

Functions to resolve quantities about the field.

Sample the field at the given world space location.

fpreal SIM_RawField::getValueIndex ( UT_Vector3I  index) const

Returns the field value at the given voxel.

fpreal SIM_RawField::getVoxelDiameter ( ) const
inline

Definition at line 543 of file SIM_RawField.h.

void SIM_RawField::getVoxelRes ( int xres,
int yres,
int zres 
) const

Returns the resolution of the voxel grid that we are sampling. This is a count of voxels, so may differ for our different sampling methods.

UT_Vector3I SIM_RawField::getVoxelRes ( ) const
const UT_Vector3& SIM_RawField::getVoxelSize ( ) const
inline

Definition at line 540 of file SIM_RawField.h.

fpreal SIM_RawField::getVoxelVolume ( ) const
inline

Definition at line 544 of file SIM_RawField.h.

exint SIM_RawField::getXRes ( ) const
inline

Returns the actual number of samples in each resolution. Preferred over field()->getXRes() as it doesn't require a copy of the CE fields.

Definition at line 562 of file SIM_RawField.h.

exint SIM_RawField::getYRes ( ) const
inline

Definition at line 563 of file SIM_RawField.h.

exint SIM_RawField::getZRes ( ) const
inline

Definition at line 564 of file SIM_RawField.h.

CE_Grid* SIM_RawField::grid ( ) const

Fetches the compute grid, returns 0 if not present.

bool SIM_RawField::gridIsAuthoritative ( ) const
inline

Returns true if the OpenCL grid has more up-to-date data than the voxel array.

Definition at line 520 of file SIM_RawField.h.

bool SIM_RawField::hasNan ( ) const
inline

Returns true if our field has any NANs.

Definition at line 499 of file SIM_RawField.h.

bool SIM_RawField::indexToPos ( int  x,
int  y,
int  z,
UT_Vector3 pos 
) const

Convert indices to world coordinates and vice-versa. Note this uses this field's indices which change depending on sampling.

bool SIM_RawField::indexToPos ( exint  x,
exint  y,
exint  z,
UT_Vector3D pos 
) const
bool SIM_RawField::indexToPos ( UT_Vector3I  index,
UT_Vector3 pos 
) const
UT_Vector3 SIM_RawField::indexToPos ( UT_Vector3I  index) const
void SIM_RawField::init ( SIM_FieldSample  sample,
const UT_Vector3 orig,
const UT_Vector3 size,
int  xres,
int  yres,
int  zres 
)

Initializes the field. The resolution given is in terms of voxels, the actual dimensions of this field may be slightly different due to the sampling choice.

void SIM_RawField::init ( SIM_FieldSample  sample,
const UT_Vector3 orig,
const UT_Vector3 size,
int  xres,
int  yres,
int  zres,
const UT_Vector3 voxelsize 
)
void SIM_RawField::init ( SIM_FieldSample  sample,
const UT_Vector3 orig,
const UT_Vector3 size,
UT_VoxelArrayF voxels 
)

Initializes the field. Will gain ownership of the given voxel array.

void SIM_RawField::init ( SIM_FieldSample  sample,
const UT_Vector3 orig,
const UT_Vector3 size,
UT_VoxelArrayF voxels,
const UT_Vector3 voxelsize 
)
bool SIM_RawField::isAligned ( const SIM_RawField field) const

Returns true if the two fields are precisely aligned. This means that samples are matched so a given integer index into either field would give the same result.

bool SIM_RawField::isAligned ( const SIM_RawIndexField field) const
bool SIM_RawField::isAligned ( const GEO_PrimVolume vold) const
bool SIM_RawField::isColocated ( const SIM_RawField field,
UT_Vector3I offset 
) const

Returns true if two fields have voxels aligned. They do not have to be of the same resolution or share origin. However, using the offset allows to access this field with index of the other field. i.e. field->indexToPos(index) == this->indexToPos(index + offset) and this->indexToPos(index) == field->indexToPos(index - offset)

bool SIM_RawField::isColocated ( const SIM_RawIndexField field,
UT_Vector3I offset 
) const
bool SIM_RawField::isColocated ( const GEO_Primitive prim,
UT_Vector3I offset 
) const
bool SIM_RawField::isMatching ( const SIM_RawField field) const

Returns true if the given field and this one match in terms of number of voxels and bounding box size. This means the voxel cells match - not necessarily the sample points!

bool SIM_RawField::isMatching ( const SIM_RawIndexField field) const
template<int AXIS, REDUCE_NAMES OP>
void SIM_RawField::localMinMaxAxis ( UT_VoxelArrayF dstfield,
const UT_VoxelArrayF field,
float  radius,
const UT_JobInfo info 
) const
protected
template<int AXIS, REDUCE_NAMES OP>
void SIM_RawField::localReduceAxis ( UT_VoxelArrayF dstfield,
const UT_VoxelArrayF field,
float  radius,
const UT_JobInfo info 
) const
protected

Reduce along a given axis by the specified radius in voxels.

template<int AXIS>
void SIM_RawField::localReduceAxisOp ( REDUCE_NAMES  op,
UT_VoxelArrayF dstfield,
UT_VoxelArrayF field,
float  radius,
const UT_JobInfo info 
) const
protected
UT_VoxelArrayF UT_VoxelArrayF float const UT_JobInfo& info const SIM_RawField::localReduceAxisOp ( op  ,
dst  ,
field  ,
radius  ,
info   
)
protected
void SIM_RawField::localReduceByAxis ( REDUCE_NAMES  op,
UT_VoxelArrayF dst,
UT_VoxelArrayF field,
UT_Vector3  radius 
) const
protected

Reduction by reducing each axis in turn. This will change field and dst != field is required.

void SIM_RawField::localReduceOp ( REDUCE_NAMES  op,
const UT_Vector3 radius 
)

Performs a localized reduction on the field. Stores in this the result of the reduction. Radius is in world coordinates.

void SIM_RawField::makeConstant ( float  cval)

Initializes this field to a constant value.

void SIM_RawField::markGridAsChanged ( )
inline

Mark the field as out of date, but only if we have a valid grid.

Definition at line 516 of file SIM_RawField.h.

void SIM_RawField::match ( const SIM_RawField src)

Initializes this to be the same dimensions, sampling pattern, etc, of the given field. The values of this may be reset to zero.

void SIM_RawField::match ( const SIM_RawIndexField src)
static fpreal SIM_RawField::mixValues ( MIX_NAMES  mixtype,
fpreal  d,
fpreal  s 
)
inlinestatic

Performs the requires mixing.

Definition at line 877 of file SIM_RawField.h.

void SIM_RawField::moveAlongCurvature ( fpreal  amount,
fpreal  cflcond,
int  miniter,
int  maxiter 
)

Advances this field along the field's curvature. Is given a total amount to move and will calculate the appropriate timestep according to the given cfl condition & min/max iterations.

void SIM_RawField::moveAlongNormalMidpoint ( const SIM_RawField speed,
const SIM_RawField source,
fpreal  timestep,
fpreal  bandwidth 
)

Uses the midpoint method to do a second order temporal update of the moveAlongNormal algorithm.

bool SIM_RawField::movePtToIso ( UT_Vector3 pos,
fpreal  goaliso,
fpreal  maxtime,
fpreal  tol = 1e-4 
) const

Move a point to the given isooffset. Returns false if fails to complete the move in the given time.

void SIM_RawField::negatePartial ( const UT_JobInfo info)

Negates all values in this field.

const SIM_RawField& SIM_RawField::operator= ( const SIM_RawField src)

Assigment operator:

bool SIM_RawField::posToCellIndex ( UT_Vector3  pos,
int x,
int y,
int z 
) const
bool SIM_RawField::posToIndex ( UT_Vector3  pos,
int x,
int y,
int z 
) const

Converts a worldspace position into an integer index.

bool SIM_RawField::posToIndex ( UT_Vector3  wpos,
UT_Vector3 ipos 
) const
UT_Vector3I SIM_RawField::posToIndex ( UT_Vector3  pos) const
bool SIM_RawField::posToIndex ( UT_Vector3  pos,
int x,
int y,
int z,
fpreal dx,
fpreal dy,
fpreal dz 
) const

Converts worldspace position into an integer index + the lerp values required to interpolate. Lerp with (1-dx) * (x,y,z) + dx * (x+1,y,z)

fpreal SIM_RawField::reduceMaskedOp ( REDUCE_NAMES  op,
const SIM_RawField mask,
bool  maskissdf 
) const

Performs the reduction only including parts of the field that match the given mask. If mask is null, falls through to normal reduction.

fpreal SIM_RawField::reduceOp ( REDUCE_NAMES  op) const

Perform reduction on the field using the given method The internal methods are helpers to deal with the threading collating.

void SIM_RawField::reinitializeSignedDistance ( int  maxiter,
bool  usemidpoint,
fpreal  bandwidth 
)

Performs the reinitialization equation. This solves for: dphi/dt + S(phi0) * (|grad(phi)| - 1) = 0 at steady state. S(phi0) = phi0 / sqrt(phi0^2 + dx^2), a smeared sign function. It is held constant for the reinitialization. Usemidpoint indicates using midpoint integration vs. Euler. Any parts of the SDF past the bandwidth are assumed to already be a valid SDF and not require reinitialization.

CE_Grid* SIM_RawField::requireGrid ( ) const

Fetches the compute grid but throws cl::Error() on failure.

void SIM_RawField::resample ( SIM_FieldSample  sample,
const SIM_RawField src 
)

Initializes this to be the same as the given field. The values of this will be found by resampling the other field with the new sampling pattern.

void SIM_RawField::setAsExtrapolatedField ( UT_Vector3  scale)

Mark this field as being an extrapolated field. Out of bound voxels will read the clamped value. The difference between the clamped position and the real position is then dot producted with the given scale factor and added to the resulting value. This allows you to have rest fields that extrapolate meaningfully.

void SIM_RawField::setBorder ( UT_VoxelBorderType  border,
float  bval 
)
void SIM_RawField::setBoundary ( int  axis,
int  side,
SIM_FieldBoundary  bound 
)
inline

These boundary conditions do not apply to reading outside of the valid field range. The native UT_VoxelArray boundary condition is used for that. Instead, they are used for the behaviour of enforceBoundary and by various places where we want to distinguish open velocity fields from closed.

Definition at line 1165 of file SIM_RawField.h.

void SIM_RawField::setBoundaryValue ( int  axis,
int  side,
fpreal  v 
)
inline

Definition at line 1169 of file SIM_RawField.h.

void SIM_RawField::setCellValue ( int  x,
int  y,
int  z,
fpreal  v 
)

Ensures the given voxel cell has the given value. This will set all of the adjacent samples if we aren't sampled evenly.

void SIM_RawField::setCompressionOptions ( const UT_VoxelCompressOptions options)

These adjust the native UT_VoxelArray comrpression options.

void SIM_RawField::setCompressionTolerance ( fpreal  tol)

These adjust the native UT_VoxelArray comrpression tolerance..

void SIM_RawField::setVoxelSize ( const UT_Vector3 voxelsize)
inline

Definition at line 541 of file SIM_RawField.h.

bool SIM_RawField::shouldMultiThread ( ) const
inline

Returns true if this should be multithreaded.

Definition at line 151 of file SIM_RawField.h.

void SIM_RawField::solvePressure ( const SIM_RawField divergence,
const SIM_RawField collision,
int  numiter = 20 
)

Solves the pressure field that would eliminate the given divergence field.

void SIM_RawField::solvePressurePCG ( const SIM_RawField divergence,
SIM_RawIndexField index,
SIM_VectorField vel,
const SIM_RawIndexField comp = 0,
const UT_IntArray expandable = 0,
const SIM_RawField surface = 0,
bool  variational = true,
bool  ghostfluid = true,
PCG_METHOD  pcgmethod = PCG_MIC 
)
void SIM_RawField::sortAllVoxels ( UT_FloatArray voxelvalues) const
protected
void SIM_RawField::sortAllVoxelsMasked ( UT_FloatArray voxelvalues,
const SIM_RawField maskfield,
bool  maskissdf 
) const
protected
UT_VoxelArrayF* SIM_RawField::steal ( )

Steals the voxel array, leaving this pointing to a 0 constant array

void SIM_RawField::testForNan ( ) const

Tests for nans, outputs text and asserts if has any Only runs if the test environment variable is set.

SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
extrapolateFromIndexInternal  ,
sim_extrapolateFromIndexParms ,
parms   
)
SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
scale  ,
fpreal  ,
scale   
)

Scales all values in this field.

SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
maximum  ,
const SIM_RawField ,
other   
) const

Makes this field the minimum or maximum of this field and the other field. The other field is not assumed to be matching.

SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
minimum  ,
const SIM_RawField ,
other   
) const
SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
average  ,
const SIM_RawField ,
other   
) const

Averages this with the other field. Result in this. Assumes fields match.

SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
advectSingleMinMax  ,
const sim_advectParms ,
parms   
) const
SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
advectTraceMinMax  ,
const sim_advectParms ,
parms   
) const
SIM_RawField::THREADED_METHOD1 ( SIM_RawField  ,
shouldMultiThread()  ,
advectMultistepMinMax  ,
const sim_advectParms ,
parms   
) const
SIM_RawField::THREADED_METHOD2 ( SIM_RawField  ,
shouldMultiThread()  ,
addValuePerComponent  ,
const UT_DoubleArray ,
valuelist  ,
const SIM_RawIndexField ,
comp   
) const

Adds to this field the value given per component. Negative components neglected.

SIM_RawField::THREADED_METHOD2 ( SIM_RawField  ,
shouldMultiThread()  ,
smearedSign  ,
const SIM_RawField ,
sdf  ,
fpreal  ,
bandwidth   
) const

Sets this to the smeared sign function of the given sdf. this = sdf / sqrt(sdf*sdf + bandwidth*bandwidth) this must already match sdf.

SIM_RawField::THREADED_METHOD2 ( SIM_RawField  ,
shouldMultiThread()  ,
enforceCollisionBoundaryFlat  ,
fpreal32 ,
values  ,
const SIM_RawIndexField ,
collision_lookup   
)
SIM_RawField::THREADED_METHOD2_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
reduceOpInternal  ,
fpreal64 ,
sum  ,
REDUCE_NAMES  ,
op   
)
protected
SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
moveAlongCurvature  ,
fpreal  ,
b_val  ,
const SIM_RawField ,
source  ,
fpreal  ,
timestep   
)

Advances source field along the field's curvature. Takes a given b to act as the movement coefficient. Does a single euler step. this is filled in with the resulting field. this cannot be source. This solves: dphi/dt = b * K * |grad(phi)|

SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
setScaleAdd  ,
const SIM_RawField ,
,
fpreal  ,
scale  ,
const SIM_RawField ,
B   
) const

Sets this to A + s*B. A & B match this. This can be either A or B, or neither.

SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
applyParticles  ,
const GU_Detail ,
particles  ,
GEO_PointTreeGAOffset ,
pttree  ,
sim_particleToFieldParms ,
parms   
) const
SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
buildDivergenceFace  ,
const SIM_VectorField ,
vel  ,
const SIM_RawField ,
surface  ,
const SIM_RawField ,
stencil   
) const

Computes the divergence of the face-centered velocity field and stores the result in this. this must match the velocity field. If stencil is provided (and surface is not), the divergence is only calculated in the areas where stencil value is greater than 0.5 (with the remaining regions left untouched). stencil field must be aligned with this.

SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
enforceCollisionBoundaryInternal  ,
SIM_FieldBoundary  ,
boundary  ,
const SIM_RawField ,
collision  ,
const SIM_RawField ,
cvalue   
)
SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
computeSDFWeightsVolumeFraction  ,
const SIM_RawField ,
sdf  ,
bool  ,
invert  ,
fpreal  ,
minweight   
)

Compute fractional volume weights representing the amount the voxel surrounding each sample point is inside the provided SDF. This method uses accurate volume fractions.

SIM_RawField::THREADED_METHOD3 ( SIM_RawField  ,
shouldMultiThread()  ,
buildFromGeoSampled  ,
const GEO_PrimVolume ,
vol  ,
const UT_DMatrix4 ,
xform  ,
fpreal  ,
scale   
) const
protected
SIM_RawField::THREADED_METHOD3_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
sumPerComponent  ,
UT_DoubleArray ,
result  ,
UT_Int64Array ,
activevoxels  ,
const SIM_RawIndexField ,
comp   
)

Sums the field into separate summation lists, one per component of the comp index field. Negative components ignored, the given arrays should already be sized to fit the maxindex.

SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
moveAlongNormal  ,
const SIM_RawField ,
speed  ,
const SIM_RawField ,
source  ,
fpreal  ,
timestep  ,
fpreal  ,
bandwidth   
) const

Advances source field along the field's normal direction. Takes a matching field which defines the speed to move in the normal direction on a per cell basis. Past the bandwidth assumes a valid SDF and skips gradient estimates. Does a single euler step. this is filled in with the resulting field. this cannot be source. This solves: dphi/dt + speed * |grad(phi)| = 0

SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
addValueToComponent  ,
double  ,
value  ,
int  ,
compnum  ,
const SIM_RawIndexField ,
comp  ,
const SIM_RawField ,
pressureboundary   
)
SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
gaussSeidelIteration  ,
const SIM_RawField ,
B  ,
fpreal32  ,
weight  ,
fpreal32  ,
sumweight  ,
int  ,
parity   
) const
SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
computeSDFWeightsFace  ,
const SIM_RawField ,
sdf  ,
int  ,
axis  ,
bool  ,
invert  ,
fpreal  ,
minweight   
)

Compute fractional volume weights representing the amount the voxel surrounding each sample point is inside the provided SDF. This method uses the normalized area of the square that is in the plane given by the axis parameter as an approximation.

SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
setScaleDivideThreshold  ,
fpreal  ,
scale  ,
const SIM_RawField ,
B  ,
const SIM_RawField ,
C  ,
fpreal  ,
threshold   
)

Scale this field by s * B / C or set to zero if scaled value is lower than given threshold

SIM_RawField::THREADED_METHOD4 ( SIM_RawField  ,
shouldMultiThread()  ,
buildFromVDBSampled  ,
const GEO_PrimVDB ,
vdb  ,
int  ,
vdbidx  ,
const UT_DMatrix4 ,
xform  ,
fpreal  ,
scale   
) const
protected
SIM_RawField::THREADED_METHOD4_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
gaussSeidelIterationFlat  ,
fpreal32 ,
,
fpreal32  ,
weight  ,
fpreal32  ,
sumweight  ,
int  ,
parity   
)
SIM_RawField::THREADED_METHOD4_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
gaussSeidelIterationFlat2D  ,
fpreal32 ,
,
fpreal32  ,
weight  ,
fpreal32  ,
sumweight  ,
int  ,
parity   
)
SIM_RawField::THREADED_METHOD4_CONST ( SIM_RawField  ,
field.  getTileRes1)*field.getTileRes(2,
,
localReduceAxisX  ,
REDUCE_NAMES  ,
op  ,
UT_VoxelArrayF ,
dst  ,
UT_VoxelArrayF ,
field  ,
float  ,
radius   
)
protected

Again a triple specialization to engage threading.

SIM_RawField::THREADED_METHOD4_CONST ( SIM_RawField  ,
field.  getTileRes0)*field.getTileRes(2,
,
localReduceAxisY  ,
REDUCE_NAMES  ,
op  ,
UT_VoxelArrayF ,
dst  ,
UT_VoxelArrayF ,
field  ,
float  ,
radius   
)
protected
SIM_RawField::THREADED_METHOD4_CONST ( SIM_RawField  ,
field.  getTileRes0)*field.getTileRes(1,
,
localReduceAxisZ  ,
REDUCE_NAMES  ,
op  ,
UT_VoxelArrayF ,
dst  ,
UT_VoxelArrayF ,
field  ,
float  ,
radius   
)
protected
SIM_RawField::THREADED_METHOD5 ( SIM_RawField  ,
shouldMultiThread()  ,
advectHJWENO  ,
const SIM_RawField ,
source  ,
const SIM_RawField ,
velx  ,
const SIM_RawField ,
vely  ,
const SIM_RawField ,
velz  ,
fpreal  ,
timestep   
) const

Advects the field using HJWENO.

SIM_RawField::THREADED_METHOD5 ( SIM_RawField  ,
shouldMultiThread()  ,
advectUpwind  ,
const SIM_RawField ,
source  ,
const SIM_RawField ,
velx  ,
const SIM_RawField ,
vely  ,
const SIM_RawField ,
velz  ,
fpreal  ,
timestep   
) const

Advects the field using upwind.

SIM_RawField::THREADED_METHOD5 ( SIM_RawField  ,
shouldMultiThread()  ,
buoyancy  ,
const SIM_RawField ,
stencil  ,
const SIM_RawField ,
temperature  ,
fpreal  ,
up  ,
fpreal  ,
Tamb  ,
fpreal  ,
buoyancy   
) const
SIM_RawField::THREADED_METHOD5_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
sumComponent  ,
double &  ,
result  ,
int64 ,
activevoxels  ,
int  ,
compnum  ,
const SIM_RawIndexField ,
comp  ,
const SIM_RawField ,
pressureboundary   
)
SIM_RawField::THREADED_METHOD5_CONST ( SIM_RawField  ,
shouldMultiThread()  ,
reduceMaskedOpInternal  ,
fpreal64 ,
sum  ,
fpreal64 ,
masktotal  ,
REDUCE_NAMES  ,
op  ,
const SIM_RawField ,
mask  ,
bool  ,
maskissdf   
)
protected
SIM_RawField::THREADED_METHOD6 ( SIM_RawField  ,
shouldMultiThread()  ,
advect2  ,
const SIM_RawField ,
source  ,
sim_PointVelocity  ,
getVelocity  ,
float  ,
time  ,
float  ,
voxelsize  ,
const SIM_RawField ,
collision  ,
float  ,
cfl   
) const
SIM_RawField::THREADED_METHOD7 ( SIM_RawField  ,
shouldMultiThread()  ,
advectSingle  ,
const SIM_RawField ,
source  ,
const SIM_RawField ,
velx  ,
const SIM_RawField ,
vely  ,
const SIM_RawField ,
velz  ,
float  ,
time  ,
const SIM_RawField ,
collision  ,
float  ,
cfl   
) const
SIM_RawField::THREADED_METHOD7 ( SIM_RawField  ,
shouldMultiThread()  ,
advectTrace  ,
const SIM_RawField ,
source  ,
const SIM_RawField ,
velx  ,
const SIM_RawField ,
vely  ,
const SIM_RawField ,
velz  ,
float  ,
time  ,
const SIM_RawField ,
collision  ,
float  ,
cfl   
) const
SIM_RawField::THREADED_METHOD8 ( SIM_RawField  ,
shouldMultiThread()  ,
advectMultistep  ,
const SIM_RawField ,
source  ,
const SIM_RawField ,
velx  ,
const SIM_RawField ,
vely  ,
const SIM_RawField ,
velz  ,
float  ,
time  ,
const SIM_RawField ,
collision  ,
float  ,
cfl  ,
SIM_FieldAdvection  ,
advectmethod   
) const
SIM_RawField::THREADED_METHOD8 ( SIM_RawField  ,
shouldMultiThread()  ,
buildExtrapList  ,
UT_Array< UT_ValArray< gu_sdf_qelem * > > &  ,
lists  ,
const SIM_RawField ,
depths  ,
const SIM_RawField ,
valid  ,
fpreal  ,
isocontour  ,
fpreal  ,
dir  ,
fpreal  ,
maxdist  ,
bool  ,
clamp  ,
fpreal  ,
clampval   
)
protected

Methods for extrapolation.

static fpreal SIM_RawField::toHeaviside ( fpreal  val,
fpreal  diam 
)
static

Perform heaviside & inverse heaviside in a consistent fashion.

fpreal SIM_RawField::toHeaviside ( fpreal  val) const

Defines width as maxcomponent of our voxels.

void SIM_RawField::updateFieldFromGrid ( ) const

Copies our grid into our field.

void SIM_RawField::updateGridFromField ( ) const

Copies our field into the grid.

void SIM_RawField::waveletComputePSD ( const SIM_RawField wavelet,
int  level 
)

Computes the sum of squares of the given level's detail vector.

void SIM_RawField::waveletExtractComponent ( const SIM_RawField wavelet,
int  level,
int  component 
)

Extracts the given component from a packed wavelet array.

void SIM_RawField::waveletInverseTransform ( UT_Wavelet::WAVELET_NAMES  wavelettype,
const SIM_RawField wavelet,
int  maxpasses = -1 
)
void SIM_RawField::waveletRebuildFromVoxelArray ( UT_VoxelArrayF array,
float  scale 
)
protected
void SIM_RawField::waveletTransform ( UT_Wavelet::WAVELET_NAMES  wavelettype,
const SIM_RawField field,
int  maxpasses = -1 
)

Transform turns this into a packed set of wavelet coeffecients from the scalar data in field. Inverse unpacks and generates a scalar field into this.

Using a smooth edge conditon we assume that in case of an odd sized field, the ultimate row has zero diff coefficients. We thus store the extra column in the averages side of the matrix, for ceil(n/2) in the averages and floor(n/2) in the diffs. Note this causes 3d fields that are actually 2d to properly decompose.

Member Data Documentation

UT_Int64Array& SIM_RawField::activevoxels

Definition at line 357 of file SIM_RawField.h.

int64& SIM_RawField::activevoxels

Definition at line 368 of file SIM_RawField.h.

fpreal const SIM_RawField& SIM_RawField::B

Definition at line 401 of file SIM_RawField.h.

const SIM_RawField* SIM_RawField::B

Definition at line 1316 of file SIM_RawField.h.

const SIM_RawField fpreal fpreal SIM_RawField::bandwidth

Definition at line 300 of file SIM_RawField.h.

fpreal SIM_RawField::bandwidth

Definition at line 411 of file SIM_RawField.h.

const SIM_RawField fpreal fpreal fpreal SIM_RawField::buoyancy

Definition at line 859 of file SIM_RawField.h.

Definition at line 1316 of file SIM_RawField.h.

Definition at line 975 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal fpreal fpreal bool SIM_RawField::clamp
protected

Definition at line 1360 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal fpreal fpreal bool fpreal SIM_RawField::clampval
protected

Definition at line 1360 of file SIM_RawField.h.

Definition at line 759 of file SIM_RawField.h.

sim_PointVelocity float float const SIM_RawField* SIM_RawField::collision

Definition at line 975 of file SIM_RawField.h.

const SIM_RawField* SIM_RawField::collision

Definition at line 1135 of file SIM_RawField.h.

const SIM_RawIndexField* SIM_RawField::collision_lookup

Definition at line 1151 of file SIM_RawField.h.

UT_Int64Array const SIM_RawIndexField* SIM_RawField::comp

Definition at line 357 of file SIM_RawField.h.

int64 int const SIM_RawIndexField* SIM_RawField::comp

Definition at line 368 of file SIM_RawField.h.

const SIM_RawIndexField* SIM_RawField::comp

Definition at line 380 of file SIM_RawField.h.

int const SIM_RawIndexField* SIM_RawField::comp

Definition at line 389 of file SIM_RawField.h.

int64 int SIM_RawField::compnum

Definition at line 368 of file SIM_RawField.h.

int SIM_RawField::compnum

Definition at line 389 of file SIM_RawField.h.

Definition at line 357 of file SIM_RawField.h.

int64 int const SIM_RawIndexField const SIM_RawField const UT_JobInfo& info SIM_RawField::const

Definition at line 368 of file SIM_RawField.h.

fpreal32 fpreal32 int const UT_JobInfo& info SIM_RawField::const

Definition at line 1089 of file SIM_RawField.h.

REDUCE_NAMES const UT_JobInfo& info SIM_RawField::const
protected

Definition at line 1333 of file SIM_RawField.h.

fpreal64 REDUCE_NAMES const SIM_RawField bool const UT_JobInfo& info SIM_RawField::const
protected

Definition at line 1341 of file SIM_RawField.h.

UT_VoxelArrayF UT_VoxelArrayF float const UT_JobInfo& info SIM_RawField::const { localReduceAxisOp<1>(op, dst, field, radius, info)
protected

Definition at line 1421 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField* SIM_RawField::cvalue

Definition at line 1135 of file SIM_RawField.h.

const SIM_RawField* SIM_RawField::depths
protected

Definition at line 1360 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal fpreal SIM_RawField::dir
protected

Definition at line 1360 of file SIM_RawField.h.

UT_VoxelArrayF & SIM_RawField::dst
protected

Definition at line 1402 of file SIM_RawField.h.

UT_VoxelArrayF UT_VoxelArrayF & SIM_RawField::field
protected
Examples:
SIM/SIM_GasAdd.h, and SIM/SIM_RadialEmit.h.

Definition at line 1402 of file SIM_RawField.h.

sim_PointVelocity SIM_RawField::getVelocity

Definition at line 975 of file SIM_RawField.h.

const SIM_RawIndexField const UT_JobInfo & SIM_RawField::info

Definition at line 300 of file SIM_RawField.h.

const UT_JobInfo& SIM_RawField::info

Definition at line 330 of file SIM_RawField.h.

const SIM_RawIndexField const UT_JobInfo& SIM_RawField::info

Definition at line 380 of file SIM_RawField.h.

Definition at line 389 of file SIM_RawField.h.

fpreal const UT_JobInfo& SIM_RawField::info

Definition at line 411 of file SIM_RawField.h.

Definition at line 829 of file SIM_RawField.h.

Definition at line 859 of file SIM_RawField.h.

Definition at line 960 of file SIM_RawField.h.

Definition at line 975 of file SIM_RawField.h.

Definition at line 1033 of file SIM_RawField.h.

fpreal32 fpreal32 int const UT_JobInfo& SIM_RawField::info

Definition at line 1073 of file SIM_RawField.h.

Definition at line 1360 of file SIM_RawField.h.

const UT_DMatrix4 fpreal const UT_JobInfo& SIM_RawField::info
protected

Definition at line 1443 of file SIM_RawField.h.

int const UT_DMatrix4 fpreal const UT_JobInfo& SIM_RawField::info
protected

Definition at line 1453 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal SIM_RawField::isocontour
protected

Definition at line 1360 of file SIM_RawField.h.

const UT_JobInfo & SIM_RawField::jobinfo

Definition at line 274 of file SIM_RawField.h.

const UT_JobInfo& SIM_RawField::jobinfo

Definition at line 341 of file SIM_RawField.h.

fpreal const SIM_RawField const UT_JobInfo& SIM_RawField::jobinfo

Definition at line 401 of file SIM_RawField.h.

Definition at line 1316 of file SIM_RawField.h.

fpreal64 REDUCE_NAMES const SIM_RawField* SIM_RawField::maskfield
protected

Definition at line 1341 of file SIM_RawField.h.

fpreal64 REDUCE_NAMES const SIM_RawField bool SIM_RawField::maskissdf
protected

Definition at line 1341 of file SIM_RawField.h.

fpreal64* SIM_RawField::masktotal
protected

Definition at line 1341 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal fpreal fpreal SIM_RawField::maxdist
protected

Definition at line 1360 of file SIM_RawField.h.

UT_Vector3 SIM_RawField::myBBoxOrig
protected

Definition at line 1474 of file SIM_RawField.h.

UT_Vector3 SIM_RawField::myBBoxSize
protected

Definition at line 1474 of file SIM_RawField.h.

SIM_FieldBoundary SIM_RawField::myBoundary[3][2]
protected

Definition at line 1479 of file SIM_RawField.h.

fpreal SIM_RawField::myBoundaryValue[3][2]
protected

Definition at line 1480 of file SIM_RawField.h.

UT_VoxelArrayF* SIM_RawField::myField
protected

We always have myField at our current resolution. myGrid only exists if it matches myField. If myField changes, myGrid will be destroyed. If something updates the grid the field is out of date so is flagged.

Definition at line 1465 of file SIM_RawField.h.

bool SIM_RawField::myFieldOutOfDate
mutableprotected

Definition at line 1467 of file SIM_RawField.h.

CE_Grid* SIM_RawField::myGrid
mutableprotected

Definition at line 1466 of file SIM_RawField.h.

UT_Vector3 SIM_RawField::myOrig
protected

Definition at line 1471 of file SIM_RawField.h.

SIM_FieldSample SIM_RawField::mySample
protected

Definition at line 1458 of file SIM_RawField.h.

UT_Vector3 SIM_RawField::mySize
protected

Definition at line 1471 of file SIM_RawField.h.

fpreal SIM_RawField::myVoxelDiameter
protected

Definition at line 1477 of file SIM_RawField.h.

UT_Vector3 SIM_RawField::myVoxelSize
protected

Definition at line 1476 of file SIM_RawField.h.

REDUCE_NAMES SIM_RawField::op
protected

Definition at line 1333 of file SIM_RawField.h.

fpreal64 REDUCE_NAMES SIM_RawField::op
protected

Definition at line 1341 of file SIM_RawField.h.

fpreal32 fpreal32 int SIM_RawField::parity

Definition at line 1073 of file SIM_RawField.h.

Definition at line 960 of file SIM_RawField.h.

int64 int const SIM_RawIndexField const SIM_RawField* SIM_RawField::pressureboundary

Definition at line 368 of file SIM_RawField.h.

int const SIM_RawIndexField const SIM_RawField* SIM_RawField::pressureboundary

Definition at line 389 of file SIM_RawField.h.

GEO_PointTreeGAOffset* SIM_RawField::pttree

Definition at line 960 of file SIM_RawField.h.

UT_VoxelArrayF UT_VoxelArrayF float SIM_RawField::radius
protected

Definition at line 1402 of file SIM_RawField.h.

fpreal SIM_RawField::scale

Definition at line 401 of file SIM_RawField.h.

const UT_DMatrix4 fpreal SIM_RawField::scale
protected

Definition at line 1443 of file SIM_RawField.h.

int const UT_DMatrix4 fpreal SIM_RawField::scale
protected

Definition at line 1453 of file SIM_RawField.h.

const SIM_RawField & SIM_RawField::source

Definition at line 274 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField* SIM_RawField::stencil

Definition at line 1033 of file SIM_RawField.h.

fpreal32 fpreal32 SIM_RawField::sumweight

Definition at line 1073 of file SIM_RawField.h.

const SIM_RawField* SIM_RawField::surface

Definition at line 1033 of file SIM_RawField.h.

const SIM_RawField fpreal fpreal SIM_RawField::Tamb

Definition at line 859 of file SIM_RawField.h.

const SIM_RawField* SIM_RawField::temperature

Definition at line 859 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField fpreal SIM_RawField::threshold

Definition at line 1316 of file SIM_RawField.h.

Definition at line 759 of file SIM_RawField.h.

sim_PointVelocity float SIM_RawField::time

Definition at line 975 of file SIM_RawField.h.

Definition at line 274 of file SIM_RawField.h.

Definition at line 829 of file SIM_RawField.h.

const SIM_RawField fpreal SIM_RawField::up

Definition at line 859 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField* SIM_RawField::valid
protected

Definition at line 1360 of file SIM_RawField.h.

int SIM_RawField::vdbidx
protected

Definition at line 1453 of file SIM_RawField.h.

const SIM_RawField * SIM_RawField::velx

Definition at line 759 of file SIM_RawField.h.

const SIM_RawField const SIM_RawField * SIM_RawField::vely

Definition at line 759 of file SIM_RawField.h.

Definition at line 759 of file SIM_RawField.h.

sim_PointVelocity float float SIM_RawField::voxelsize

Definition at line 975 of file SIM_RawField.h.

fpreal32 SIM_RawField::weight

Definition at line 1073 of file SIM_RawField.h.

const UT_DMatrix4& SIM_RawField::xform
protected

Definition at line 1443 of file SIM_RawField.h.

int const UT_DMatrix4& SIM_RawField::xform
protected

Definition at line 1453 of file SIM_RawField.h.


The documentation for this class was generated from the following file: