mantaflow
0.10
A framework for fluid simulation
|
Main class for particle systems. More...
#include <particle.h>
Public Member Functions | |
PYTHON () ParticleSystem(FluidSolver *parent) | |
virtual SystemType | getType () const |
S & | operator[] (IndexInt idx) |
accessors | |
const S & | operator[] (IndexInt idx) const |
IndexInt | size () const |
virtual IndexInt | getSizeSlow () const |
slow virtual function of base class, also returns size | |
PYTHON () int pySize() const | |
note , special call for python, note - doesnt support more than 2b parts! | |
int | getStatus (IndexInt idx) const |
query status | |
bool | isActive (IndexInt idx) const |
PYTHON () void setPos(const IndexInt idx | |
safe accessor for python | |
PYTHON () Vec3 getPos(IndexInt idx) const | |
PYTHON () void getPosPdata(ParticleDataImpl< Vec3 > &target) const | |
copy all positions into pdata vec3 field | |
PYTHON () void setPosPdata(const ParticleDataImpl< Vec3 > &source) | |
void | transformPositions (Vec3i dimOld, Vec3i dimNew) |
transform coordinate system from one grid size to another (usually upon load) | |
void | doCompress () |
explicitly trigger compression from outside | |
void | insertBufferedParticles () |
insert buffered positions as new particles, update additional particle data | |
void | resizeAll (IndexInt newsize) |
resize data vector, and all pdata fields | |
void | kill (IndexInt idx) |
adding and deleting | |
IndexInt | add (const S &data) |
PYTHON () void clear() | |
remove all particles, init 0 length arrays (also pdata) | |
PYTHON () void advectInGrid(const FlagGrid &flags | |
Advect particle in grid velocity field. | |
PYTHON () void projectOutside(Grid< Vec3 > &gradient) | |
Project particles outside obstacles. | |
PYTHON () void projectOutOfBnd(const FlagGrid &flags | |
virtual ParticleBase * | clone () |
virtual std::string | infoString () const |
void | checkPartIndex (IndexInt idx) const |
debugging | |
Public Member Functions inherited from Manta::ParticleBase | |
PYTHON () ParticleBase(FluidSolver *parent) | |
virtual void | cloneParticleData (ParticleBase *nm) |
copy all the particle data thats registered with the other particle system to this one | |
void | addBuffered (const Vec3 &pos) |
add a position as potential candidate for new particle (todo, make usable from parallel threads) | |
PYTHON () PbClass *create(PbType type | |
particle data functions More... | |
void | registerPdata (ParticleDataBase *pdata) |
add a particle data field, set its parent particle-system pointer | |
void | registerPdataReal (ParticleDataImpl< Real > *pdata) |
void | registerPdataVec3 (ParticleDataImpl< Vec3 > *pdata) |
void | registerPdataInt (ParticleDataImpl< int > *pdata) |
void | deregister (ParticleDataBase *pdata) |
remove a particle data entry | |
void | addAllPdata () |
add one zero entry to all data fields | |
IndexInt | getNumPdata () const |
how many are there? | |
ParticleDataBase * | getPdata (int i) |
access one of the fields | |
Public Attributes | |
const Vec3 & | pos { DEBUG_ONLY(checkPartIndex(idx)) |
mData [idx] | pos = pos |
const MACGrid & | vel |
const MACGrid const int | integrationMode |
const MACGrid const int const bool | deleteInObstacle =true |
const MACGrid const int const bool const bool | stopInObstacle =true |
const MACGrid const int const bool const bool const ParticleDataImpl< int > * | ptype =NULL |
const MACGrid const int const bool const bool const ParticleDataImpl< int > const int | exclude =0) |
const Real | bnd |
const Real const std::string & | plane ="xXyYzZ" |
const Real const std::string const ParticleDataImpl< int > * | ptype =NULL |
const Real const std::string const ParticleDataImpl< int > const int | exclude =0) |
Public Attributes inherited from Manta::ParticleBase | |
PbTypeVec | T =PbTypeVec() |
PbTypeVec const std::string & | name = "") |
Protected Member Functions | |
virtual void | compress () |
reduce storage , called by doCompress | |
Protected Attributes | |
IndexInt | mDeletes |
deletion count , and interval for re-compressing | |
IndexInt | mDeleteChunk |
std::vector< S > | mData |
the particle data | |
Protected Attributes inherited from Manta::ParticleBase | |
std::vector< Vec3 > | mNewBuffer |
new particle candidates | |
bool | mAllowCompress |
allow automatic compression / resize? disallowed for, eg, flip particle systems | |
std::vector< ParticleDataBase * > | mPartData |
store particle data , each pointer has its own storage vector of a certain type (int, real, vec3) | |
std::vector< ParticleDataImpl< Real > * > | mPdataReal |
lists of different types, for fast operations w/o virtual function calls (all calls necessary per particle) | |
std::vector< ParticleDataImpl< Vec3 > * > | mPdataVec3 |
std::vector< ParticleDataImpl< int > * > | mPdataInt |
bool | mFreePdata |
indicate that pdata of this particle system is copied, and needs to be freed | |
Additional Inherited Members | |
Public Types inherited from Manta::ParticleBase | |
enum | SystemType { BASE =0, PARTICLE, VORTEX, FILAMENT, FLIP, TURBULENCE, INDEX } |
enum | ParticleStatus { PNONE = 0, PNEW = (1<<1), PDELETE = (1<<10), PINVALID = (1<<30) } |
Main class for particle systems.
Basetype S must at least contain flag, pos fields
|
inline |
return size of container note , python binding disabled for now! cannot yet deal with long-long types