HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_SeedVolume.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GAS_SeedVolume.h ( GAS Library, C++)
7  *
8  * COMMENTS: Used to initialize FLIP particles in an empty region
9  * in the event that the simulation volume is moved.
10  * This can occur when tracking an object. The new particles
11  * will match the provided surface and velocity field.
12  */
13 
14 #ifndef __GAS_SeedVolume__
15 #define __GAS_SeedVolume__
16 
17 #include "GAS_API.h"
18 
19 #include "GAS_SubSolver.h"
20 #include "GAS_Utils.h"
21 
22 #include <GU/GU_Detail.h>
23 #include <GA/GA_SplittableRange.h>
24 
26 #include <UT/UT_UniquePtr.h>
27 
29 {
30 public:
31  GET_DATA_FUNC_S(GAS_NAME_SURFACE, SurfaceName);
32  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
33  GET_DATA_FUNC_S(GAS_NAME_VELOCITY, VelocityName);
34  GET_DATA_FUNC_S("newvolume", VolumeName);
35 
36  GET_DATA_FUNC_S("velocityattribute", VelocityAttributeName);
37 
38  GETSET_DATA_FUNCS_I("particlespervoxel", ParticlesPerVoxel);
39  GETSET_DATA_FUNCS_F("oversampling", Oversampling);
40  GETSET_DATA_FUNCS_F("oversamplingbandwidth", OversamplingBandwidth);
41  GETSET_DATA_FUNCS_B("oversamplebounds", OversampleBounds);
42 
43  GETSET_DATA_FUNCS_V3("volumesize", VolumeSize);
44  GETSET_DATA_FUNCS_V3("volumecenter", VolumeCenter);
45 
46  GETSET_DATA_FUNCS_B("usewaterline", UseWaterline);
47  GETSET_DATA_FUNCS_F("waterline", Waterline);
48  GETSET_DATA_FUNCS_V3("waterlinedirection", WaterlineDirection);
49 
50  GET_DATA_FUNC_B("flagnewparticles", FlagNewParticles);
51  GET_DATA_FUNC_S("newparticleattribute", NewParticleAttributeName);
52 
53  GETSET_DATA_FUNCS_B("pscaletoggle",PscaleToggle);
54  GETSET_DATA_FUNCS_F("particleradius", ParticleRadius);
56 
57  GETSET_DATA_FUNCS_I("slice", Slice);
58 
59 protected:
60  explicit GAS_SeedVolume(const SIM_DataFactory *factory);
61  ~GAS_SeedVolume() override;
62 
63  bool solveGasSubclass(SIM_Engine &engine,
64  SIM_Object *obj,
65  SIM_Time time,
66  SIM_Time timestep) override;
67 
68  void seedVolume(SIM_Object *obj,
69  GU_Detail *gdp,
70  const SIM_RawField *surface,
71  const SIM_RawField *newvolume,
72  const SIM_RawIndexField *indexfield,
73  const SIM_VectorField *velocity) const;
74 
76  {
77  fpreal seed, particleradius;
78  fpreal oversampling, oversamplingcutoff;
80  const SIM_RawField *surface, *newvolume;
83  int particlespervoxel, slice;
84  UT_Vector3I orig, lowersim, uppersim;
86 
88 
90  };
91 
92  THREADED_METHOD1_CONST(GAS_SeedVolume, parms.volumevoxels->numTiles() > 1, // Inequality bc there is no explicit "canMultiThread" method for UT_VoxelArray
93  seedNewVolume,
94  const gas_SeedNewVolumeParms &, parms)
95 
96  void seedNewVolumePartial(const gas_SeedNewVolumeParms &parms,
97  const UT_JobInfo &info) const;
98 private:
99 
100  static const SIM_DopDescription *getDopDescription();
101 
105  "Gas Seed Volume",
106  getDopDescription());
107 };
108 
109 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
#define GETSET_DATA_FUNCS_B(DataName, FuncName)
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
UT_ValArray< UT_UniquePtr< UT_Vector3Array > > * ptslist
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#define GAS_NAME_VELOCITY
Definition: GAS_Utils.h:42
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
const SIM_RawIndexField * indexfield
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
#define THREADED_METHOD1_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
fpreal64 fpreal
Definition: SYS_Types.h:277
#define GET_DATA_FUNC_B(DataName, FuncName)
#define SIM_NAME_SEED
Definition: SIM_Names.h:185
#define GAS_NAME_SURFACE
Definition: GAS_Utils.h:38
This class holds a three dimensional vector field.
#define GET_DATA_FUNC_S(DataName, FuncName)