|
Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
|
A handle to a particle. More...
#include <tfParticle.h>

Public Member Functions | |
| Particle * | part () |
| Gets the actual particle of this handle. | |
| Particle * | get () |
| Gets the actual particle of this handle. | |
| ParticleType * | type () |
| Gets the particle type of this handle. | |
| ParticleHandle (const int &id) | |
| virtual std::string | str () const |
| virtual ParticleHandle * | fission () |
| virtual ParticleHandle * | split () |
| Splits a single particle into two. | |
| virtual ParticleHandle * | split (const FVector3 &childDirection) |
| Splits a single particle into two along a given direction. | |
| virtual ParticleHandle * | split (const FPTYPE &childRatio) |
| Splits a single particle into two with sizes according to a given ratio. | |
| virtual ParticleHandle * | split (const std::vector< FPTYPE > &speciesRatios) |
| Splits a single particle into two and allocates species according to given ratios. | |
| virtual ParticleHandle * | split (const FVector3 &childDirection, const FPTYPE &childRatio, ParticleType *parentType=NULL, ParticleType *childType=NULL) |
| Splits a single particle into two along a given direction, with sizes according to a given ratio, and and optionally with different resulting particle types. | |
| virtual ParticleHandle * | split (const FVector3 &childDirection, const FPTYPE &childRatio, const std::vector< FPTYPE > &speciesRatios, ParticleType *parentType=NULL, ParticleType *childType=NULL) |
| Splits a single particle into two along a given direction, with sizes according to a given ratio, allocates species according to given ratios, and optionally with different resulting particle types. | |
| HRESULT | destroy () |
| Destroys the particle and removes it from inventory. | |
| FVector3 | sphericalPosition (Particle *particle=NULL, FVector3 *origin=NULL) |
| Calculates the particle's coordinates in spherical coordinates. | |
| FVector3 | relativePosition (const FVector3 &origin, const bool &comp_bc=true) |
| Computes the relative position with respect to an origin while optionally account for boundary conditions. | |
| virtual FMatrix3 | virial (FPTYPE *radius=NULL) |
| Computes the virial tensor. Optionally pass a distance to include a neighborhood. | |
| HRESULT | become (ParticleType *type) |
| Dynamically changes the type of an object. We can change the type of a ParticleType-derived object to anyther pre-existing ParticleType-derived type. What this means is that if we have an object of say type A, we can change it to another type, say B, and and all of the forces and processes that acted on objects of type A stip and the forces and processes defined for type B now take over. | |
| ParticleList | neighbors (const FPTYPE &distance, const TissueForge::ParticleTypeList &types) |
| Gets a list of nearby particles. | |
| ParticleList | neighbors (const FPTYPE &distance, const std::vector< ParticleType > &types) |
| Gets a list of nearby particles. | |
| ParticleList | neighbors (const FPTYPE &distance) |
| Gets a list of nearby particles of all types. | |
| ParticleList | neighbors (const TissueForge::ParticleTypeList &types) |
| Gets a list of nearby particles within the global cutoff distance. | |
| ParticleList | neighbors (const std::vector< ParticleType > &types) |
| Gets a list of nearby particles within the global cutoff distance. | |
| std::vector< int32_t > | neighborIds (const FPTYPE &distance, const TissueForge::ParticleTypeList &types) |
| Gets a list of nearby particles ids. | |
| std::vector< int32_t > | neighborIds (const FPTYPE &distance, const std::vector< ParticleType > &types) |
| Gets a list of nearby particles ids. | |
| std::vector< int32_t > | neighborIds (const FPTYPE &distance=-FPTYPE_ONE) |
| Gets a list of nearby particles ids of all types. | |
| std::vector< int32_t > | neighborIds (const TissueForge::ParticleTypeList &types) |
| Gets a list of nearby particles ids within the global cutoff distance. | |
| std::vector< int32_t > | neighborIds (const std::vector< ParticleType > &types) |
| Gets a list of nearby particles ids within the global cutoff distance. | |
| ParticleList | getBondedNeighbors () |
| Gets a list of all bonded neighbors. | |
| std::vector< int32_t > | getBondedNeighborIds () |
| Gets a list of all bonded neighbor ids. | |
| FPTYPE | distance (ParticleHandle *_other) |
| Calculates the distance to another particle. | |
| std::vector< struct TissueForge::BondHandle > | getBonds () |
| std::vector< struct TissueForge::AngleHandle > | getAngles () |
| std::vector< struct TissueForge::DihedralHandle > | getDihedrals () |
| FPTYPE | getCharge () |
| void | setCharge (const FPTYPE &charge) |
| FPTYPE | getMass () |
| void | setMass (const FPTYPE &mass) |
| bool | getFrozen () |
| void | setFrozen (const bool frozen) |
| bool | getFrozenX () |
| void | setFrozenX (const bool frozen) |
| bool | getFrozenY () |
| void | setFrozenY (const bool frozen) |
| bool | getFrozenZ () |
| void | setFrozenZ (const bool frozen) |
| rendering::Style * | getStyle () |
| void | setStyle (rendering::Style *style) |
| FPTYPE | getAge () |
| FPTYPE | getRadius () |
| void | setRadius (const FPTYPE &radius) |
| FPTYPE | getVolume () |
| std::string | getName () |
| std::string | getName2 () |
| FVector3 | getPosition () |
| void | setPosition (FVector3 position) |
| FVector3 & | getVelocity () |
| void | setVelocity (FVector3 velocity) |
| FVector3 | getForce () |
| FVector3 & | getForceInit () |
| void | setForceInit (FVector3 force) |
| int | getId () |
| int16_t | getTypeId () |
| int32_t | getClusterId () |
| uint16_t | getFlags () |
| state::StateVector * | getSpecies () |
| operator ClusterParticleHandle * () | |
Public Attributes | |
| int | id |
A handle to a particle.
The engine allocates particle memory in blocks, and particle values get moved around all the time, so their addresses change.
The partlist is always ordered by id, i.e. partlist[id] always points to the same particle, even though that particle may move from cell to cell.
This is a safe way to work with a particle.
| HRESULT TissueForge::ParticleHandle::become | ( | ParticleType * | type | ) |
Dynamically changes the type of an object. We can change the type of a ParticleType-derived object to anyther pre-existing ParticleType-derived type. What this means is that if we have an object of say type A, we can change it to another type, say B, and and all of the forces and processes that acted on objects of type A stip and the forces and processes defined for type B now take over.
| type | new particle type |
| HRESULT TissueForge::ParticleHandle::destroy | ( | ) |
Destroys the particle and removes it from inventory.
Subsequent references to a destroyed particle result in an error.
| FPTYPE TissueForge::ParticleHandle::distance | ( | ParticleHandle * | _other | ) |
Calculates the distance to another particle.
| _other | another particle. |
|
inline |
Gets the actual particle of this handle.
Alias for consistency with other objects.
| FPTYPE TissueForge::ParticleHandle::getAge | ( | ) |
Particle age
| std::vector< struct TissueForge::AngleHandle > TissueForge::ParticleHandle::getAngles | ( | ) |
Get the angles attached to the particle.
| std::vector< struct TissueForge::BondHandle > TissueForge::ParticleHandle::getBonds | ( | ) |
Get the bonds attached to the particle.
| FPTYPE TissueForge::ParticleHandle::getCharge | ( | ) |
Particle charge
| int32_t TissueForge::ParticleHandle::getClusterId | ( | ) |
Particle cluster id
| std::vector< struct TissueForge::DihedralHandle > TissueForge::ParticleHandle::getDihedrals | ( | ) |
Get the dihedrals attached to the particle.
| uint16_t TissueForge::ParticleHandle::getFlags | ( | ) |
Particle flags
| bool TissueForge::ParticleHandle::getFrozen | ( | ) |
Particle frozen state
| bool TissueForge::ParticleHandle::getFrozenX | ( | ) |
Particle frozen state along the x-direction
| bool TissueForge::ParticleHandle::getFrozenY | ( | ) |
Particle frozen state along the y-direction
| bool TissueForge::ParticleHandle::getFrozenZ | ( | ) |
Particle frozen state along the z-direction
| int TissueForge::ParticleHandle::getId | ( | ) |
Particle id
| FPTYPE TissueForge::ParticleHandle::getMass | ( | ) |
Particle mass
| std::string TissueForge::ParticleHandle::getName | ( | ) |
Particle name
| std::string TissueForge::ParticleHandle::getName2 | ( | ) |
Particle second name
| FPTYPE TissueForge::ParticleHandle::getRadius | ( | ) |
Particle radius
| state::StateVector * TissueForge::ParticleHandle::getSpecies | ( | ) |
Particle species, if any
| rendering::Style * TissueForge::ParticleHandle::getStyle | ( | ) |
Particle style
| int16_t TissueForge::ParticleHandle::getTypeId | ( | ) |
Particle type id
| FPTYPE TissueForge::ParticleHandle::getVolume | ( | ) |
Particle volume
| std::vector< int32_t > TissueForge::ParticleHandle::neighborIds | ( | const FPTYPE & | distance, |
| const std::vector< ParticleType > & | types ) |
Gets a list of nearby particles ids.
| distance | search distance |
| types | list of particle types to search by |
| std::vector< int32_t > TissueForge::ParticleHandle::neighborIds | ( | const FPTYPE & | distance, |
| const TissueForge::ParticleTypeList & | types ) |
Gets a list of nearby particles ids.
| distance | search distance |
| types | list of particle types to search by |
| std::vector< int32_t > TissueForge::ParticleHandle::neighborIds | ( | const FPTYPE & | distance = -FPTYPE_ONE | ) |
Gets a list of nearby particles ids of all types.
| distance | search distance; default is simulation cutoff |
| std::vector< int32_t > TissueForge::ParticleHandle::neighborIds | ( | const std::vector< ParticleType > & | types | ) |
Gets a list of nearby particles ids within the global cutoff distance.
| types | list of particle types to search by |
| std::vector< int32_t > TissueForge::ParticleHandle::neighborIds | ( | const TissueForge::ParticleTypeList & | types | ) |
Gets a list of nearby particles ids within the global cutoff distance.
| types | list of particle types to search by |
| ParticleList TissueForge::ParticleHandle::neighbors | ( | const FPTYPE & | distance | ) |
Gets a list of nearby particles of all types.
| distance | search distance |
| ParticleList TissueForge::ParticleHandle::neighbors | ( | const FPTYPE & | distance, |
| const std::vector< ParticleType > & | types ) |
Gets a list of nearby particles.
| distance | search distance |
| types | list of particle types to search by |
| ParticleList TissueForge::ParticleHandle::neighbors | ( | const FPTYPE & | distance, |
| const TissueForge::ParticleTypeList & | types ) |
Gets a list of nearby particles.
| distance | search distance |
| types | list of particle types to search by |
| ParticleList TissueForge::ParticleHandle::neighbors | ( | const std::vector< ParticleType > & | types | ) |
Gets a list of nearby particles within the global cutoff distance.
| types | list of particle types to search by |
| ParticleList TissueForge::ParticleHandle::neighbors | ( | const TissueForge::ParticleTypeList & | types | ) |
Gets a list of nearby particles within the global cutoff distance.
| types | list of particle types to search by |
| TissueForge::ParticleHandle::operator ClusterParticleHandle * | ( | ) |
Limits casting to cluster by type
|
inline |
Gets the actual particle of this handle.
| FVector3 TissueForge::ParticleHandle::relativePosition | ( | const FVector3 & | origin, |
| const bool & | comp_bc = true ) |
Computes the relative position with respect to an origin while optionally account for boundary conditions.
| origin | origin |
| comp_bc | flag to compensate for boundary conditions; default true |
| void TissueForge::ParticleHandle::setCharge | ( | const FPTYPE & | charge | ) |
Set the particle charge
| void TissueForge::ParticleHandle::setForceInit | ( | FVector3 | force | ) |
Set the particle initial force
| void TissueForge::ParticleHandle::setFrozen | ( | const bool | frozen | ) |
Set the particle frozen state
| void TissueForge::ParticleHandle::setFrozenX | ( | const bool | frozen | ) |
Set the particle frozen state along the x-direction
| void TissueForge::ParticleHandle::setFrozenY | ( | const bool | frozen | ) |
Set the particle frozen state along the y-direction
| void TissueForge::ParticleHandle::setFrozenZ | ( | const bool | frozen | ) |
Set the particle frozen state along the z-direction
| void TissueForge::ParticleHandle::setMass | ( | const FPTYPE & | mass | ) |
Set the particle mass
| void TissueForge::ParticleHandle::setPosition | ( | FVector3 | position | ) |
Set the particle position
| void TissueForge::ParticleHandle::setRadius | ( | const FPTYPE & | radius | ) |
Set the particle radius
| void TissueForge::ParticleHandle::setStyle | ( | rendering::Style * | style | ) |
Set the prticle style
| void TissueForge::ParticleHandle::setVelocity | ( | FVector3 | velocity | ) |
Set the particle velocity
| FVector3 TissueForge::ParticleHandle::sphericalPosition | ( | Particle * | particle = NULL, |
| FVector3 * | origin = NULL ) |
Calculates the particle's coordinates in spherical coordinates.
By default, calculations are made with respect to the center of the universe.
| particle | a particle to use as the origin, optional |
| origin | a point to use as the origin, optional |
|
virtual |
Splits a single particle into two.
The new particle is placed along a randomly selected orientation.
The two resulting particles have the same mass and volume.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that their species concentrations are the same as the split particle. Species are conserved.
The two resulting particles have the type of the split particle.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
|
virtual |
Splits a single particle into two with sizes according to a given ratio.
The new particle is placed along a randomly selected orientation.
The new particle has a mass and volume equal to those of the split particle multiplied by a ratio.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that their species concentrations are the same as the split particle. Species are conserved.
The two resulting particles have the type of the split particle.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
| childRatio | ratio of the child particle volume to the split particle volume. Must be in (0, 1). |
|
virtual |
Splits a single particle into two along a given direction.
The new particle is placed along the orientation of the passed direction.
The two resulting particles have the same mass and volume.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that their species concentrations are the same as the split particle. Species are conserved.
The two resulting particles have the type of the split particle.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
| childDirection | direction along which the particle is split. |
|
virtual |
Splits a single particle into two along a given direction, with sizes according to a given ratio, allocates species according to given ratios, and optionally with different resulting particle types.
The new particle is placed along the orientation of the passed direction.
The new particle has a mass and volume equal to those of the split particle multiplied by a ratio.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that the total amount in the new particles is equal to
the total amount of the split particle multiplied by a ratio. Species are conserved.
The two resulting particles have the type of the split particle unless otherwise specified.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
| childDirection | direction along which the particle is split. |
| childRatio | ratio of the child particle volume to the split particle volume. Must be in (0, 1). |
| speciesRatios | ratio of the child particle total species amount to the split particle total species amount. Each must be in (0, 1). |
| parentType | optional type of the split particle after the split |
| childType | optional type of the new particle |
|
virtual |
Splits a single particle into two along a given direction, with sizes according to a given ratio, and and optionally with different resulting particle types.
The new particle is placed along the orientation of the passed direction.
The new particle has a mass and volume equal to those of the split particle multiplied by a ratio.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that the total amount in the new particles is equal to
the total amount of the split particle multiplied by a ratio. Species are conserved.
The two resulting particles have the type of the split particle unless otherwise specified.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
| childDirection | direction along which the particle is split. |
| childRatio | ratio of the child particle volume to the split particle volume. Must be in (0, 1). |
| parentType | optional type of the split particle after the split |
| childType | optional type of the new particle |
|
virtual |
Splits a single particle into two and allocates species according to given ratios.
The new particle is placed along a randomly selected orientation.
The two resulting particles have the same mass and volume.
If species are attached to the split particle, then the amount of species is allocated to the two resulting particles such that the total amount in the new particles is equal to
the total amount of the split particle multiplied by a ratio. Species are conserved.
The two resulting particles have the type of the split particle.
The two resulting particles are placed in contact.
The center of mass of the two resulting particles is the same as that of the split particle.
The combined mass and volume of the two resulting particles are the same as those of the split particle.
| speciesRatios | ratio of the child particle total species amount to the split particle total species amount. Each must be in (0, 1). |
|
virtual |
Computes the virial tensor. Optionally pass a distance to include a neighborhood.
| radius | A distance to define a neighborhood, optional |
| int TissueForge::ParticleHandle::id |
Particle id