|
Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
|
#include "tf_port_c.h"

Go to the source code of this file.
Data Structures | |
| struct | tfFORCE_TYPEHandle |
| Handle to a FORCE_TYPE instance. More... | |
| struct | tfUserForceFuncTypeHandle |
| Handle to a UserForceFuncType instance. More... | |
| struct | tfForceHandle |
| Handle to a Force instance. More... | |
| struct | tfForceSumHandle |
| Handle to a ForceSum instance. More... | |
| struct | tfCustomForceHandle |
| Handle to a CustomForce instance. More... | |
| struct | tfBerendsenHandle |
| Handle to a Berendsen instance. More... | |
| struct | tfGaussianHandle |
| Handle to a Gaussian instance. More... | |
| struct | tfFrictionHandle |
| Handle to a Friction instance. More... | |
Typedefs | |
| typedef void(* | tfUserForceFuncTypeHandleFcn) (struct tfCustomForceHandle *, tfFloatP_t *) |
Functions | |
| HRESULT | tfFORCE_TYPE_init (struct tfFORCE_TYPEHandle *handle) |
| Initialize an instance. | |
| HRESULT | tfForce_EvalFcn_init (struct tfUserForceFuncTypeHandle *handle, tfUserForceFuncTypeHandleFcn *fcn) |
| Initialize an instance. | |
| HRESULT | tfForce_EvalFcn_destroy (struct tfUserForceFuncTypeHandle *handle) |
| Destroy an instance. | |
| HRESULT | tfForce_getType (struct tfForceHandle *handle, unsigned int *te) |
| Get the force type. | |
| HRESULT | tfForce_bind_species (struct tfForceHandle *handle, struct tfParticleTypeHandle *a_type, const char *coupling_symbol) |
| Bind a force to a species. | |
| HRESULT | tfForce_toString (struct tfForceHandle *handle, char **str, unsigned int *numChars) |
| Get a JSON string representation. | |
| HRESULT | tfForce_fromString (struct tfForceHandle *handle, const char *str) |
| Create from a JSON string representation. | |
| HRESULT | tfForce_destroy (struct tfForceHandle *handle) |
| Destroy an instance. | |
| HRESULT | tfForceSum_checkType (struct tfForceHandle *handle, bool *isType) |
| Check whether a base handle is of this force type. | |
| HRESULT | tfForceSum_toBase (struct tfForceSumHandle *handle, struct tfForceHandle *baseHandle) |
| Cast to base force. | |
| HRESULT | tfForceSum_fromBase (struct tfForceHandle *baseHandle, struct tfForceSumHandle *handle) |
| Cast from base force. Fails if instance is not of this type. | |
| HRESULT | tfForceSum_getConstituents (struct tfForceSumHandle *handle, struct tfForceHandle *f1, struct tfForceHandle *f2) |
| Get the constituent forces. | |
| HRESULT | tfCustomForce_init (struct tfCustomForceHandle *handle, struct tfUserForceFuncTypeHandle *func, tfFloatP_t period) |
| Create a custom force with a force function. | |
| HRESULT | tfCustomForce_checkType (struct tfForceHandle *handle, bool *isType) |
| Check whether a base handle is of this force type. | |
| HRESULT | tfCustomForce_toBase (struct tfCustomForceHandle *handle, struct tfForceHandle *baseHandle) |
| Cast to base force. | |
| HRESULT | tfCustomForce_fromBase (struct tfForceHandle *baseHandle, struct tfCustomForceHandle *handle) |
| Cast from base force. Fails if instance is not of this type. | |
| HRESULT | tfCustomForce_getPeriod (struct tfCustomForceHandle *handle, tfFloatP_t *period) |
| Get force period. | |
| HRESULT | tfCustomForce_setPeriod (struct tfCustomForceHandle *handle, tfFloatP_t period) |
| Set force period. | |
| HRESULT | tfCustomForce_setFunction (struct tfCustomForceHandle *handle, struct tfUserForceFuncTypeHandle *fcn) |
| Set force function. | |
| HRESULT | tfCustomForce_getValue (struct tfCustomForceHandle *handle, tfFloatP_t **force) |
| Get current force value. | |
| HRESULT | tfCustomForce_setValue (struct tfCustomForceHandle *handle, tfFloatP_t *force) |
| Set current force value. | |
| HRESULT | tfCustomForce_getLastUpdate (struct tfCustomForceHandle *handle, tfFloatP_t *lastUpdate) |
| Get time of last force update. | |
| HRESULT | tfBerendsen_init (struct tfBerendsenHandle *handle, tfFloatP_t tau) |
| Creates a Berendsen thermostat. | |
| HRESULT | tfBerendsen_checkType (struct tfForceHandle *handle, bool *isType) |
| Check whether a base handle is of this force type. | |
| HRESULT | tfBerendsen_toBase (struct tfBerendsenHandle *handle, struct tfForceHandle *baseHandle) |
| Cast to base force. | |
| HRESULT | tfBerendsen_fromBase (struct tfForceHandle *baseHandle, struct tfBerendsenHandle *handle) |
| Cast from base force. Fails if instance is not of this type. | |
| HRESULT | tfBerendsen_getTimeConstant (struct tfBerendsenHandle *handle, tfFloatP_t *tau) |
| Get the time constant. | |
| HRESULT | tfBerendsen_setTimeConstant (struct tfBerendsenHandle *handle, tfFloatP_t tau) |
| Set the time constant. | |
| HRESULT | tfGaussian_init (struct tfGaussianHandle *handle, tfFloatP_t std, tfFloatP_t mean, tfFloatP_t duration) |
| Creates a random force. | |
| HRESULT | tfGaussian_checkType (struct tfForceHandle *handle, bool *isType) |
| Check whether a base handle is of this force type. | |
| HRESULT | tfGaussian_toBase (struct tfGaussianHandle *handle, struct tfForceHandle *baseHandle) |
| Cast to base force. | |
| HRESULT | tfGaussian_fromBase (struct tfForceHandle *baseHandle, struct tfGaussianHandle *handle) |
| Cast from base force. Fails if instance is not of this type. | |
| HRESULT | tfGaussian_getStd (struct tfGaussianHandle *handle, tfFloatP_t *std) |
| Get the magnitude standard deviation. | |
| HRESULT | tfGaussian_setStd (struct tfGaussianHandle *handle, tfFloatP_t std) |
| Set the magnitude standard deviation. | |
| HRESULT | tfGaussian_getMean (struct tfGaussianHandle *handle, tfFloatP_t *mean) |
| Get the magnitude mean. | |
| HRESULT | tfGaussian_setMean (struct tfGaussianHandle *handle, tfFloatP_t mean) |
| Set the magnitude mean. | |
| HRESULT | tfGaussian_getDuration (struct tfGaussianHandle *handle, tfFloatP_t *duration) |
| Get the magnitude duration. | |
| HRESULT | tfGaussian_setDuration (struct tfGaussianHandle *handle, tfFloatP_t duration) |
| Set the magnitude duration. | |
| HRESULT | tfFriction_init (struct tfFrictionHandle *handle, tfFloatP_t coeff) |
| Creates a friction force. | |
| HRESULT | tfFriction_checkType (struct tfForceHandle *handle, bool *isType) |
| Check whether a base handle is of this force type. | |
| HRESULT | tfFriction_toBase (struct tfFrictionHandle *handle, struct tfForceHandle *baseHandle) |
| Cast to base force. | |
| HRESULT | tfFriction_fromBase (struct tfForceHandle *baseHandle, struct tfFrictionHandle *handle) |
| Cast from base force. Fails if instance is not of this type. | |
| HRESULT | tfFriction_getCoef (struct tfFrictionHandle *handle, tfFloatP_t *coef) |
| Get the friction coefficient. | |
| HRESULT | tfFriction_setCoef (struct tfFrictionHandle *handle, tfFloatP_t coef) |
| Set the friction coefficient. | |
| HRESULT | tfForce_add (struct tfForceHandle *f1, struct tfForceHandle *f2, struct tfForceSumHandle *fSum) |
| Add two forces. | |
| HRESULT tfBerendsen_checkType | ( | struct tfForceHandle * | handle, |
| bool * | isType ) |
Check whether a base handle is of this force type.
| handle | populated handle |
| isType | flag signifying whether the handle is of this force type |
| HRESULT tfBerendsen_fromBase | ( | struct tfForceHandle * | baseHandle, |
| struct tfBerendsenHandle * | handle ) |
Cast from base force. Fails if instance is not of this type.
| baseHandle | populated handle |
| handle | handle to populate |
| HRESULT tfBerendsen_getTimeConstant | ( | struct tfBerendsenHandle * | handle, |
| tfFloatP_t * | tau ) |
Get the time constant.
| handle | populated handle |
| tau | time constant |
| HRESULT tfBerendsen_init | ( | struct tfBerendsenHandle * | handle, |
| tfFloatP_t | tau ) |
Creates a Berendsen thermostat.
The thermostat uses the target temperature 
The Berendsen thermostat force has the function form:
![\[
\frac{\mathbf{p}}{\tau_T} \left(\frac{T_0}{T} - 1 \right),
\]](../../form_15.png)
where 




| handle | handle to populate |
| tau | time constant that determines how rapidly the thermostat effects the system. |
| HRESULT tfBerendsen_setTimeConstant | ( | struct tfBerendsenHandle * | handle, |
| tfFloatP_t | tau ) |
Set the time constant.
| handle | populated handle |
| tau | time constant |
| HRESULT tfBerendsen_toBase | ( | struct tfBerendsenHandle * | handle, |
| struct tfForceHandle * | baseHandle ) |
Cast to base force.
| handle | populated handle |
| baseHandle | handle to populate |
| HRESULT tfCustomForce_checkType | ( | struct tfForceHandle * | handle, |
| bool * | isType ) |
Check whether a base handle is of this force type.
| handle | populated handle |
| isType | flag signifying whether the handle is of this force type |
| HRESULT tfCustomForce_fromBase | ( | struct tfForceHandle * | baseHandle, |
| struct tfCustomForceHandle * | handle ) |
Cast from base force. Fails if instance is not of this type.
| baseHandle | populated handle |
| handle | handle to populate |
| HRESULT tfCustomForce_getLastUpdate | ( | struct tfCustomForceHandle * | handle, |
| tfFloatP_t * | lastUpdate ) |
Get time of last force update.
| handle | populated handle |
| lastUpdate | time of last force update |
| HRESULT tfCustomForce_getPeriod | ( | struct tfCustomForceHandle * | handle, |
| tfFloatP_t * | period ) |
Get force period.
| handle | populated handle |
| period | force period |
| HRESULT tfCustomForce_getValue | ( | struct tfCustomForceHandle * | handle, |
| tfFloatP_t ** | force ) |
Get current force value.
| handle | populated handle |
| force | force value |
| HRESULT tfCustomForce_init | ( | struct tfCustomForceHandle * | handle, |
| struct tfUserForceFuncTypeHandle * | func, | ||
| tfFloatP_t | period ) |
Create a custom force with a force function.
| handle | handle to populate |
| func | function to evaluate the force components |
| period | force period; infinite if a negative value is passed |
| HRESULT tfCustomForce_setFunction | ( | struct tfCustomForceHandle * | handle, |
| struct tfUserForceFuncTypeHandle * | fcn ) |
Set force function.
| handle | populated handle |
| fcn | force function |
| HRESULT tfCustomForce_setPeriod | ( | struct tfCustomForceHandle * | handle, |
| tfFloatP_t | period ) |
Set force period.
| handle | populated handle |
| period | force period |
| HRESULT tfCustomForce_setValue | ( | struct tfCustomForceHandle * | handle, |
| tfFloatP_t * | force ) |
Set current force value.
| handle | populated handle |
| force | force value |
| HRESULT tfCustomForce_toBase | ( | struct tfCustomForceHandle * | handle, |
| struct tfForceHandle * | baseHandle ) |
Cast to base force.
| handle | populated handle |
| baseHandle | handle to populate |
| HRESULT tfForce_add | ( | struct tfForceHandle * | f1, |
| struct tfForceHandle * | f2, | ||
| struct tfForceSumHandle * | fSum ) |
Add two forces.
| f1 | first force |
| f2 | second force |
| fSum | handle to populate with force sum |
| HRESULT tfForce_bind_species | ( | struct tfForceHandle * | handle, |
| struct tfParticleTypeHandle * | a_type, | ||
| const char * | coupling_symbol ) |
Bind a force to a species.
When a force is bound to a species, the magnitude of the force is scaled by the concentration of the species.
| handle | populated handle |
| a_type | particle type containing the species |
| coupling_symbol | symbol of the species |
| HRESULT tfForce_destroy | ( | struct tfForceHandle * | handle | ) |
Destroy an instance.
| handle | populated handle |
| HRESULT tfForce_EvalFcn_destroy | ( | struct tfUserForceFuncTypeHandle * | handle | ) |
Destroy an instance.
| handle | handle to populate |
| HRESULT tfForce_EvalFcn_init | ( | struct tfUserForceFuncTypeHandle * | handle, |
| tfUserForceFuncTypeHandleFcn * | fcn ) |
Initialize an instance.
| handle | handle to populate |
| fcn | evaluation function |
| HRESULT tfForce_fromString | ( | struct tfForceHandle * | handle, |
| const char * | str ) |
Create from a JSON string representation.
The returned type is automatically registered with the engine.
| HRESULT tfForce_getType | ( | struct tfForceHandle * | handle, |
| unsigned int * | te ) |
Get the force type.
| handle | populated handle |
| te | type enum |
| HRESULT tfForce_toString | ( | struct tfForceHandle * | handle, |
| char ** | str, | ||
| unsigned int * | numChars ) |
Get a JSON string representation.
| handle | populated handle |
| str | string representation; can be used as an argument in a type particle factory |
| numChars | number of characters of string representation |
| HRESULT tfFORCE_TYPE_init | ( | struct tfFORCE_TYPEHandle * | handle | ) |
Initialize an instance.
| handle | handle to populate |
| HRESULT tfForceSum_checkType | ( | struct tfForceHandle * | handle, |
| bool * | isType ) |
Check whether a base handle is of this force type.
| handle | populated handle |
| isType | flag signifying whether the handle is of this force type |
| HRESULT tfForceSum_fromBase | ( | struct tfForceHandle * | baseHandle, |
| struct tfForceSumHandle * | handle ) |
Cast from base force. Fails if instance is not of this type.
| baseHandle | populated handle |
| handle | handle to populate |
| HRESULT tfForceSum_getConstituents | ( | struct tfForceSumHandle * | handle, |
| struct tfForceHandle * | f1, | ||
| struct tfForceHandle * | f2 ) |
Get the constituent forces.
| handle | populated handle |
| f1 | first constituent force |
| f2 | second constituent force |
| HRESULT tfForceSum_toBase | ( | struct tfForceSumHandle * | handle, |
| struct tfForceHandle * | baseHandle ) |
Cast to base force.
| handle | populated handle |
| baseHandle | handle to populate |
| HRESULT tfFriction_checkType | ( | struct tfForceHandle * | handle, |
| bool * | isType ) |
Check whether a base handle is of this force type.
| handle | populated handle |
| isType | flag signifying whether the handle is of this force type |
| HRESULT tfFriction_fromBase | ( | struct tfForceHandle * | baseHandle, |
| struct tfFrictionHandle * | handle ) |
Cast from base force. Fails if instance is not of this type.
| baseHandle | populated handle |
| handle | handle to populate |
| HRESULT tfFriction_getCoef | ( | struct tfFrictionHandle * | handle, |
| tfFloatP_t * | coef ) |
Get the friction coefficient.
| handle | populated handle |
| coef | friction coefficient |
| HRESULT tfFriction_init | ( | struct tfFrictionHandle * | handle, |
| tfFloatP_t | coeff ) |
Creates a friction force.
A friction force has the form:
![\[
- \frac{|| \mathbf{v} ||}{\tau} \mathbf{v} ,
\]](../../form_19.png)
where 

| handle | handle to populate |
| coeff | time constant |
| HRESULT tfFriction_setCoef | ( | struct tfFrictionHandle * | handle, |
| tfFloatP_t | coef ) |
Set the friction coefficient.
| handle | populated handle |
| coef | friction coefficient |
| HRESULT tfFriction_toBase | ( | struct tfFrictionHandle * | handle, |
| struct tfForceHandle * | baseHandle ) |
Cast to base force.
| handle | populated handle |
| baseHandle | handle to populate |
| HRESULT tfGaussian_checkType | ( | struct tfForceHandle * | handle, |
| bool * | isType ) |
Check whether a base handle is of this force type.
| handle | populated handle |
| isType | flag signifying whether the handle is of this force type |
| HRESULT tfGaussian_fromBase | ( | struct tfForceHandle * | baseHandle, |
| struct tfGaussianHandle * | handle ) |
Cast from base force. Fails if instance is not of this type.
| baseHandle | populated handle |
| handle | handle to populate |
| HRESULT tfGaussian_getDuration | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t * | duration ) |
Get the magnitude duration.
| handle | populated handle |
| duration | magnitude duration |
| HRESULT tfGaussian_getMean | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t * | mean ) |
Get the magnitude mean.
| handle | populated handle |
| mean | mean magnitude |
| HRESULT tfGaussian_getStd | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t * | std ) |
Get the magnitude standard deviation.
| handle | populated handle |
| std | magnitude standard deviation |
| HRESULT tfGaussian_init | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t | std, | ||
| tfFloatP_t | mean, | ||
| tfFloatP_t | duration ) |
Creates a random force.
A random force has a randomly selected orientation and magnitude.
Orientation is selected according to a uniform distribution on the unit sphere.
Magnitude is selected according to a prescribed mean and standard deviation.
| handle | handle to populate |
| std | standard deviation of magnitude |
| mean | mean of magnitude |
| duration | duration of force. |
| HRESULT tfGaussian_setDuration | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t | duration ) |
Set the magnitude duration.
| handle | populated handle |
| duration | magnitude duration |
| HRESULT tfGaussian_setMean | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t | mean ) |
Set the magnitude mean.
| handle | populated handle |
| mean | mean magnitude |
| HRESULT tfGaussian_setStd | ( | struct tfGaussianHandle * | handle, |
| tfFloatP_t | std ) |
Set the magnitude standard deviation.
| handle | populated handle |
| std | magnitude standard deviation |
| HRESULT tfGaussian_toBase | ( | struct tfGaussianHandle * | handle, |
| struct tfForceHandle * | baseHandle ) |
Cast to base force.
| handle | populated handle |
| baseHandle | handle to populate |