Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::Particle Struct Reference

#include <tfParticle.h>

Inheritance diagram for TissueForge::Particle:
Collaboration diagram for TissueForge::Particle:

Public Member Functions

struct ParticleHandlehandle ()
 Get a handle for this particle.
 
HRESULT addpart (int32_t uid)
 
HRESULT removepart (int32_t uid)
 
Particleparticle (int i)
 
FVector3 global_position ()
 Get the global position.
 
void set_global_position (const FVector3 &pos)
 Set the global position.
 
bool verify ()
 
 operator Cluster * ()
 Cast to a cluster type. Limits casting to cluster by type.
 
std::string toString ()
 Get a JSON string representation.
 

Static Public Member Functions

static ParticlefromString (const std::string &str)
 Create from a JSON string representation.
 

Public Attributes

union { 
 
   FPTYPE   f [4] 
 
   FVector3   force 
 
   struct { 
 
      FPTYPE   __dummy0 [3] 
 
      FPTYPE   number_density 
 
   }  
 
};  
 
union { 
 
   FVector3   force_i 
 
};  
 
union { 
 
   FPTYPE   v [4] 
 
   FVector3   velocity 
 
   struct { 
 
      FPTYPE   __dummy1 [3] 
 
      FPTYPE   inv_number_density 
 
   }  
 
};  
 
union { 
 
   FPTYPE   x [4] 
 
   FVector3   position 
 
   struct { 
 
      FPTYPE   __dummy2 [3] 
 
      uint32_t   creation_time 
 
   }  
 
};  
 
union { 
 
   FVector3   persistent_force 
 
};  
 
FPTYPE imass
 
FPTYPE radius
 
FPTYPE mass
 
FPTYPE q
 
FVector3 p0
 
FVector3 v0
 
FVector3 xk [4]
 
FVector3 vk [4]
 
int id
 
int vid
 
int16_t typeId
 
int32_t clusterId
 
uint16_t flags
 
struct ParticleHandle_handle
 
int32_t * parts
 
uint16_t nr_parts
 
uint16_t size_parts
 
rendering::Stylestyle
 
struct state::StateVectorstate_vector
 

Detailed Description

The particle data structure.

Instance vars for each particle.

Note that the arrays for x, v and f are 4 entries long for proper alignment.

All particles are stored in a series of contiguous blocks of memory that are owned by the space cells. Each space cell has a array of particle structs.

If you're building a model, you should probably instead be working with a ParticleHandle.

Member Function Documentation

◆ addpart()

HRESULT TissueForge::Particle::addpart ( int32_t uid)

add a particle (id) to this type

◆ fromString()

static Particle * TissueForge::Particle::fromString ( const std::string & str)
static

Create from a JSON string representation.

The returned particle is not automatically registered with the engine.

To properly register a particle from a string, pass the string to the particle constructor of the appropriate particle type or cluster.

Parameters
strconstructor string, as returned by toString
Returns
unregistered particle

◆ operator Cluster *()

TissueForge::Particle::operator Cluster * ( )

Cast to a cluster type. Limits casting to cluster by type.

Returns
Cluster*

◆ particle()

Particle * TissueForge::Particle::particle ( int i)
inline

Get the ith particle, if this particle is a cluster.

◆ removepart()

HRESULT TissueForge::Particle::removepart ( int32_t uid)

removes a particle from this cluster. Sets the particle cluster id to -1, and removes if from this cluster's list.

◆ verify()

bool TissueForge::Particle::verify ( )

performs a self-verify, in debug mode raises assertion if not valid

Member Data Documentation

◆ [union]

union { ... } TissueForge::Particle

Particle force

ONLY the coherent part of the force should go here. We use multi-step integrators, that need to separate the random and coherent forces.

Force gets cleared each step, along with number density.

◆ [union]

union { ... } TissueForge::Particle

Initial particle force

At each step, the total force acting on a particle is reset to this settable value.

◆ [union]

union { ... } TissueForge::Particle

Particle position

◆ [union]

union { ... } TissueForge::Particle

Random force.

◆ [union]

union { ... } TissueForge::Particle

Particle velocity

◆ _handle

struct ParticleHandle* TissueForge::Particle::_handle

pointer to the handle.

Particle data gets moved around between cells, and the handle provides a safe way to retrieve them.

◆ clusterId

int32_t TissueForge::Particle::clusterId

Cluster id of this part

◆ flags

uint16_t TissueForge::Particle::flags

Particle flags

◆ id

int TissueForge::Particle::id

Particle id, virtual id TODO: not sure what virtual id is...

◆ imass

FPTYPE TissueForge::Particle::imass

Inverse mass

◆ mass

FPTYPE TissueForge::Particle::mass

Particle mass

◆ nr_parts

uint16_t TissueForge::Particle::nr_parts

number of particle ids that belong to this particle, if it is a cluster.

◆ parts

int32_t* TissueForge::Particle::parts

list of particle ids that belong to this particle, if it is a cluster.

◆ q

FPTYPE TissueForge::Particle::q

Individual particle charge, if needed

◆ radius

FPTYPE TissueForge::Particle::radius

Particle radius

◆ size_parts

uint16_t TissueForge::Particle::size_parts

size of particle ids that belong to this particle, if it is a cluster.

◆ state_vector

struct state::StateVector* TissueForge::Particle::state_vector

optional pointer to state vector

Set at construction time when species are present in a simulation.

◆ style

rendering::Style* TissueForge::Particle::style

Style pointer, set at object construction time. Can be set by the user after construction. The base particle type has a default style.

◆ typeId

int16_t TissueForge::Particle::typeId

Particle type id


The documentation for this struct was generated from the following files: