GAS_SubSolver Class Reference

#include <GAS_SubSolver.h>

Inheritance diagram for GAS_SubSolver:

SIM_Solver SIM_OptionsUser SIM_Data GAS_AdjustElasticity GAS_AdjustParticleCoordinates GAS_Advect GAS_Analysis GAS_BuildCollisionMask GAS_BuildRelationshipMask GAS_Buoyancy GAS_Calculate GAS_ComputeParticleAttributes GAS_CorrectByMarkers GAS_Cross GAS_Diffuse GAS_DSD GAS_EachDataSolver GAS_Elasticity GAS_EnforceBoundary GAS_ExternalForces GAS_Extrapolate GAS_Feedback GAS_FieldToParticle GAS_FieldVex GAS_GeometryToSDF GAS_Integrator GAS_Lookup GAS_MatchField GAS_NetFetchData GAS_NetFieldBorderExchange GAS_NetSliceBalance GAS_NetSliceExchange GAS_ParticleForces GAS_ParticleMoveToIso GAS_ParticleNeighbourUpdate GAS_ParticlePressure GAS_ParticleSeparate GAS_ParticleToField GAS_ParticleToSDF GAS_ProjectNonDivergent GAS_Reduce GAS_ReduceLocal GAS_ReinitializeSDF GAS_ResizeField GAS_Rest GAS_SandForces GAS_SeedMarkers GAS_SeedParticles GAS_SPHDensity GAS_SPHForces GAS_StrainForces GAS_StrainIntegrate GAS_SubStep GAS_SurfaceSnap GAS_SurfaceTension GAS_VelocityStretch GAS_VorticleForces GAS_Wavelets HDK_Sample::SIM_GasAdd

List of all members.

Classes

struct  RelationshipParms

Public Types

enum  MIX_NAMES {
  MIX_COPY, MIX_ADD, MIX_SUB, MIX_MUL,
  MIX_DIV, MIX_MAX, MIX_MIN, MIX_AVERAGE,
  NUM_MIX
}
enum  TIMESCALE_NAMES {
  TIMESCALE_NONE, TIMESCALE_ADD, TIMESCALE_MULT, TIMESCALE_BOTH,
  TIMESCALE_DIVIDE, TIMESCALE_SCALEMULT, NUM_TIMESCALE
}
enum  LENGTHSCALE_NAMES {
  LENGTHSCALE_NONE, LENGTHSCALE_LENGTH, LENGTHSCALE_AREA, LENGTHSCALE_VOLUME,
  NUM_LENGTHSCALE
}

Public Member Functions

virtual SIM_Result solveObjectsSubclass (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep)
 Merely calls solve on each object.
virtual SIM_Result postSolveObjectsSubclass (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep)
 Merely calls postSolve on each object.
virtual bool solveGas (SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)
const SIM_GeometrygetGeometry (SIM_Object *obj, const char *name, bool silent=false)
SIM_GeometrygetGeometryNonConst (SIM_Object *obj, const char *name, bool silent=false)
SIM_GeometryCopygetGeometryCopy (SIM_Object *obj, const char *name, bool silent=false)
SIM_ScalarFieldgetScalarField (SIM_Object *obj, const char *name, bool silent=false)
SIM_VectorFieldgetVectorField (SIM_Object *obj, const char *name, bool silent=false)
SIM_MatrixFieldgetMatrixField (SIM_Object *obj, const char *name, bool silent=false)
SIM_IndexFieldgetIndexField (SIM_Object *obj, const char *name, bool silent=false)
const SIM_ScalarFieldgetConstScalarField (SIM_Object *obj, const char *name, bool silent=false)
const SIM_VectorFieldgetConstVectorField (SIM_Object *obj, const char *name, bool silent=false)
const SIM_MatrixFieldgetConstMatrixField (SIM_Object *obj, const char *name, bool silent=false)
const SIM_IndexFieldgetConstIndexField (SIM_Object *obj, const char *name, bool silent=false)
const SIM_PositiongetConstPosFromField (SIM_Object *obj, const char *name)
void getWorldToGeometry (UT_DMatrix4 &xform, SIM_Object *obj, const char *geopath)
 Builds the transform mapping world -> geo.
void getGeometryToWorld (UT_DMatrix4 &xform, SIM_Object *obj, const char *geopath)
 Builds the transform mapping geo -> world.
SIM_GeometryCopygetOrCreateGeometry (SIM_Object *obj, const char *name)
SIM_ScalarFieldgetOrCreateScalarField (SIM_Object *obj, const char *name)
SIM_VectorFieldgetOrCreateVectorField (SIM_Object *obj, const char *name)
SIM_MatrixFieldgetOrCreateMatrixField (SIM_Object *obj, const char *name)
SIM_IndexFieldgetOrCreateIndexField (SIM_Object *obj, const char *name)
void getMatchingData (SIM_DataArray &data, SIM_Object *obj, const char *name)
void getMatchingData (SIM_DataArray &data, UT_StringArray &datanames, SIM_Object *obj, const char *name)
void getMatchingConstData (SIM_ConstDataArray &data, UT_StringArray &datanames, SIM_Object *obj, const char *name)
void matchField (SIM_ScalarField *field, const SIM_ScalarField *reffield)
void matchField (SIM_VectorField *field, const SIM_ScalarField *reffield)
void matchField (SIM_MatrixField *field, const SIM_ScalarField *reffield)
void matchField (SIM_IndexField *field, const SIM_ScalarField *reffield)
void buildRelationshipField (SIM_ScalarField *mask, SIM_VectorField *vel, SIM_IndexField *index, UT_DMatrix4 masktoworld, SIM_Object *srcobj, bool usepoint, bool usesdf, bool allownonsdf, bool negate, fpreal particlebandwidth, fpreal bandwidth)
 THREADED_METHOD2_CONST (GAS_SubSolver, gdp->points().entries() > 1000, clearForces, GU_Detail *, gdp, bool, cleartorque) void clearForcesPartial(GU_Detail *gdp
 Zeros out the force and optionaly torque attributes.
void clearForces (GU_Detail *gdp) const
 THREADED_METHOD5_CONST (GAS_SubSolver, gdp->points().entries() > 1000, applyForces, GU_Detail *, gdp, SIM_Time, timestep, bool, densityscale, bool, doorient, bool, updatepos) void applyForcesPartial(GU_Detail *gdp
bool buildSPH (GAS_SPH &sph, const SIM_Geometry *geo) const
bool buildSPH (GAS_SPH &sph, const SIM_Object *obj) const

Static Public Member Functions

static fpreal mixValues (MIX_NAMES mixtype, fpreal dest, fpreal src)
 Performs the requires mixing.
static fpreal applyTimeScalePow (fpreal value, fpreal t)
static void applyTimeScale (fpreal &add, fpreal &mul, fpreal timestep, int timescale)
static fpreal applyLengthScale (fpreal val, fpreal width, int scaletype)

Public Attributes

bool cleartorque
bool const UT_JobInfo &info const
SIM_Time timestep
SIM_Time bool densityscale
SIM_Time bool bool doorient
SIM_Time bool bool bool updatepos
SIM_Time bool bool bool const
UT_JobInfo &info 
const

Protected Member Functions

 GAS_SubSolver (const SIM_DataFactory *factory)
virtual ~GAS_SubSolver ()
virtual bool solveGasSubclass (SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
virtual bool postSolveGasSubclass (SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)
fpreal getPropertyFromState (const SIM_Object &object, const SIM_Property &property) const
 Get a property value by looking at the Physical Parms of an object.
virtual fpreal getPropertyAtPositionSubclass (const SIM_Object &object, const UT_Vector3 &worldspacepos, const SIM_Property &property) const
 Evaluates property at a given position.
virtual fpreal getPropertyAtPointSubclass (const SIM_Object &object, int ptnum, const SIM_Property &property) const
virtual SIM_PropertyResolvergetPropertyResolverSubclass (const SIM_Object &object, const SIM_Property &property) const
 Builds a resolver for evaulating properties swiftly.
fpreal calculateTimestep (SIM_Engine &engine, const SIM_VectorField *velocity, fpreal cflcond) const
fpreal calculateTimestep (GU_ConstDetailHandle gdh, fpreal cflcond) const
 THREADED_METHOD1 (GAS_SubSolver, parms.mask->shouldMultiThread(), buildRelationshipFieldInternal, const RelationshipParms &, parms) void buildRelationshipFieldInternalPartial(const RelationshipParms &parms
 Builds a relationship field after most stuff has been setup.

Protected Attributes

const UT_JobInfoinfo

Static Protected Attributes

static PRM_Name ourMixMethods [NUM_MIX+1]
 Holds the parm names for our mix methods.
static PRM_ChoiceList ourMixMethodMenu
static PRM_Name ourTimeScaleMethods [NUM_TIMESCALE+1]
static PRM_ChoiceList ourTimeScaleMenu
static PRM_Name ourLengthScaleMethods [NUM_LENGTHSCALE+1]
static PRM_ChoiceList ourLengthScaleMenu


Detailed Description

Examples:

SIM/SIM_GasAdd.h.

Definition at line 49 of file GAS_SubSolver.h.


Member Enumeration Documentation

Enumerator:
LENGTHSCALE_NONE 
LENGTHSCALE_LENGTH 
LENGTHSCALE_AREA 
LENGTHSCALE_VOLUME 
NUM_LENGTHSCALE 

Definition at line 250 of file GAS_SubSolver.h.

Enumerator:
MIX_COPY 
MIX_ADD 
MIX_SUB 
MIX_MUL 
MIX_DIV 
MIX_MAX 
MIX_MIN 
MIX_AVERAGE 
NUM_MIX 

Definition at line 227 of file GAS_SubSolver.h.

Enumerator:
TIMESCALE_NONE 
TIMESCALE_ADD 
TIMESCALE_MULT 
TIMESCALE_BOTH 
TIMESCALE_DIVIDE 
TIMESCALE_SCALEMULT 
NUM_TIMESCALE 

Definition at line 239 of file GAS_SubSolver.h.


Constructor & Destructor Documentation

GAS_SubSolver::GAS_SubSolver ( const SIM_DataFactory factory  )  [explicit, protected]

virtual GAS_SubSolver::~GAS_SubSolver (  )  [protected, virtual]


Member Function Documentation

static fpreal GAS_SubSolver::applyLengthScale ( fpreal  val,
fpreal  width,
int  scaletype 
) [static]

Applies the effect of the given LENGTHSCALE_NAMES to the quantitity given

static void GAS_SubSolver::applyTimeScale ( fpreal add,
fpreal mul,
fpreal  timestep,
int  timescale 
) [static]

Applies the effect of TIMESCALE_NAMES to the additive and multiplicative values.

static fpreal GAS_SubSolver::applyTimeScalePow ( fpreal  value,
fpreal  t 
) [static]

Scales value exponentially for timestep t. v' = e ^ (ln(v) * t)

void GAS_SubSolver::buildRelationshipField ( SIM_ScalarField mask,
SIM_VectorField vel,
SIM_IndexField index,
UT_DMatrix4  masktoworld,
SIM_Object srcobj,
bool  usepoint,
bool  usesdf,
bool  allownonsdf,
bool  negate,
fpreal  particlebandwidth,
fpreal  bandwidth 
)

Builds a relationship field, storing distance to each object in the destination field, along with the OBJID and object velocity in the optional index and vector fields. The negate flag controls the sign of the generated fields, collision have "inside object" as negative so have a negate of true. Mask should already be initialized as we only write to new values that are more-in the relevant object. To trigger a bandwidth, initialize mask to the max dist you want to write. The given fields must all be aligned. Bandwidth is how many voxels to border particles by for our lookup.

bool GAS_SubSolver::buildSPH ( GAS_SPH sph,
const SIM_Object obj 
) const

bool GAS_SubSolver::buildSPH ( GAS_SPH sph,
const SIM_Geometry geo 
) const

Builds the GAS_SPH data structure, either directly from the given SIM_Geometry or by using any SIM_PointNeighbourList attached as NeighbourList. The object version looks for Geometry/NeighbourList Returns false if failed, either due to null geometry or missing vital attributes.

fpreal GAS_SubSolver::calculateTimestep ( GU_ConstDetailHandle  gdh,
fpreal  cflcond 
) const [protected]

Determines the appropriate timestep dependent on the geometry data. The size of the particles is used as the limitting factor for CFL condition. If no particle scale or velocity exists, returns infinite.

fpreal GAS_SubSolver::calculateTimestep ( SIM_Engine engine,
const SIM_VectorField velocity,
fpreal  cflcond 
) const [protected]

Determines the appropriate timestep dependent on the velocity field.

void GAS_SubSolver::clearForces ( GU_Detail gdp  )  const [inline]

Definition at line 287 of file GAS_SubSolver.h.

const SIM_IndexField* GAS_SubSolver::getConstIndexField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

const SIM_MatrixField* GAS_SubSolver::getConstMatrixField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

const SIM_Position* GAS_SubSolver::getConstPosFromField ( SIM_Object obj,
const char *  name 
)

const SIM_ScalarField* GAS_SubSolver::getConstScalarField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

const SIM_VectorField* GAS_SubSolver::getConstVectorField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

const SIM_Geometry* GAS_SubSolver::getGeometry ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

Retrieves the SIM_DATA specified by the option* given by the name. Ie, look up in our options, find the data name, look up a data matching the name, return resulting data Reports message if a field is missing unless silent is set.

SIM_GeometryCopy* GAS_SubSolver::getGeometryCopy ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

SIM_Geometry* GAS_SubSolver::getGeometryNonConst ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

void GAS_SubSolver::getGeometryToWorld ( UT_DMatrix4 xform,
SIM_Object obj,
const char *  geopath 
)

Builds the transform mapping geo -> world.

SIM_IndexField* GAS_SubSolver::getIndexField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

void GAS_SubSolver::getMatchingConstData ( SIM_ConstDataArray data,
UT_StringArray datanames,
SIM_Object obj,
const char *  name 
)

void GAS_SubSolver::getMatchingData ( SIM_DataArray data,
UT_StringArray datanames,
SIM_Object obj,
const char *  name 
)

void GAS_SubSolver::getMatchingData ( SIM_DataArray data,
SIM_Object obj,
const char *  name 
)

Retrieves all of the SIM_DATAs that match the pattern stored in the option given by name.

Examples:
SIM/SIM_GasAdd.C.

SIM_MatrixField* GAS_SubSolver::getMatrixField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

SIM_GeometryCopy* GAS_SubSolver::getOrCreateGeometry ( SIM_Object obj,
const char *  name 
)

Returns the matching SIM_Data. If it doesn't exist, creates a new one. The resulting data is not guaranteed to exist - a bad name could end up prohibitting creation.

SIM_IndexField* GAS_SubSolver::getOrCreateIndexField ( SIM_Object obj,
const char *  name 
)

SIM_MatrixField* GAS_SubSolver::getOrCreateMatrixField ( SIM_Object obj,
const char *  name 
)

SIM_ScalarField* GAS_SubSolver::getOrCreateScalarField ( SIM_Object obj,
const char *  name 
)

SIM_VectorField* GAS_SubSolver::getOrCreateVectorField ( SIM_Object obj,
const char *  name 
)

virtual fpreal GAS_SubSolver::getPropertyAtPointSubclass ( const SIM_Object object,
int  ptnum,
const SIM_Property property 
) const [protected, virtual]

Gets the value of some physical property for the supplied object at a given point on the object's geometry.

Reimplemented from SIM_Solver.

virtual fpreal GAS_SubSolver::getPropertyAtPositionSubclass ( const SIM_Object object,
const UT_Vector3 worldspacepos,
const SIM_Property property 
) const [protected, virtual]

Evaluates property at a given position.

Reimplemented from SIM_Solver.

fpreal GAS_SubSolver::getPropertyFromState ( const SIM_Object object,
const SIM_Property property 
) const [protected]

Get a property value by looking at the Physical Parms of an object.

virtual SIM_PropertyResolver* GAS_SubSolver::getPropertyResolverSubclass ( const SIM_Object object,
const SIM_Property property 
) const [protected, virtual]

Builds a resolver for evaulating properties swiftly.

Reimplemented from SIM_Solver.

SIM_ScalarField* GAS_SubSolver::getScalarField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

SIM_VectorField* GAS_SubSolver::getVectorField ( SIM_Object obj,
const char *  name,
bool  silent = false 
)

void GAS_SubSolver::getWorldToGeometry ( UT_DMatrix4 xform,
SIM_Object obj,
const char *  geopath 
)

Builds the transform mapping world -> geo.

void GAS_SubSolver::matchField ( SIM_IndexField field,
const SIM_ScalarField reffield 
)

void GAS_SubSolver::matchField ( SIM_MatrixField field,
const SIM_ScalarField reffield 
)

void GAS_SubSolver::matchField ( SIM_VectorField field,
const SIM_ScalarField reffield 
)

void GAS_SubSolver::matchField ( SIM_ScalarField field,
const SIM_ScalarField reffield 
)

Makes the given field match the reference field in terms of bounding box & voxel count. A no-op if reffield or field is null.

static fpreal GAS_SubSolver::mixValues ( MIX_NAMES  mixtype,
fpreal  dest,
fpreal  src 
) [static]

Performs the requires mixing.

virtual bool GAS_SubSolver::postSolveGasSubclass ( SIM_Engine engine,
SIM_Object obj,
SIM_Time  time,
SIM_Time  timestep 
) [inline, protected, virtual]

Reimplemented in GAS_ParticleForces.

Definition at line 163 of file GAS_SubSolver.h.

virtual SIM_Result GAS_SubSolver::postSolveObjectsSubclass ( SIM_Engine engine,
SIM_ObjectArray objects,
SIM_ObjectArray newobjects,
SIM_ObjectArray feedbacktoobjects,
const SIM_Time timestep 
) [virtual]

Merely calls postSolve on each object.

Reimplemented from SIM_Solver.

virtual bool GAS_SubSolver::solveGas ( SIM_Engine engine,
SIM_Object obj,
SIM_Time  time,
SIM_Time  timestep 
) [virtual]

Applies this subsolver for a single timestep. Returns true on success

virtual bool GAS_SubSolver::solveGasSubclass ( SIM_Engine engine,
SIM_Object obj,
SIM_Time  time,
SIM_Time  timestep 
) [protected, pure virtual]

virtual SIM_Result GAS_SubSolver::solveObjectsSubclass ( SIM_Engine engine,
SIM_ObjectArray objects,
SIM_ObjectArray newobjects,
SIM_ObjectArray feedbacktoobjects,
const SIM_Time timestep 
) [virtual]

Merely calls solve on each object.

Implements SIM_Solver.

Reimplemented in GAS_EachDataSolver, GAS_Integrator, and GAS_SubStep.

GAS_SubSolver::THREADED_METHOD1 ( GAS_SubSolver  ,
parms.mask->  shouldMultiThread(),
buildRelationshipFieldInternal  ,
const RelationshipParms ,
parms   
) const [protected]

Builds a relationship field after most stuff has been setup.

GAS_SubSolver::THREADED_METHOD2_CONST ( GAS_SubSolver  ,
gdp->  points).entries(,
1000  ,
clearForces  ,
GU_Detail ,
gdp  ,
bool  ,
cleartorque   
)

Zeros out the force and optionaly torque attributes.

GAS_SubSolver::THREADED_METHOD5_CONST ( GAS_SubSolver  ,
gdp->  points).entries(,
1000  ,
applyForces  ,
GU_Detail ,
gdp  ,
SIM_Time  ,
timestep  ,
bool  ,
densityscale  ,
bool  ,
doorient  ,
bool  ,
updatepos   
)

Integrates the force into the velocity/angvel. Optionally also adjusts the position by the effect of the acceleration (*not* the effect of the velocity!)


Member Data Documentation

Definition at line 284 of file GAS_SubSolver.h.

Reimplemented in GAS_FieldVex, GAS_SeedMarkers, and GAS_SeedMarkers.

Definition at line 302 of file GAS_SubSolver.h.

Reimplemented in GAS_FieldVex, GAS_SeedMarkers, and GAS_SeedMarkers.

Definition at line 284 of file GAS_SubSolver.h.

Definition at line 302 of file GAS_SubSolver.h.

Definition at line 302 of file GAS_SubSolver.h.

Definition at line 327 of file GAS_SubSolver.h.

PRM_Name GAS_SubSolver::ourLengthScaleMethods[NUM_LENGTHSCALE+1] [static, protected]

Definition at line 326 of file GAS_SubSolver.h.

Definition at line 321 of file GAS_SubSolver.h.

PRM_Name GAS_SubSolver::ourMixMethods[NUM_MIX+1] [static, protected]

Holds the parm names for our mix methods.

Definition at line 320 of file GAS_SubSolver.h.

Definition at line 324 of file GAS_SubSolver.h.

PRM_Name GAS_SubSolver::ourTimeScaleMethods[NUM_TIMESCALE+1] [static, protected]

Definition at line 323 of file GAS_SubSolver.h.

Definition at line 302 of file GAS_SubSolver.h.


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

Generated on Mon Jan 28 00:48:13 2013 for HDK by  doxygen 1.5.9