Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCParticle.h File Reference
#include "tf_port_c.h"
#include "tfCStyle.h"
#include "tfCStateVector.h"
#include "tfCSpecies.h"
Include dependency graph for tfCParticle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tfMappedParticleDataEnum
 Mapped particle data enums. More...
 
struct  tfParticleTypeStyleSpec
 Particle type style definition in Tissue Forge C. More...
 
struct  tfParticleTypeSpec
 Particle type definition in Tissue Forge C. More...
 
struct  tfParticleDynamicsEnumHandle
 
struct  tfParticleFlagsHandle
 
struct  tfParticleHandleHandle
 Handle to a ParticleHandle instance. More...
 
struct  tfParticleTypeHandle
 Handle to a ParticleType instance. More...
 
struct  tfParticleListHandle
 Handle to a ParticleList instance. More...
 
struct  tfParticleTypeListHandle
 Handle to a ParticleTypeList instance. More...
 

Functions

struct tfMappedParticleDataEnum tfMappedParticleDataEnum_init ()
 Initialize an instance.
 
struct tfParticleTypeSpec tfParticleTypeSpec_init ()
 Get a default definition.
 
struct tfParticleTypeStyleSpec tfParticleTypeStyleSpec_init ()
 Get a default definition.
 
HRESULT tfParticleDynamics_init (struct tfParticleDynamicsEnumHandle *handle)
 Initialize an instance.
 
HRESULT tfParticleFlags_init (struct tfParticleFlagsHandle *handle)
 Initialize an instance.
 
HRESULT tfParticleHandle_init (struct tfParticleHandleHandle *handle, unsigned int pid)
 Initialize an instance.
 
HRESULT tfParticleHandle_destroy (struct tfParticleHandleHandle *handle)
 Destroys the handle instance.
 
HRESULT tfParticleHandle_getType (struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle)
 Gets the particle type of this handle.
 
HRESULT tfParticleHandle_str (struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars)
 Get a summary string of the particle.
 
HRESULT tfParticleHandle_split (struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *newParticleHandle)
 Splits a single particle into two.
 
HRESULT tfParticleHandle_splitTypes (struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *newParticleHandle, struct tfParticleTypeHandle *parentTypeHandle, struct tfParticleTypeHandle *childTypeHandle)
 Splits a single particle into two and optionally with different resulting particle types.
 
HRESULT tfParticleHandle_destroyParticle (struct tfParticleHandleHandle *handle)
 Destroys the particle, and removes it from inventory.
 
HRESULT tfParticleHandle_sphericalPosition (struct tfParticleHandleHandle *handle, tfFloatP_t **position)
 Calculates the particle's coordinates in spherical coordinates relative to the center of the universe.
 
HRESULT tfParticleHandle_sphericalPositionPoint (struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position)
 Calculates the particle's coordinates in spherical coordinates relative to a point.
 
HRESULT tfParticleHandle_relativePosition (struct tfParticleHandleHandle *handle, tfFloatP_t *origin, tfFloatP_t **position)
 Computes the relative position with respect to an origin while.
 
HRESULT tfParticleHandle_become (struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *typeHandle)
 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.
 
HRESULT tfParticleHandle_neighborsD (struct tfParticleHandleHandle *handle, tfFloatP_t distance, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
 Get the particles within a distance of a particle.
 
HRESULT tfParticleHandle_neighborsT (struct tfParticleHandleHandle *handle, struct tfParticleTypeHandle *ptypes, int numTypes, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
 Get the particles of a set of types within the global cutoff distance.
 
HRESULT tfParticleHandle_neighborsDT (struct tfParticleHandleHandle *handle, tfFloatP_t distance, struct tfParticleTypeHandle *ptypes, int numTypes, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
 Get the particles of a set of types within a distance of a particle.
 
HRESULT tfParticleHandle_getBondedNeighbors (struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle **neighbors, int *numNeighbors)
 Get a list of all bonded neighbors.
 
HRESULT tfParticleHandle_distance (struct tfParticleHandleHandle *handle, struct tfParticleHandleHandle *other, tfFloatP_t *distance)
 Calculates the distance to another particle.
 
HRESULT tfParticleHandle_getMass (struct tfParticleHandleHandle *handle, tfFloatP_t *mass)
 Get the particle mass.
 
HRESULT tfParticleHandle_setMass (struct tfParticleHandleHandle *handle, tfFloatP_t mass)
 Set the particle mass.
 
HRESULT tfParticleHandle_getFrozen (struct tfParticleHandleHandle *handle, bool *frozen)
 Test whether the particle is frozen.
 
HRESULT tfParticleHandle_setFrozen (struct tfParticleHandleHandle *handle, bool frozen)
 Set whether the particle is frozen.
 
HRESULT tfParticleHandle_getFrozenX (struct tfParticleHandleHandle *handle, bool *frozen)
 Test whether the particle is frozen along the x-direction.
 
HRESULT tfParticleHandle_setFrozenX (struct tfParticleHandleHandle *handle, bool frozen)
 Set whether the particle is frozen along the x-direction.
 
HRESULT tfParticleHandle_getFrozenY (struct tfParticleHandleHandle *handle, bool *frozen)
 Test whether the particle is frozen along the y-direction.
 
HRESULT tfParticleHandle_setFrozenY (struct tfParticleHandleHandle *handle, bool frozen)
 Set whether the particle is frozen along the y-direction.
 
HRESULT tfParticleHandle_getFrozenZ (struct tfParticleHandleHandle *handle, bool *frozen)
 Test whether the particle is frozen along the z-direction.
 
HRESULT tfParticleHandle_setFrozenZ (struct tfParticleHandleHandle *handle, bool frozen)
 Set whether the particle is frozen along the z-direction.
 
HRESULT tfParticleHandle_getStyle (struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style)
 Get the particle style. Fails if no style is set.
 
HRESULT tfParticleHandle_hasStyle (struct tfParticleHandleHandle *handle, bool *hasStyle)
 Test whether the particle has a style.
 
HRESULT tfParticleHandle_setStyle (struct tfParticleHandleHandle *handle, struct tfRenderingStyleHandle *style)
 Set the particle style.
 
HRESULT tfParticleHandle_getAge (struct tfParticleHandleHandle *handle, tfFloatP_t *age)
 Get the particle age.
 
HRESULT tfParticleHandle_getRadius (struct tfParticleHandleHandle *handle, tfFloatP_t *radius)
 Get the particle radius.
 
HRESULT tfParticleHandle_setRadius (struct tfParticleHandleHandle *handle, tfFloatP_t radius)
 Set the particle radius.
 
HRESULT tfParticleHandle_getName (struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars)
 Get the particle name.
 
HRESULT tfParticleHandle_getName2 (struct tfParticleHandleHandle *handle, char **name, unsigned int *numChars)
 Get the particle second name.
 
HRESULT tfParticleHandle_getPosition (struct tfParticleHandleHandle *handle, tfFloatP_t **position)
 Get the particle position.
 
HRESULT tfParticleHandle_setPosition (struct tfParticleHandleHandle *handle, tfFloatP_t *position)
 Set the particle position.
 
HRESULT tfParticleHandle_getVelocity (struct tfParticleHandleHandle *handle, tfFloatP_t **velocity)
 Get the particle velocity.
 
HRESULT tfParticleHandle_setVelocity (struct tfParticleHandleHandle *handle, tfFloatP_t *velocity)
 Set the particle velocity.
 
HRESULT tfParticleHandle_getForce (struct tfParticleHandleHandle *handle, tfFloatP_t **force)
 Get the particle force.
 
HRESULT tfParticleHandle_getForceInit (struct tfParticleHandleHandle *handle, tfFloatP_t **force)
 Get the particle initial force.
 
HRESULT tfParticleHandle_setForceInit (struct tfParticleHandleHandle *handle, tfFloatP_t *force)
 Set the particle initial force.
 
HRESULT tfParticleHandle_getId (struct tfParticleHandleHandle *handle, int *pid)
 Get the particle id.
 
HRESULT tfParticleHandle_getTypeId (struct tfParticleHandleHandle *handle, int *tid)
 Get the particle type id.
 
HRESULT tfParticleHandle_getClusterId (struct tfParticleHandleHandle *handle, int *cid)
 Get the particle cluster id. -1 if particle is not a cluster.
 
HRESULT tfParticleHandle_getFlags (struct tfParticleHandleHandle *handle, int *flags)
 Get the particle flags.
 
HRESULT tfParticleHandle_hasSpecies (struct tfParticleHandleHandle *handle, bool *flag)
 Test whether a particle has species.
 
HRESULT tfParticleHandle_getSpecies (struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec)
 Get the state vector. Fails if the particle does not have a state vector.
 
HRESULT tfParticleHandle_setSpecies (struct tfParticleHandleHandle *handle, struct tfStateStateVectorHandle *svec)
 Set the state vector.
 
HRESULT tfParticleHandle_toCluster (struct tfParticleHandleHandle *handle, struct tfClusterParticleHandleHandle *chandle)
 Convert the particle to a cluster; fails if particle is not a cluster.
 
HRESULT tfParticleHandle_toString (struct tfParticleHandleHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfParticleHandle_lt (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleHandle_gt (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleHandle_le (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleHandle_ge (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleHandle_eq (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleHandle_ne (struct tfParticleHandleHandle *lhs, struct tfParticleHandleHandle *rhs, bool *result)
 
HRESULT tfParticleType_init (struct tfParticleTypeHandle *handle)
 Initialize an instance.
 
HRESULT tfParticleType_initD (struct tfParticleTypeHandle *handle, struct tfParticleTypeSpec pdef)
 Initialize an instance from a definition.
 
HRESULT tfParticleType_getName (struct tfParticleTypeHandle *handle, char **name, unsigned int *numChars)
 Get the type name.
 
HRESULT tfParticleType_setName (struct tfParticleTypeHandle *handle, const char *name)
 Set the type name. Throws an error if the type is already registered.
 
HRESULT tfParticleType_getId (struct tfParticleTypeHandle *handle, int *id)
 Get the type id. -1 if not registered.
 
HRESULT tfParticleType_getTypeFlags (struct tfParticleTypeHandle *handle, unsigned int *flags)
 Get the type flags.
 
HRESULT tfParticleType_setTypeFlags (struct tfParticleTypeHandle *handle, unsigned int flags)
 Set the type flags.
 
HRESULT tfParticleType_getParticleFlags (struct tfParticleTypeHandle *handle, unsigned int *flags)
 Get the particle flags.
 
HRESULT tfParticleType_setParticleFlags (struct tfParticleTypeHandle *handle, unsigned int flags)
 Set the particle flags.
 
HRESULT tfParticleType_getStyle (struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style)
 Get the type style.
 
HRESULT tfParticleType_setStyle (struct tfParticleTypeHandle *handle, struct tfRenderingStyleHandle *style)
 Set the type style.
 
HRESULT tfParticleType_hasSpecies (struct tfParticleTypeHandle *handle, bool *flag)
 Test whether the type has species.
 
HRESULT tfParticleType_getSpecies (struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist)
 Get the type species. Fails if the type does not have species.
 
HRESULT tfParticleType_setSpecies (struct tfParticleTypeHandle *handle, struct tfStateSpeciesListHandle *slist)
 Set the type species.
 
HRESULT tfParticleType_getMass (struct tfParticleTypeHandle *handle, tfFloatP_t *mass)
 Get the type mass.
 
HRESULT tfParticleType_setMass (struct tfParticleTypeHandle *handle, tfFloatP_t mass)
 Set the type mass.
 
HRESULT tfParticleType_getRadius (struct tfParticleTypeHandle *handle, tfFloatP_t *radius)
 Get the type radius.
 
HRESULT tfParticleType_setRadius (struct tfParticleTypeHandle *handle, tfFloatP_t radius)
 Set the type radius.
 
HRESULT tfParticleType_getKineticEnergy (struct tfParticleTypeHandle *handle, tfFloatP_t *kinetic_energy)
 Get the kinetic energy of all particles of this type.
 
HRESULT tfParticleType_getPotentialEnergy (struct tfParticleTypeHandle *handle, tfFloatP_t *potential_energy)
 Get the potential energy of all particles of this type.
 
HRESULT tfParticleType_getTargetEnergy (struct tfParticleTypeHandle *handle, tfFloatP_t *target_energy)
 Get the target energy of all particles of this type.
 
HRESULT tfParticleType_setTargetEnergy (struct tfParticleTypeHandle *handle, tfFloatP_t target_energy)
 Set the target energy of all particles of this type.
 
HRESULT tfParticleType_getMinimumRadius (struct tfParticleTypeHandle *handle, tfFloatP_t *minimum_radius)
 Get the default minimum radius of this type.
 
HRESULT tfParticleType_setMinimumRadius (struct tfParticleTypeHandle *handle, tfFloatP_t minimum_radius)
 Set the default minimum radius of this type.
 
HRESULT tfParticleType_getDynamics (struct tfParticleTypeHandle *handle, unsigned char *dynamics)
 Get the default dynamics of particles of this type.
 
HRESULT tfParticleType_setDynamics (struct tfParticleTypeHandle *handle, unsigned char dynamics)
 Set the default dynamics of particles of this type.
 
HRESULT tfParticleType_getNumParts (struct tfParticleTypeHandle *handle, int *numParts)
 Get the number of particles that are a member of this type.
 
HRESULT tfParticleType_getParticle (struct tfParticleTypeHandle *handle, int i, struct tfParticleHandleHandle *phandle)
 Get the i'th particle that's a member of this type.
 
HRESULT tfParticleType_isCluster (struct tfParticleTypeHandle *handle, bool *isCluster)
 Test whether this type is a cluster type.
 
HRESULT tfParticleType_toCluster (struct tfParticleTypeHandle *handle, struct tfClusterParticleTypeHandle *chandle)
 Convert the type to a cluster; fails if the type is not a cluster.
 
HRESULT tfParticleType_createParticle (struct tfParticleTypeHandle *handle, int *pid, tfFloatP_t *position, tfFloatP_t *velocity)
 Particle constructor.
 
HRESULT tfParticleType_createParticleS (struct tfParticleTypeHandle *handle, int *pid, const char *str)
 Particle constructor.
 
HRESULT tfParticleType_factory (struct tfParticleTypeHandle *handle, int **pids, unsigned int nr_parts, tfFloatP_t *positions, tfFloatP_t *velocities)
 Particle factory constructor, for making lots of particles quickly.
 
HRESULT tfParticleType_newType (struct tfParticleTypeHandle *handle, const char *_name, struct tfParticleTypeHandle *newTypehandle)
 Particle type constructor.
 
HRESULT tfParticleType_hasPartId (struct tfParticleTypeHandle *handle, int pid, bool *result)
 Test whether the type has an id.
 
HRESULT tfParticleType_hasPart (struct tfParticleTypeHandle *handle, struct tfParticleHandleHandle *part, bool *result)
 Test whether the type has a particle.
 
HRESULT tfParticleType_registerType (struct tfParticleTypeHandle *handle)
 Registers a type with the engine.
 
HRESULT tfParticleType_isRegistered (struct tfParticleTypeHandle *handle, bool *isRegistered)
 Tests whether this type is registered.
 
HRESULT tfParticleType_str (struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars)
 Get a summary string of the type.
 
HRESULT tfParticleType_getFrozen (struct tfParticleTypeHandle *handle, bool *frozen)
 Test whether this type is frozen.
 
HRESULT tfParticleType_setFrozen (struct tfParticleTypeHandle *handle, bool frozen)
 Set whether this type is frozen.
 
HRESULT tfParticleType_getFrozenX (struct tfParticleTypeHandle *handle, bool *frozen)
 Test whether this type is frozen along the x-direction.
 
HRESULT tfParticleType_setFrozenX (struct tfParticleTypeHandle *handle, bool frozen)
 Set whether this type is frozen along the x-direction.
 
HRESULT tfParticleType_getFrozenY (struct tfParticleTypeHandle *handle, bool *frozen)
 Test whether this type is frozen along the y-direction.
 
HRESULT tfParticleType_setFrozenY (struct tfParticleTypeHandle *handle, bool frozen)
 Set whether this type is frozen along the y-direction.
 
HRESULT tfParticleType_getFrozenZ (struct tfParticleTypeHandle *handle, bool *frozen)
 Test whether this type is frozen along the z-direction.
 
HRESULT tfParticleType_setFrozenZ (struct tfParticleTypeHandle *handle, bool frozen)
 Set whether this type is frozen along the z-direction.
 
HRESULT tfParticleType_getTemperature (struct tfParticleTypeHandle *handle, tfFloatP_t *temperature)
 Get the temperature of this type.
 
HRESULT tfParticleType_getTargetTemperature (struct tfParticleTypeHandle *handle, tfFloatP_t *temperature)
 Get the target temperature of this type.
 
HRESULT tfParticleType_setTargetTemperature (struct tfParticleTypeHandle *handle, tfFloatP_t temperature)
 Set the target temperature of this type.
 
HRESULT tfParticleType_toString (struct tfParticleTypeHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfParticleType_fromString (struct tfParticleTypeHandle *handle, const char *str)
 Create from a JSON string representation.
 
HRESULT tfParticleType_lt (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleType_gt (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleType_le (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleType_ge (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleType_eq (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleType_ne (struct tfParticleTypeHandle *lhs, struct tfParticleTypeHandle *rhs, bool *result)
 
HRESULT tfParticleList_init (struct tfParticleListHandle *handle)
 Initialize an empty instance.
 
HRESULT tfParticleList_initP (struct tfParticleListHandle *handle, struct tfParticleHandleHandle **particles, unsigned int numParts)
 Initialize an instance with an array of particles.
 
HRESULT tfParticleList_initI (struct tfParticleListHandle *handle, int *parts, unsigned int numParts)
 Initialize an instance with an array of particle ids.
 
HRESULT tfParticleList_copy (struct tfParticleListHandle *source, struct tfParticleListHandle *destination)
 Copy an instance.
 
HRESULT tfParticleList_destroy (struct tfParticleListHandle *handle)
 Destroy an instance.
 
HRESULT tfParticleList_getIds (struct tfParticleListHandle *handle, int **parts)
 Get the particle ids in the list.
 
HRESULT tfParticleList_getNumParts (struct tfParticleListHandle *handle, unsigned int *numParts)
 Get the number of particles.
 
HRESULT tfParticleList_free (struct tfParticleListHandle *handle)
 Free the memory associated with the parts list.
 
HRESULT tfParticleList_insertI (struct tfParticleListHandle *handle, int item, unsigned int *index)
 Insert the given id into the list, returns the index of the item.
 
HRESULT tfParticleList_insertP (struct tfParticleListHandle *handle, struct tfParticleHandleHandle *particle, unsigned int *index)
 Inserts the given particle into the list, returns the index of the particle.
 
HRESULT tfParticleList_remove (struct tfParticleListHandle *handle, int id)
 Looks for the item with the given id and deletes it from the list.
 
HRESULT tfParticleList_extend (struct tfParticleListHandle *handle, struct tfParticleListHandle *other)
 inserts the contents of another list
 
HRESULT tfParticleList_hasId (struct tfParticleListHandle *handle, int pid, bool *result)
 Test whether the list has an id.
 
HRESULT tfParticleList_hasPart (struct tfParticleListHandle *handle, struct tfParticleHandleHandle *part, bool *result)
 Test whether the list has a particle.
 
HRESULT tfParticleList_item (struct tfParticleListHandle *handle, unsigned int i, struct tfParticleHandleHandle *item)
 looks for the item at the given index and returns it if found, otherwise returns NULL
 
HRESULT tfParticleList_getAll (struct tfParticleListHandle *handle)
 Initialize an instance populated with all current particles.
 
HRESULT tfParticleList_getVirial (struct tfParticleListHandle *handle, tfFloatP_t **virial)
 Get the virial tensor of the particles.
 
HRESULT tfParticleList_getRadiusOfGyration (struct tfParticleListHandle *handle, tfFloatP_t *rog)
 Get the radius of gyration of the particles.
 
HRESULT tfParticleList_getCenterOfMass (struct tfParticleListHandle *handle, tfFloatP_t **com)
 Get the center of mass of the particles.
 
HRESULT tfParticleList_getCentroid (struct tfParticleListHandle *handle, tfFloatP_t **cent)
 Get the centroid of the particles.
 
HRESULT tfParticleList_getMomentOfInertia (struct tfParticleListHandle *handle, tfFloatP_t **moi)
 Get the moment of inertia of the particles.
 
HRESULT tfParticleList_getPositions (struct tfParticleListHandle *handle, tfFloatP_t **positions)
 Get the particle positions.
 
HRESULT tfParticleList_getVelocities (struct tfParticleListHandle *handle, tfFloatP_t **velocities)
 Get the particle velocities.
 
HRESULT tfParticleList_getForces (struct tfParticleListHandle *handle, tfFloatP_t **forces)
 Get the forces acting on the particles.
 
HRESULT tfParticleList_sphericalPositions (struct tfParticleListHandle *handle, tfFloatP_t **coordinates)
 Get the spherical coordinates of each particle for a coordinate system at the center of the universe.
 
HRESULT tfParticleList_sphericalPositionsO (struct tfParticleListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates)
 Get the spherical coordinates of each particle for a coordinate system with a specified origin.
 
HRESULT tfParticleList_getOwnsData (struct tfParticleListHandle *handle, bool *result)
 Get whether the list owns its data.
 
HRESULT tfParticleList_setOwnsData (struct tfParticleListHandle *handle, bool flag)
 Set whether the list owns its data.
 
HRESULT tfParticleList_getMutable (struct tfParticleListHandle *handle, bool *result)
 Get whether the list is mutable.
 
HRESULT tfParticleList_setMutable (struct tfParticleListHandle *handle, bool flag)
 Set whether the list is mutable.
 
HRESULT tfParticleList_toString (struct tfParticleListHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfParticleList_fromString (struct tfParticleListHandle *handle, const char *str)
 Create from a JSON string representation.
 
HRESULT tfParticleTypeList_init (struct tfParticleTypeListHandle *handle)
 Initialize an empty instance.
 
HRESULT tfParticleTypeList_initP (struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle **parts, unsigned int numParts)
 Initialize an instance with an array of particle types.
 
HRESULT tfParticleTypeList_initI (struct tfParticleTypeListHandle *handle, int *parts, unsigned int numParts)
 Initialize an instance with an array of particle type ids.
 
HRESULT tfParticleTypeList_copy (struct tfParticleTypeListHandle *source, struct tfParticleTypeListHandle *destination)
 Copy an instance.
 
HRESULT tfParticleTypeList_destroy (struct tfParticleTypeListHandle *handle)
 Destroy an instance.
 
HRESULT tfParticleTypeList_getIds (struct tfParticleTypeListHandle *handle, int **parts)
 Get the particle type ids in the list.
 
HRESULT tfParticleTypeList_getNumParts (struct tfParticleTypeListHandle *handle, unsigned int *numParts)
 Get the number of particle types.
 
HRESULT tfParticleTypeList_free (struct tfParticleTypeListHandle *handle)
 Free the memory associated with the list.
 
HRESULT tfParticleTypeList_insertI (struct tfParticleTypeListHandle *handle, int item, unsigned int *index)
 Insert the given id into the list, returns the index of the item.
 
HRESULT tfParticleTypeList_insertP (struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, unsigned int *index)
 Inserts the given particle type into the list, returns the index of the particle.
 
HRESULT tfParticleTypeList_remove (struct tfParticleTypeListHandle *handle, int id)
 Looks for the item with the given id and deletes it from the list.
 
HRESULT tfParticleTypeList_extend (struct tfParticleTypeListHandle *handle, struct tfParticleTypeListHandle *other)
 inserts the contents of another list
 
HRESULT tfParticleTypeList_hasId (struct tfParticleTypeListHandle *handle, int pid, bool *result)
 Test whether the list has an id.
 
HRESULT tfParticleTypeList_hasType (struct tfParticleTypeListHandle *handle, struct tfParticleTypeHandle *ptype, bool *result)
 Test whether the list has a particle type.
 
HRESULT tfParticleTypeList_hasPart (struct tfParticleTypeListHandle *handle, struct tfParticleHandleHandle *part, bool *result)
 Test whether the list has a particle.
 
HRESULT tfParticleTypeList_item (struct tfParticleTypeListHandle *handle, unsigned int i, struct tfParticleTypeHandle *item)
 looks for the item at the given index and returns it if found, otherwise returns NULL
 
HRESULT tfParticleTypeList_getAll (struct tfParticleTypeListHandle *handle)
 Initialize an instance populated with all current particles.
 
HRESULT tfParticleTypeList_getVirial (struct tfParticleTypeListHandle *handle, tfFloatP_t *virial)
 Get the virial tensor of the particles.
 
HRESULT tfParticleTypeList_getRadiusOfGyration (struct tfParticleTypeListHandle *handle, tfFloatP_t *rog)
 Get the radius of gyration of the particles.
 
HRESULT tfParticleTypeList_getCenterOfMass (struct tfParticleTypeListHandle *handle, tfFloatP_t **com)
 Get the center of mass of the particles.
 
HRESULT tfParticleTypeList_getCentroid (struct tfParticleTypeListHandle *handle, tfFloatP_t **cent)
 Get the centroid of the particles.
 
HRESULT tfParticleTypeList_getMomentOfInertia (struct tfParticleTypeListHandle *handle, tfFloatP_t **moi)
 Get the moment of inertia of the particles.
 
HRESULT tfParticleTypeList_getPositions (struct tfParticleTypeListHandle *handle, tfFloatP_t **positions)
 Get the particle positions.
 
HRESULT tfParticleTypeList_getVelocities (struct tfParticleTypeListHandle *handle, tfFloatP_t **velocities)
 Get the particle velocities.
 
HRESULT tfParticleTypeList_getForces (struct tfParticleTypeListHandle *handle, tfFloatP_t **forces)
 Get the forces acting on the particles.
 
HRESULT tfParticleTypeList_sphericalPositions (struct tfParticleTypeListHandle *handle, tfFloatP_t **coordinates)
 Get the spherical coordinates of each particle for a coordinate system at the center of the universe.
 
HRESULT tfParticleTypeList_sphericalPositionsO (struct tfParticleTypeListHandle *handle, tfFloatP_t *origin, tfFloatP_t **coordinates)
 Get the spherical coordinates of each particle for a coordinate system with a specified origin.
 
HRESULT tfParticleTypeList_getOwnsData (struct tfParticleTypeListHandle *handle, bool *result)
 Get whether the list owns its data.
 
HRESULT tfParticleTypeList_setOwnsData (struct tfParticleTypeListHandle *handle, bool flag)
 Set whether the list owns its data.
 
HRESULT tfParticleTypeList_getMutable (struct tfParticleTypeListHandle *handle, bool *result)
 Get whether the list is mutable.
 
HRESULT tfParticleTypeList_setMutable (struct tfParticleTypeListHandle *handle, bool flag)
 Set whether the list is mutable.
 
HRESULT tfParticleTypeList_getParticles (struct tfParticleTypeListHandle *handle, struct tfParticleListHandle *plist)
 Get a particle list populated with particles of all current particle types.
 
HRESULT tfParticleTypeList_toString (struct tfParticleTypeListHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfParticleTypeList_fromString (struct tfParticleTypeListHandle *handle, const char *str)
 Create from a JSON string representation.
 
HRESULT tfParticle_Verify ()
 Iterates over all parts, does a verify.
 
HRESULT tfParticleType_FindFromName (struct tfParticleTypeHandle *handle, const char *name)
 Get a registered particle type by type name.
 
HRESULT tfParticleType_getFromId (struct tfParticleTypeHandle *handle, unsigned int pid)
 Get a registered particle type by type id.
 
unsigned int * tfParticle_Colors ()
 Get an array of available particle type colors.
 

Function Documentation

◆ tfParticle_Colors()

unsigned int * tfParticle_Colors ( )

Get an array of available particle type colors.

Returns
unsigned int *

◆ tfParticle_Verify()

HRESULT tfParticle_Verify ( )

Iterates over all parts, does a verify.

Returns
S_OK on success

◆ tfParticleDynamics_init()

HRESULT tfParticleDynamics_init ( struct tfParticleDynamicsEnumHandle * handle)

Initialize an instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleFlags_init()

HRESULT tfParticleFlags_init ( struct tfParticleFlagsHandle * handle)

Initialize an instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleHandle_become()

HRESULT tfParticleHandle_become ( struct tfParticleHandleHandle * handle,
struct tfParticleTypeHandle * typeHandle )

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.

Parameters
handlepopulated handle
typeHandlenew particle type
Returns
S_OK on success

◆ tfParticleHandle_destroy()

HRESULT tfParticleHandle_destroy ( struct tfParticleHandleHandle * handle)

Destroys the handle instance.

Returns
S_OK on success

◆ tfParticleHandle_destroyParticle()

HRESULT tfParticleHandle_destroyParticle ( struct tfParticleHandleHandle * handle)

Destroys the particle, and removes it from inventory.

Subsequent references to a destroyed particle result in an error.

Parameters
handle
Returns
S_OK on success

◆ tfParticleHandle_distance()

HRESULT tfParticleHandle_distance ( struct tfParticleHandleHandle * handle,
struct tfParticleHandleHandle * other,
tfFloatP_t * distance )

Calculates the distance to another particle.

Parameters
handlepopulated handle
otherpopulated handle of another particle
distancedistance
Returns
S_OK on success

◆ tfParticleHandle_eq()

HRESULT tfParticleHandle_eq ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs == rhs

◆ tfParticleHandle_ge()

HRESULT tfParticleHandle_ge ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs >= rhs

◆ tfParticleHandle_getAge()

HRESULT tfParticleHandle_getAge ( struct tfParticleHandleHandle * handle,
tfFloatP_t * age )

Get the particle age.

Returns
S_OK on success

◆ tfParticleHandle_getBondedNeighbors()

HRESULT tfParticleHandle_getBondedNeighbors ( struct tfParticleHandleHandle * handle,
struct tfParticleHandleHandle ** neighbors,
int * numNeighbors )

Get a list of all bonded neighbors.

Parameters
handlepopulated handle
neighborsneighbors
numNeighborsnumber of neighbors
Returns
S_OK on success

◆ tfParticleHandle_getClusterId()

HRESULT tfParticleHandle_getClusterId ( struct tfParticleHandleHandle * handle,
int * cid )

Get the particle cluster id. -1 if particle is not a cluster.

Returns
S_OK on success

◆ tfParticleHandle_getFlags()

HRESULT tfParticleHandle_getFlags ( struct tfParticleHandleHandle * handle,
int * flags )

Get the particle flags.

Returns
S_OK on success

◆ tfParticleHandle_getForce()

HRESULT tfParticleHandle_getForce ( struct tfParticleHandleHandle * handle,
tfFloatP_t ** force )

Get the particle force.

Returns
S_OK on success

◆ tfParticleHandle_getForceInit()

HRESULT tfParticleHandle_getForceInit ( struct tfParticleHandleHandle * handle,
tfFloatP_t ** force )

Get the particle initial force.

Returns
S_OK on success

◆ tfParticleHandle_getFrozen()

HRESULT tfParticleHandle_getFrozen ( struct tfParticleHandleHandle * handle,
bool * frozen )

Test whether the particle is frozen.

Returns
S_OK on success

◆ tfParticleHandle_getFrozenX()

HRESULT tfParticleHandle_getFrozenX ( struct tfParticleHandleHandle * handle,
bool * frozen )

Test whether the particle is frozen along the x-direction.

Returns
S_OK on success

◆ tfParticleHandle_getFrozenY()

HRESULT tfParticleHandle_getFrozenY ( struct tfParticleHandleHandle * handle,
bool * frozen )

Test whether the particle is frozen along the y-direction.

Returns
S_OK on success

◆ tfParticleHandle_getFrozenZ()

HRESULT tfParticleHandle_getFrozenZ ( struct tfParticleHandleHandle * handle,
bool * frozen )

Test whether the particle is frozen along the z-direction.

Returns
S_OK on success

◆ tfParticleHandle_getId()

HRESULT tfParticleHandle_getId ( struct tfParticleHandleHandle * handle,
int * pid )

Get the particle id.

Returns
S_OK on success

◆ tfParticleHandle_getMass()

HRESULT tfParticleHandle_getMass ( struct tfParticleHandleHandle * handle,
tfFloatP_t * mass )

Get the particle mass.

Returns
S_OK on success

◆ tfParticleHandle_getName()

HRESULT tfParticleHandle_getName ( struct tfParticleHandleHandle * handle,
char ** name,
unsigned int * numChars )

Get the particle name.

Returns
S_OK on success

◆ tfParticleHandle_getName2()

HRESULT tfParticleHandle_getName2 ( struct tfParticleHandleHandle * handle,
char ** name,
unsigned int * numChars )

Get the particle second name.

Returns
S_OK on success

◆ tfParticleHandle_getPosition()

HRESULT tfParticleHandle_getPosition ( struct tfParticleHandleHandle * handle,
tfFloatP_t ** position )

Get the particle position.

Returns
S_OK on success

◆ tfParticleHandle_getRadius()

HRESULT tfParticleHandle_getRadius ( struct tfParticleHandleHandle * handle,
tfFloatP_t * radius )

Get the particle radius.

Returns
S_OK on success

◆ tfParticleHandle_getSpecies()

HRESULT tfParticleHandle_getSpecies ( struct tfParticleHandleHandle * handle,
struct tfStateStateVectorHandle * svec )

Get the state vector. Fails if the particle does not have a state vector.

Returns
S_OK on success

◆ tfParticleHandle_getStyle()

HRESULT tfParticleHandle_getStyle ( struct tfParticleHandleHandle * handle,
struct tfRenderingStyleHandle * style )

Get the particle style. Fails if no style is set.

Parameters
handlepopulated handle
stylehandle to populate
Returns
S_OK on success

◆ tfParticleHandle_getType()

HRESULT tfParticleHandle_getType ( struct tfParticleHandleHandle * handle,
struct tfParticleTypeHandle * typeHandle )

Gets the particle type of this handle.

Parameters
handlepopulated handle
typeHandletype handle to populate
Returns
S_OK on success

◆ tfParticleHandle_getTypeId()

HRESULT tfParticleHandle_getTypeId ( struct tfParticleHandleHandle * handle,
int * tid )

Get the particle type id.

Returns
S_OK on success

◆ tfParticleHandle_getVelocity()

HRESULT tfParticleHandle_getVelocity ( struct tfParticleHandleHandle * handle,
tfFloatP_t ** velocity )

Get the particle velocity.

Returns
S_OK on success

◆ tfParticleHandle_gt()

HRESULT tfParticleHandle_gt ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs > rhs

◆ tfParticleHandle_hasSpecies()

HRESULT tfParticleHandle_hasSpecies ( struct tfParticleHandleHandle * handle,
bool * flag )

Test whether a particle has species.

Returns
S_OK on success

◆ tfParticleHandle_hasStyle()

HRESULT tfParticleHandle_hasStyle ( struct tfParticleHandleHandle * handle,
bool * hasStyle )

Test whether the particle has a style.

Parameters
handlepopulated handle
hasStyleflag signifying whether the particle has a style
Returns
S_OK on success

◆ tfParticleHandle_init()

HRESULT tfParticleHandle_init ( struct tfParticleHandleHandle * handle,
unsigned int pid )

Initialize an instance.

Parameters
handlehandle to populate
pidparticle id
Returns
S_OK on success

◆ tfParticleHandle_le()

HRESULT tfParticleHandle_le ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs <= rhs

◆ tfParticleHandle_lt()

HRESULT tfParticleHandle_lt ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs < rhs

◆ tfParticleHandle_ne()

HRESULT tfParticleHandle_ne ( struct tfParticleHandleHandle * lhs,
struct tfParticleHandleHandle * rhs,
bool * result )

Test whether lhs != rhs

◆ tfParticleHandle_neighborsD()

HRESULT tfParticleHandle_neighborsD ( struct tfParticleHandleHandle * handle,
tfFloatP_t distance,
struct tfParticleHandleHandle ** neighbors,
int * numNeighbors )

Get the particles within a distance of a particle.

Parameters
handlepopulated handle
distancedistance
neighborsneighbors
numNeighborsnumber of neighbors
Returns
S_OK on success

◆ tfParticleHandle_neighborsDT()

HRESULT tfParticleHandle_neighborsDT ( struct tfParticleHandleHandle * handle,
tfFloatP_t distance,
struct tfParticleTypeHandle * ptypes,
int numTypes,
struct tfParticleHandleHandle ** neighbors,
int * numNeighbors )

Get the particles of a set of types within a distance of a particle.

Parameters
handlepopulated handle
distancedistance
ptypesparticle types
numTypesnumber of particle types
neighborsneighbors
numNeighborsnumber of neighbors
Returns
S_OK on success

◆ tfParticleHandle_neighborsT()

HRESULT tfParticleHandle_neighborsT ( struct tfParticleHandleHandle * handle,
struct tfParticleTypeHandle * ptypes,
int numTypes,
struct tfParticleHandleHandle ** neighbors,
int * numNeighbors )

Get the particles of a set of types within the global cutoff distance.

Parameters
handlepopulated handle
ptypesparticle types
numTypesnumber of particle types
neighborsneighbors
numNeighborsnumber of neighbors
Returns
S_OK on success

◆ tfParticleHandle_relativePosition()

HRESULT tfParticleHandle_relativePosition ( struct tfParticleHandleHandle * handle,
tfFloatP_t * origin,
tfFloatP_t ** position )

Computes the relative position with respect to an origin while.

Parameters
handlepopulated handle
originrelative point
position3-element allocated array
Returns
S_OK on success

◆ tfParticleHandle_setForceInit()

HRESULT tfParticleHandle_setForceInit ( struct tfParticleHandleHandle * handle,
tfFloatP_t * force )

Set the particle initial force.

Returns
S_OK on success

◆ tfParticleHandle_setFrozen()

HRESULT tfParticleHandle_setFrozen ( struct tfParticleHandleHandle * handle,
bool frozen )

Set whether the particle is frozen.

Returns
S_OK on success

◆ tfParticleHandle_setFrozenX()

HRESULT tfParticleHandle_setFrozenX ( struct tfParticleHandleHandle * handle,
bool frozen )

Set whether the particle is frozen along the x-direction.

Returns
S_OK on success

◆ tfParticleHandle_setFrozenY()

HRESULT tfParticleHandle_setFrozenY ( struct tfParticleHandleHandle * handle,
bool frozen )

Set whether the particle is frozen along the y-direction.

Returns
S_OK on success

◆ tfParticleHandle_setFrozenZ()

HRESULT tfParticleHandle_setFrozenZ ( struct tfParticleHandleHandle * handle,
bool frozen )

Set whether the particle is frozen along the z-direction.

Returns
S_OK on success

◆ tfParticleHandle_setMass()

HRESULT tfParticleHandle_setMass ( struct tfParticleHandleHandle * handle,
tfFloatP_t mass )

Set the particle mass.

Returns
S_OK on success

◆ tfParticleHandle_setPosition()

HRESULT tfParticleHandle_setPosition ( struct tfParticleHandleHandle * handle,
tfFloatP_t * position )

Set the particle position.

Returns
S_OK on success

◆ tfParticleHandle_setRadius()

HRESULT tfParticleHandle_setRadius ( struct tfParticleHandleHandle * handle,
tfFloatP_t radius )

Set the particle radius.

Returns
S_OK on success

◆ tfParticleHandle_setSpecies()

HRESULT tfParticleHandle_setSpecies ( struct tfParticleHandleHandle * handle,
struct tfStateStateVectorHandle * svec )

Set the state vector.

Returns
S_OK on success

◆ tfParticleHandle_setStyle()

HRESULT tfParticleHandle_setStyle ( struct tfParticleHandleHandle * handle,
struct tfRenderingStyleHandle * style )

Set the particle style.

Parameters
handlepopulated handle
stylestyle
Returns
S_OK on success

◆ tfParticleHandle_setVelocity()

HRESULT tfParticleHandle_setVelocity ( struct tfParticleHandleHandle * handle,
tfFloatP_t * velocity )

Set the particle velocity.

Returns
S_OK on success

◆ tfParticleHandle_sphericalPosition()

HRESULT tfParticleHandle_sphericalPosition ( struct tfParticleHandleHandle * handle,
tfFloatP_t ** position )

Calculates the particle's coordinates in spherical coordinates relative to the center of the universe.

Parameters
handlepopulated handle
position3-element allocated array
Returns
S_OK on success

◆ tfParticleHandle_sphericalPositionPoint()

HRESULT tfParticleHandle_sphericalPositionPoint ( struct tfParticleHandleHandle * handle,
tfFloatP_t * origin,
tfFloatP_t ** position )

Calculates the particle's coordinates in spherical coordinates relative to a point.

Parameters
handlepopulated handle
originrelative point
position3-element allocated array
Returns
S_OK on success

◆ tfParticleHandle_split()

HRESULT tfParticleHandle_split ( struct tfParticleHandleHandle * handle,
struct tfParticleHandleHandle * newParticleHandle )

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.

Parameters
handlepopulated handle
newParticleHandlenew particle handle to populate
Returns
S_OK on success

◆ tfParticleHandle_splitTypes()

HRESULT tfParticleHandle_splitTypes ( struct tfParticleHandleHandle * handle,
struct tfParticleHandleHandle * newParticleHandle,
struct tfParticleTypeHandle * parentTypeHandle,
struct tfParticleTypeHandle * childTypeHandle )

Splits a single particle into two and optionally with different resulting particle types.

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 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.

Parameters
handlepopulated handle
newParticleHandlenew particle handle to populate
parentTypeHandleoptional type of the split particle after the split (NULL specifies default)
childTypeHandleoptional type of the new particle (NULL specifies default)
Returns
S_OK on success

◆ tfParticleHandle_str()

HRESULT tfParticleHandle_str ( struct tfParticleHandleHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string of the particle.

Parameters
handlepopulated handle
strarray to populate
numCharsnumber of array characters
Returns
S_OK on success

◆ tfParticleHandle_toCluster()

HRESULT tfParticleHandle_toCluster ( struct tfParticleHandleHandle * handle,
struct tfClusterParticleHandleHandle * chandle )

Convert the particle to a cluster; fails if particle is not a cluster.

Returns
S_OK on success

◆ tfParticleHandle_toString()

HRESULT tfParticleHandle_toString ( struct tfParticleHandleHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strstring representation; can be used as an argument in a type particle factory
numCharsnumber of characters of string representation
Returns
S_OK on success

◆ tfParticleList_copy()

HRESULT tfParticleList_copy ( struct tfParticleListHandle * source,
struct tfParticleListHandle * destination )

Copy an instance.

Parameters
sourcelist to copy
destinationhandle to populate
Returns
S_OK on success

◆ tfParticleList_destroy()

HRESULT tfParticleList_destroy ( struct tfParticleListHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfParticleList_extend()

HRESULT tfParticleList_extend ( struct tfParticleListHandle * handle,
struct tfParticleListHandle * other )

inserts the contents of another list

Parameters
handlepopulated handle
otheranother list
Returns
S_OK on success

◆ tfParticleList_free()

HRESULT tfParticleList_free ( struct tfParticleListHandle * handle)

Free the memory associated with the parts list.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfParticleList_fromString()

HRESULT tfParticleList_fromString ( struct tfParticleListHandle * handle,
const char * str )

Create from a JSON string representation.

Returns
S_OK on success

◆ tfParticleList_getAll()

HRESULT tfParticleList_getAll ( struct tfParticleListHandle * handle)

Initialize an instance populated with all current particles.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleList_getCenterOfMass()

HRESULT tfParticleList_getCenterOfMass ( struct tfParticleListHandle * handle,
tfFloatP_t ** com )

Get the center of mass of the particles.

Parameters
handlepopulated handle
com3-element allocated array, center of mass
Returns
S_OK on success

◆ tfParticleList_getCentroid()

HRESULT tfParticleList_getCentroid ( struct tfParticleListHandle * handle,
tfFloatP_t ** cent )

Get the centroid of the particles.

Parameters
handlepopulated handle
cent3-element allocated array, centroid
Returns
S_OK on success

◆ tfParticleList_getForces()

HRESULT tfParticleList_getForces ( struct tfParticleListHandle * handle,
tfFloatP_t ** forces )

Get the forces acting on the particles.

Parameters
handlepopulated handle
forcesarray of 3-element arrays, forces; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleList_getIds()

HRESULT tfParticleList_getIds ( struct tfParticleListHandle * handle,
int ** parts )

Get the particle ids in the list.

Parameters
handlepopulated handle
partsparticle id array
Returns
S_OK on success

◆ tfParticleList_getMomentOfInertia()

HRESULT tfParticleList_getMomentOfInertia ( struct tfParticleListHandle * handle,
tfFloatP_t ** moi )

Get the moment of inertia of the particles.

Parameters
handlepopulated handle
moi9-element allocated array, moment of inertia
Returns
S_OK on success

◆ tfParticleList_getMutable()

HRESULT tfParticleList_getMutable ( struct tfParticleListHandle * handle,
bool * result )

Get whether the list is mutable.

Parameters
handlepopulated handle
resultflag signifying whether the list is mutable

◆ tfParticleList_getNumParts()

HRESULT tfParticleList_getNumParts ( struct tfParticleListHandle * handle,
unsigned int * numParts )

Get the number of particles.

Parameters
handlepopulated handle
numPartsnumber of particles
Returns
S_OK on success

◆ tfParticleList_getOwnsData()

HRESULT tfParticleList_getOwnsData ( struct tfParticleListHandle * handle,
bool * result )

Get whether the list owns its data.

Parameters
handlepopulated handle
resultflag signifying whether the list owns its data

◆ tfParticleList_getPositions()

HRESULT tfParticleList_getPositions ( struct tfParticleListHandle * handle,
tfFloatP_t ** positions )

Get the particle positions.

Parameters
handlepopulated handle
positionsarray of 3-element arrays, positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleList_getRadiusOfGyration()

HRESULT tfParticleList_getRadiusOfGyration ( struct tfParticleListHandle * handle,
tfFloatP_t * rog )

Get the radius of gyration of the particles.

Parameters
handlepopulated handle
rogradius of gyration
Returns
S_OK on success

◆ tfParticleList_getVelocities()

HRESULT tfParticleList_getVelocities ( struct tfParticleListHandle * handle,
tfFloatP_t ** velocities )

Get the particle velocities.

Parameters
handlepopulated handle
velocitiesarray of 3-element arrays, velocities; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleList_getVirial()

HRESULT tfParticleList_getVirial ( struct tfParticleListHandle * handle,
tfFloatP_t ** virial )

Get the virial tensor of the particles.

Parameters
handlepopulated handle
virial9-element allocated array, virial tensor
Returns
S_OK on success

◆ tfParticleList_hasId()

HRESULT tfParticleList_hasId ( struct tfParticleListHandle * handle,
int pid,
bool * result )

Test whether the list has an id.

Parameters
handlepopulated handle
pidid to test
resultresult of test
Returns
S_OK on success

◆ tfParticleList_hasPart()

HRESULT tfParticleList_hasPart ( struct tfParticleListHandle * handle,
struct tfParticleHandleHandle * part,
bool * result )

Test whether the list has a particle.

Parameters
handlepopulated handle
partparticle to test
resultresult of test
Returns
S_OK on success

◆ tfParticleList_init()

HRESULT tfParticleList_init ( struct tfParticleListHandle * handle)

Initialize an empty instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleList_initI()

HRESULT tfParticleList_initI ( struct tfParticleListHandle * handle,
int * parts,
unsigned int numParts )

Initialize an instance with an array of particle ids.

Parameters
handlehandle to populate
partsparticle ids to put in the list
numPartsnumber of particle ids
Returns
S_OK on success

◆ tfParticleList_initP()

HRESULT tfParticleList_initP ( struct tfParticleListHandle * handle,
struct tfParticleHandleHandle ** particles,
unsigned int numParts )

Initialize an instance with an array of particles.

Parameters
handlehandle to populate
particlesparticles to put in the list
numPartsnumber of particles
Returns
S_OK on success

◆ tfParticleList_insertI()

HRESULT tfParticleList_insertI ( struct tfParticleListHandle * handle,
int item,
unsigned int * index )

Insert the given id into the list, returns the index of the item.

Parameters
handlepopulated handle
itemid to insert
indexindex of the particle
Returns
S_OK on success

◆ tfParticleList_insertP()

HRESULT tfParticleList_insertP ( struct tfParticleListHandle * handle,
struct tfParticleHandleHandle * particle,
unsigned int * index )

Inserts the given particle into the list, returns the index of the particle.

Parameters
handlepopulated handle
particleparticle to insert
indexindex of the particle
Returns
S_OK on success

◆ tfParticleList_item()

HRESULT tfParticleList_item ( struct tfParticleListHandle * handle,
unsigned int i,
struct tfParticleHandleHandle * item )

looks for the item at the given index and returns it if found, otherwise returns NULL

Parameters
handlepopulated handle
iindex of lookup
itemreturned item if found
Returns
S_OK on success

◆ tfParticleList_remove()

HRESULT tfParticleList_remove ( struct tfParticleListHandle * handle,
int id )

Looks for the item with the given id and deletes it from the list.

Parameters
handlepopulated handle
idid to remove
Returns
S_OK on success

◆ tfParticleList_setMutable()

HRESULT tfParticleList_setMutable ( struct tfParticleListHandle * handle,
bool flag )

Set whether the list is mutable.

Parameters
handlepopulated handle
flagflag signifying whether the list is mutable

◆ tfParticleList_setOwnsData()

HRESULT tfParticleList_setOwnsData ( struct tfParticleListHandle * handle,
bool flag )

Set whether the list owns its data.

Parameters
handlepopulated handle
flagflag signifying whether the list owns its data

◆ tfParticleList_sphericalPositions()

HRESULT tfParticleList_sphericalPositions ( struct tfParticleListHandle * handle,
tfFloatP_t ** coordinates )

Get the spherical coordinates of each particle for a coordinate system at the center of the universe.

Parameters
handlepopulated handle
coordinatesarray of 3-element arrays, spherical positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleList_sphericalPositionsO()

HRESULT tfParticleList_sphericalPositionsO ( struct tfParticleListHandle * handle,
tfFloatP_t * origin,
tfFloatP_t ** coordinates )

Get the spherical coordinates of each particle for a coordinate system with a specified origin.

Parameters
handlepopulated handle
originoptional origin of coordinates; default is center of universe
coordinatesarray of 3-element arrays, spherical positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleList_toString()

HRESULT tfParticleList_toString ( struct tfParticleListHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strstring representation; can be used as an argument in a type particle factory
numCharsnumber of characters of string representation
Returns
S_OK on success

◆ tfParticleType_createParticle()

HRESULT tfParticleType_createParticle ( struct tfParticleTypeHandle * handle,
int * pid,
tfFloatP_t * position,
tfFloatP_t * velocity )

Particle constructor.

Parameters
handlepopulated handle
pidid of created particle
positionpointer to 3-element array, or NULL for a random position
velocitypointer to 3-element array, or NULL for a random velocity
Returns
S_OK on success

◆ tfParticleType_createParticleS()

HRESULT tfParticleType_createParticleS ( struct tfParticleTypeHandle * handle,
int * pid,
const char * str )

Particle constructor.

Parameters
handlepopulated handle
pidid of created particle
strJSON string defining a particle
Returns
S_OK on success

◆ tfParticleType_eq()

HRESULT tfParticleType_eq ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs == rhs

◆ tfParticleType_factory()

HRESULT tfParticleType_factory ( struct tfParticleTypeHandle * handle,
int ** pids,
unsigned int nr_parts,
tfFloatP_t * positions,
tfFloatP_t * velocities )

Particle factory constructor, for making lots of particles quickly.

At minimum, arguments must specify the number of particles to create, whether specified explicitly or through one or more vector arguments.

Parameters
handlepopulated handle
pidsids of created particle, optional
nr_partsnumber of particles to create
positionsinitial particle positions, optional
velocitiesinitial particle velocities, optional
Returns
S_OK on success

◆ tfParticleType_FindFromName()

HRESULT tfParticleType_FindFromName ( struct tfParticleTypeHandle * handle,
const char * name )

Get a registered particle type by type name.

Parameters
handlehandle to populate
namename of particle type
Returns
S_OK on success

◆ tfParticleType_fromString()

HRESULT tfParticleType_fromString ( struct tfParticleTypeHandle * handle,
const char * str )

Create from a JSON string representation.

The returned type is automatically registered with the engine.

Returns
S_OK on success

◆ tfParticleType_ge()

HRESULT tfParticleType_ge ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs >= rhs

◆ tfParticleType_getDynamics()

HRESULT tfParticleType_getDynamics ( struct tfParticleTypeHandle * handle,
unsigned char * dynamics )

Get the default dynamics of particles of this type.

Returns
S_OK on success

◆ tfParticleType_getFromId()

HRESULT tfParticleType_getFromId ( struct tfParticleTypeHandle * handle,
unsigned int pid )

Get a registered particle type by type id.

Parameters
handlehandle to populate
pidid of type
Returns
S_OK on success

◆ tfParticleType_getFrozen()

HRESULT tfParticleType_getFrozen ( struct tfParticleTypeHandle * handle,
bool * frozen )

Test whether this type is frozen.

Returns
S_OK on success

◆ tfParticleType_getFrozenX()

HRESULT tfParticleType_getFrozenX ( struct tfParticleTypeHandle * handle,
bool * frozen )

Test whether this type is frozen along the x-direction.

Returns
S_OK on success

◆ tfParticleType_getFrozenY()

HRESULT tfParticleType_getFrozenY ( struct tfParticleTypeHandle * handle,
bool * frozen )

Test whether this type is frozen along the y-direction.

Returns
S_OK on success

◆ tfParticleType_getFrozenZ()

HRESULT tfParticleType_getFrozenZ ( struct tfParticleTypeHandle * handle,
bool * frozen )

Test whether this type is frozen along the z-direction.

Returns
S_OK on success

◆ tfParticleType_getId()

HRESULT tfParticleType_getId ( struct tfParticleTypeHandle * handle,
int * id )

Get the type id. -1 if not registered.

Parameters
handlepopulated handle
idtype id
Returns
S_OK on success

◆ tfParticleType_getKineticEnergy()

HRESULT tfParticleType_getKineticEnergy ( struct tfParticleTypeHandle * handle,
tfFloatP_t * kinetic_energy )

Get the kinetic energy of all particles of this type.

Returns
S_OK on success

◆ tfParticleType_getMass()

HRESULT tfParticleType_getMass ( struct tfParticleTypeHandle * handle,
tfFloatP_t * mass )

Get the type mass.

Returns
S_OK on success

◆ tfParticleType_getMinimumRadius()

HRESULT tfParticleType_getMinimumRadius ( struct tfParticleTypeHandle * handle,
tfFloatP_t * minimum_radius )

Get the default minimum radius of this type.

If a split event occurs, resulting particles will have a radius at least as great as this value.

Returns
S_OK on success

◆ tfParticleType_getName()

HRESULT tfParticleType_getName ( struct tfParticleTypeHandle * handle,
char ** name,
unsigned int * numChars )

Get the type name.

Parameters
handlepopulated handle
nametype name
numCharsnumber of characters
Returns
S_OK on success

◆ tfParticleType_getNumParts()

HRESULT tfParticleType_getNumParts ( struct tfParticleTypeHandle * handle,
int * numParts )

Get the number of particles that are a member of this type.

Parameters
handlepopulated handle
numPartsnumber of particles
Returns
S_OK on success

◆ tfParticleType_getParticle()

HRESULT tfParticleType_getParticle ( struct tfParticleTypeHandle * handle,
int i,
struct tfParticleHandleHandle * phandle )

Get the i'th particle that's a member of this type.

Parameters
handlepopulated handle
iindex of particle to get
phandleparticle handle to populate
Returns
S_OK on success

◆ tfParticleType_getParticleFlags()

HRESULT tfParticleType_getParticleFlags ( struct tfParticleTypeHandle * handle,
unsigned int * flags )

Get the particle flags.

Returns
S_OK on success

◆ tfParticleType_getPotentialEnergy()

HRESULT tfParticleType_getPotentialEnergy ( struct tfParticleTypeHandle * handle,
tfFloatP_t * potential_energy )

Get the potential energy of all particles of this type.

Returns
S_OK on success

◆ tfParticleType_getRadius()

HRESULT tfParticleType_getRadius ( struct tfParticleTypeHandle * handle,
tfFloatP_t * radius )

Get the type radius.

Returns
S_OK on success

◆ tfParticleType_getSpecies()

HRESULT tfParticleType_getSpecies ( struct tfParticleTypeHandle * handle,
struct tfStateSpeciesListHandle * slist )

Get the type species. Fails if the type does not have species.

Parameters
handlepopulated handle
slistspecies list
Returns
S_OK on success

◆ tfParticleType_getStyle()

HRESULT tfParticleType_getStyle ( struct tfParticleTypeHandle * handle,
struct tfRenderingStyleHandle * style )

Get the type style.

Parameters
handlepopulated handle
stylehandle to populate
Returns
S_OK on success

◆ tfParticleType_getTargetEnergy()

HRESULT tfParticleType_getTargetEnergy ( struct tfParticleTypeHandle * handle,
tfFloatP_t * target_energy )

Get the target energy of all particles of this type.

Returns
S_OK on success

◆ tfParticleType_getTargetTemperature()

HRESULT tfParticleType_getTargetTemperature ( struct tfParticleTypeHandle * handle,
tfFloatP_t * temperature )

Get the target temperature of this type.

Returns
S_OK on success

◆ tfParticleType_getTemperature()

HRESULT tfParticleType_getTemperature ( struct tfParticleTypeHandle * handle,
tfFloatP_t * temperature )

Get the temperature of this type.

Returns
S_OK on success

◆ tfParticleType_getTypeFlags()

HRESULT tfParticleType_getTypeFlags ( struct tfParticleTypeHandle * handle,
unsigned int * flags )

Get the type flags.

Returns
S_OK on success

◆ tfParticleType_gt()

HRESULT tfParticleType_gt ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs > rhs

◆ tfParticleType_hasPart()

HRESULT tfParticleType_hasPart ( struct tfParticleTypeHandle * handle,
struct tfParticleHandleHandle * part,
bool * result )

Test whether the type has a particle.

Parameters
handlepopulated handle
partparticle to test
resultresult of test
Returns
S_OK on success

◆ tfParticleType_hasPartId()

HRESULT tfParticleType_hasPartId ( struct tfParticleTypeHandle * handle,
int pid,
bool * result )

Test whether the type has an id.

Parameters
handlepopulated handle
pidparticle id to test
resultresult of test
Returns
S_OK on success

◆ tfParticleType_hasSpecies()

HRESULT tfParticleType_hasSpecies ( struct tfParticleTypeHandle * handle,
bool * flag )

Test whether the type has species.

Parameters
handlepopulated handle
flagflag signifying whether the type has species
Returns
S_OK on success

◆ tfParticleType_init()

HRESULT tfParticleType_init ( struct tfParticleTypeHandle * handle)

Initialize an instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleType_initD()

HRESULT tfParticleType_initD ( struct tfParticleTypeHandle * handle,
struct tfParticleTypeSpec pdef )

Initialize an instance from a definition.

Parameters
handlehandle to populate
pdefdefinition
Returns
S_OK on success

◆ tfParticleType_isCluster()

HRESULT tfParticleType_isCluster ( struct tfParticleTypeHandle * handle,
bool * isCluster )

Test whether this type is a cluster type.

Returns
S_OK on success

◆ tfParticleType_isRegistered()

HRESULT tfParticleType_isRegistered ( struct tfParticleTypeHandle * handle,
bool * isRegistered )

Tests whether this type is registered.

Returns
S_OK on success

◆ tfParticleType_le()

HRESULT tfParticleType_le ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs <= rhs

◆ tfParticleType_lt()

HRESULT tfParticleType_lt ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs < rhs

◆ tfParticleType_ne()

HRESULT tfParticleType_ne ( struct tfParticleTypeHandle * lhs,
struct tfParticleTypeHandle * rhs,
bool * result )

Test whether lhs != rhs

◆ tfParticleType_newType()

HRESULT tfParticleType_newType ( struct tfParticleTypeHandle * handle,
const char * _name,
struct tfParticleTypeHandle * newTypehandle )

Particle type constructor.

New type is constructed from the definition of the calling type.

Parameters
handlepopulated handle
_namename of the new type
newTypehandlehandle to populate with new type
Returns
S_OK on success

◆ tfParticleType_registerType()

HRESULT tfParticleType_registerType ( struct tfParticleTypeHandle * handle)

Registers a type with the engine.

Returns
S_OK on success

◆ tfParticleType_setDynamics()

HRESULT tfParticleType_setDynamics ( struct tfParticleTypeHandle * handle,
unsigned char dynamics )

Set the default dynamics of particles of this type.

Returns
S_OK on success

◆ tfParticleType_setFrozen()

HRESULT tfParticleType_setFrozen ( struct tfParticleTypeHandle * handle,
bool frozen )

Set whether this type is frozen.

Returns
S_OK on success

◆ tfParticleType_setFrozenX()

HRESULT tfParticleType_setFrozenX ( struct tfParticleTypeHandle * handle,
bool frozen )

Set whether this type is frozen along the x-direction.

Returns
S_OK on success

◆ tfParticleType_setFrozenY()

HRESULT tfParticleType_setFrozenY ( struct tfParticleTypeHandle * handle,
bool frozen )

Set whether this type is frozen along the y-direction.

Returns
S_OK on success

◆ tfParticleType_setFrozenZ()

HRESULT tfParticleType_setFrozenZ ( struct tfParticleTypeHandle * handle,
bool frozen )

Set whether this type is frozen along the z-direction.

Returns
S_OK on success

◆ tfParticleType_setMass()

HRESULT tfParticleType_setMass ( struct tfParticleTypeHandle * handle,
tfFloatP_t mass )

Set the type mass.

Returns
S_OK on success

◆ tfParticleType_setMinimumRadius()

HRESULT tfParticleType_setMinimumRadius ( struct tfParticleTypeHandle * handle,
tfFloatP_t minimum_radius )

Set the default minimum radius of this type.

If a split event occurs, resulting particles will have a radius at least as great as this value.

Returns
S_OK on success

◆ tfParticleType_setName()

HRESULT tfParticleType_setName ( struct tfParticleTypeHandle * handle,
const char * name )

Set the type name. Throws an error if the type is already registered.

Parameters
handlepopulated handle
nametype name
Returns
S_OK on success

◆ tfParticleType_setParticleFlags()

HRESULT tfParticleType_setParticleFlags ( struct tfParticleTypeHandle * handle,
unsigned int flags )

Set the particle flags.

Returns
S_OK on success

◆ tfParticleType_setRadius()

HRESULT tfParticleType_setRadius ( struct tfParticleTypeHandle * handle,
tfFloatP_t radius )

Set the type radius.

Returns
S_OK on success

◆ tfParticleType_setSpecies()

HRESULT tfParticleType_setSpecies ( struct tfParticleTypeHandle * handle,
struct tfStateSpeciesListHandle * slist )

Set the type species.

Parameters
handlepopulated handle
slistspecies list
Returns
S_OK on success

◆ tfParticleType_setStyle()

HRESULT tfParticleType_setStyle ( struct tfParticleTypeHandle * handle,
struct tfRenderingStyleHandle * style )

Set the type style.

Parameters
handlepopulated handle
stylestyle
Returns
S_OK on success

◆ tfParticleType_setTargetEnergy()

HRESULT tfParticleType_setTargetEnergy ( struct tfParticleTypeHandle * handle,
tfFloatP_t target_energy )

Set the target energy of all particles of this type.

Returns
S_OK on success

◆ tfParticleType_setTargetTemperature()

HRESULT tfParticleType_setTargetTemperature ( struct tfParticleTypeHandle * handle,
tfFloatP_t temperature )

Set the target temperature of this type.

Returns
S_OK on success

◆ tfParticleType_setTypeFlags()

HRESULT tfParticleType_setTypeFlags ( struct tfParticleTypeHandle * handle,
unsigned int flags )

Set the type flags.

Returns
S_OK on success

◆ tfParticleType_str()

HRESULT tfParticleType_str ( struct tfParticleTypeHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string of the type.

Parameters
handlepopulated handle
strarray to populate
numCharsnumber of array characters
Returns
S_OK on success

◆ tfParticleType_toCluster()

HRESULT tfParticleType_toCluster ( struct tfParticleTypeHandle * handle,
struct tfClusterParticleTypeHandle * chandle )

Convert the type to a cluster; fails if the type is not a cluster.

Returns
S_OK on success

◆ tfParticleType_toString()

HRESULT tfParticleType_toString ( struct tfParticleTypeHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strstring representation
numCharsnumber of characters of string representation
Returns
S_OK on success

◆ tfParticleTypeList_copy()

HRESULT tfParticleTypeList_copy ( struct tfParticleTypeListHandle * source,
struct tfParticleTypeListHandle * destination )

Copy an instance.

Parameters
sourcelist to copy
destinationhandle to populate
Returns
S_OK on success

◆ tfParticleTypeList_destroy()

HRESULT tfParticleTypeList_destroy ( struct tfParticleTypeListHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfParticleTypeList_extend()

HRESULT tfParticleTypeList_extend ( struct tfParticleTypeListHandle * handle,
struct tfParticleTypeListHandle * other )

inserts the contents of another list

Parameters
handlepopulated handle
otheranother list
Returns
S_OK on success

◆ tfParticleTypeList_free()

HRESULT tfParticleTypeList_free ( struct tfParticleTypeListHandle * handle)

Free the memory associated with the list.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfParticleTypeList_fromString()

HRESULT tfParticleTypeList_fromString ( struct tfParticleTypeListHandle * handle,
const char * str )

Create from a JSON string representation.

Returns
S_OK on success

◆ tfParticleTypeList_getAll()

HRESULT tfParticleTypeList_getAll ( struct tfParticleTypeListHandle * handle)

Initialize an instance populated with all current particles.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleTypeList_getCenterOfMass()

HRESULT tfParticleTypeList_getCenterOfMass ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** com )

Get the center of mass of the particles.

Parameters
handlepopulated handle
com3-element allocated array, center of mass
Returns
S_OK on success

◆ tfParticleTypeList_getCentroid()

HRESULT tfParticleTypeList_getCentroid ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** cent )

Get the centroid of the particles.

Parameters
handlepopulated handle
cent3-element allocated array, centroid
Returns
S_OK on success

◆ tfParticleTypeList_getForces()

HRESULT tfParticleTypeList_getForces ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** forces )

Get the forces acting on the particles.

Parameters
handlepopulated handle
forcesarray of 3-element arrays, forces; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleTypeList_getIds()

HRESULT tfParticleTypeList_getIds ( struct tfParticleTypeListHandle * handle,
int ** parts )

Get the particle type ids in the list.

Parameters
handlepopulated handle
partsparticle type id array
Returns
S_OK on success

◆ tfParticleTypeList_getMomentOfInertia()

HRESULT tfParticleTypeList_getMomentOfInertia ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** moi )

Get the moment of inertia of the particles.

Parameters
handlepopulated handle
moi9-element allocated array, moment of inertia
Returns
S_OK on success

◆ tfParticleTypeList_getMutable()

HRESULT tfParticleTypeList_getMutable ( struct tfParticleTypeListHandle * handle,
bool * result )

Get whether the list is mutable.

Parameters
handlepopulated handle
resultflag signifying whether the list is mutable

◆ tfParticleTypeList_getNumParts()

HRESULT tfParticleTypeList_getNumParts ( struct tfParticleTypeListHandle * handle,
unsigned int * numParts )

Get the number of particle types.

Parameters
handlepopulated handle
numPartsnumber of particle types
Returns
S_OK on success

◆ tfParticleTypeList_getOwnsData()

HRESULT tfParticleTypeList_getOwnsData ( struct tfParticleTypeListHandle * handle,
bool * result )

Get whether the list owns its data.

Parameters
handlepopulated handle
resultflag signifying whether the list owns its data

◆ tfParticleTypeList_getParticles()

HRESULT tfParticleTypeList_getParticles ( struct tfParticleTypeListHandle * handle,
struct tfParticleListHandle * plist )

Get a particle list populated with particles of all current particle types.

Parameters
handlepopulated handle
plisthandle to populate
Returns
S_OK on success

◆ tfParticleTypeList_getPositions()

HRESULT tfParticleTypeList_getPositions ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** positions )

Get the particle positions.

Parameters
handlepopulated handle
positionsarray of 3-element arrays, positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleTypeList_getRadiusOfGyration()

HRESULT tfParticleTypeList_getRadiusOfGyration ( struct tfParticleTypeListHandle * handle,
tfFloatP_t * rog )

Get the radius of gyration of the particles.

Parameters
handlepopulated handle
rogradius of gyration
Returns
S_OK on success

◆ tfParticleTypeList_getVelocities()

HRESULT tfParticleTypeList_getVelocities ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** velocities )

Get the particle velocities.

Parameters
handlepopulated handle
velocitiesarray of 3-element arrays, velocities; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleTypeList_getVirial()

HRESULT tfParticleTypeList_getVirial ( struct tfParticleTypeListHandle * handle,
tfFloatP_t * virial )

Get the virial tensor of the particles.

Parameters
handlepopulated handle
virial9-element allocated array, virial tensor
Returns
S_OK on success

◆ tfParticleTypeList_hasId()

HRESULT tfParticleTypeList_hasId ( struct tfParticleTypeListHandle * handle,
int pid,
bool * result )

Test whether the list has an id.

Parameters
handlepopulated handle
pidid to test
resultresult of test
Returns
S_OK on success

◆ tfParticleTypeList_hasPart()

HRESULT tfParticleTypeList_hasPart ( struct tfParticleTypeListHandle * handle,
struct tfParticleHandleHandle * part,
bool * result )

Test whether the list has a particle.

Parameters
handlepopulated handle
partparticle to test
resultresult of test
Returns
S_OK on success

◆ tfParticleTypeList_hasType()

HRESULT tfParticleTypeList_hasType ( struct tfParticleTypeListHandle * handle,
struct tfParticleTypeHandle * ptype,
bool * result )

Test whether the list has a particle type.

Parameters
handlepopulated handle
ptypetype to test
resultresult of test
Returns
S_OK on success

◆ tfParticleTypeList_init()

HRESULT tfParticleTypeList_init ( struct tfParticleTypeListHandle * handle)

Initialize an empty instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfParticleTypeList_initI()

HRESULT tfParticleTypeList_initI ( struct tfParticleTypeListHandle * handle,
int * parts,
unsigned int numParts )

Initialize an instance with an array of particle type ids.

Parameters
handlehandle to populate
partsparticle type ids to put in the list
numPartsnumber of particle type ids
Returns
S_OK on success

◆ tfParticleTypeList_initP()

HRESULT tfParticleTypeList_initP ( struct tfParticleTypeListHandle * handle,
struct tfParticleTypeHandle ** parts,
unsigned int numParts )

Initialize an instance with an array of particle types.

Parameters
handlehandle to populate
partsparticle types to put in the list
numPartsnumber of particle types
Returns
S_OK on success

◆ tfParticleTypeList_insertI()

HRESULT tfParticleTypeList_insertI ( struct tfParticleTypeListHandle * handle,
int item,
unsigned int * index )

Insert the given id into the list, returns the index of the item.

Parameters
handlepopulated handle
itemid to insert
indexindex of the particle type
Returns
S_OK on success

◆ tfParticleTypeList_insertP()

HRESULT tfParticleTypeList_insertP ( struct tfParticleTypeListHandle * handle,
struct tfParticleTypeHandle * ptype,
unsigned int * index )

Inserts the given particle type into the list, returns the index of the particle.

Parameters
handlepopulated handle
ptypeparticle type to insert
indexindex of the particle type
Returns
S_OK on success

◆ tfParticleTypeList_item()

HRESULT tfParticleTypeList_item ( struct tfParticleTypeListHandle * handle,
unsigned int i,
struct tfParticleTypeHandle * item )

looks for the item at the given index and returns it if found, otherwise returns NULL

Parameters
handlepopulated handle
iindex of lookup
itemreturned item if found
Returns
S_OK on success

◆ tfParticleTypeList_remove()

HRESULT tfParticleTypeList_remove ( struct tfParticleTypeListHandle * handle,
int id )

Looks for the item with the given id and deletes it from the list.

Parameters
handlepopulated handle
idid to remove
Returns
S_OK on success

◆ tfParticleTypeList_setMutable()

HRESULT tfParticleTypeList_setMutable ( struct tfParticleTypeListHandle * handle,
bool flag )

Set whether the list is mutable.

Parameters
handlepopulated handle
flagflag signifying whether the list is mutable

◆ tfParticleTypeList_setOwnsData()

HRESULT tfParticleTypeList_setOwnsData ( struct tfParticleTypeListHandle * handle,
bool flag )

Set whether the list owns its data.

Parameters
handlepopulated handle
flagflag signifying whether the list owns its data

◆ tfParticleTypeList_sphericalPositions()

HRESULT tfParticleTypeList_sphericalPositions ( struct tfParticleTypeListHandle * handle,
tfFloatP_t ** coordinates )

Get the spherical coordinates of each particle for a coordinate system at the center of the universe.

Parameters
handlepopulated handle
coordinatesarray of 3-element arrays, spherical positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleTypeList_sphericalPositionsO()

HRESULT tfParticleTypeList_sphericalPositionsO ( struct tfParticleTypeListHandle * handle,
tfFloatP_t * origin,
tfFloatP_t ** coordinates )

Get the spherical coordinates of each particle for a coordinate system with a specified origin.

Parameters
handlepopulated handle
originoptional origin of coordinates; default is center of universe
coordinatesarray of 3-element arrays, spherical positions; order is according to the ordering of the list
Returns
S_OK on success

◆ tfParticleTypeList_toString()

HRESULT tfParticleTypeList_toString ( struct tfParticleTypeListHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strstring representation; can be used as an argument in a type particle factory
numCharsnumber of characters of string representation
Returns
S_OK on success