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

Go to the source code of this file.

Data Structures

struct  tfFluxKindHandle
 
struct  tfFluxHandle
 Handle to a Flux instance. More...
 
struct  tfFluxesHandle
 Handle to a Fluxes instance. More...
 

Functions

HRESULT tfFluxKindHandle_init (struct tfFluxKindHandle *handle)
 Initialize an instance.
 
HRESULT tfFlux_getSize (struct tfFluxHandle *handle, unsigned int *size)
 Get the size of the fluxes.
 
HRESULT tfFlux_getKind (struct tfFluxHandle *handle, unsigned int index, unsigned int *kind)
 Get the kind of a flux.
 
HRESULT tfFlux_getTypeIds (struct tfFluxHandle *handle, unsigned int index, unsigned int *typeid_a, unsigned int *typeid_b)
 Get the type ids of a flux.
 
HRESULT tfFlux_getCoef (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t *coef)
 Get the coefficient of a flux.
 
HRESULT tfFlux_setCoef (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t coef)
 Set the coefficient of a flux.
 
HRESULT tfFlux_getDecayCoef (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t *decay_coef)
 Get the decay coefficient of a flux.
 
HRESULT tfFlux_setDecayCoef (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t decay_coef)
 Set the decay coefficient of a flux.
 
HRESULT tfFlux_getTarget (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t *target)
 Get the target of a flux.
 
HRESULT tfFlux_setTarget (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t target)
 Set the target of a flux.
 
HRESULT tfFlux_getCutoff (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t *cutoff)
 Set the cutoff of a flux.
 
HRESULT tfFlux_setCutoff (struct tfFluxHandle *handle, unsigned int index, tfFloatP_t cutoff)
 Set the cutoff of a flux.
 
HRESULT tfFluxes_getSize (struct tfFluxesHandle *handle, int *size)
 Get the number of individual flux objects.
 
HRESULT tfFluxes_getFlux (struct tfFluxesHandle *handle, unsigned int index, struct tfFluxHandle *flux)
 Get a flux.
 
HRESULT tfFluxes_fluxFick (struct tfFluxesHandle *handle, struct tfParticleTypeHandle *A, struct tfParticleTypeHandle *B, const char *name, tfFloatP_t k, tfFloatP_t decay, tfFloatP_t cutoff)
 Creates and binds a Fickian diffusion flux.
 
HRESULT tfFluxes_secrete (struct tfFluxesHandle *handle, struct tfParticleTypeHandle *A, struct tfParticleTypeHandle *B, const char *name, tfFloatP_t k, tfFloatP_t target, tfFloatP_t decay, tfFloatP_t cutoff)
 Creates a secretion flux by active pumping.
 
HRESULT tfFluxes_uptake (struct tfFluxesHandle *handle, struct tfParticleTypeHandle *A, struct tfParticleTypeHandle *B, const char *name, tfFloatP_t k, tfFloatP_t target, tfFloatP_t decay, tfFloatP_t cutoff)
 Creates an uptake flux by active pumping.
 

Function Documentation

◆ tfFlux_getCoef()

HRESULT tfFlux_getCoef ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t * coef )

Get the coefficient of a flux.

Parameters
handlepopulated handle
indexflux index
coefflux coefficient
Returns
S_OK on success

◆ tfFlux_getCutoff()

HRESULT tfFlux_getCutoff ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t * cutoff )

Set the cutoff of a flux.

Parameters
handlepopulated handle
indexflux index
cutoffflux cutoff
Returns
S_OK on success

◆ tfFlux_getDecayCoef()

HRESULT tfFlux_getDecayCoef ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t * decay_coef )

Get the decay coefficient of a flux.

Parameters
handlepopulated handle
indexflux index
decay_coefflux decay coefficient
Returns
S_OK on success

◆ tfFlux_getKind()

HRESULT tfFlux_getKind ( struct tfFluxHandle * handle,
unsigned int index,
unsigned int * kind )

Get the kind of a flux.

Parameters
handlepopulated handle
indexflux index
kindflux kind
Returns
S_OK on success

◆ tfFlux_getSize()

HRESULT tfFlux_getSize ( struct tfFluxHandle * handle,
unsigned int * size )

Get the size of the fluxes.

Parameters
handlepopulated handle
sizeflux size
Returns
S_OK on success

◆ tfFlux_getTarget()

HRESULT tfFlux_getTarget ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t * target )

Get the target of a flux.

Parameters
handlepopulated handle
indexflux index
targetflux target
Returns
S_OK on success

◆ tfFlux_getTypeIds()

HRESULT tfFlux_getTypeIds ( struct tfFluxHandle * handle,
unsigned int index,
unsigned int * typeid_a,
unsigned int * typeid_b )

Get the type ids of a flux.

Parameters
handlepopulated handle
indexflux index
typeid_aid of first type
typeid_bid of second type
Returns
S_OK on success

◆ tfFlux_setCoef()

HRESULT tfFlux_setCoef ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t coef )

Set the coefficient of a flux.

Parameters
handlepopulated handle
indexflux index
coefflux coefficient
Returns
S_OK on success

◆ tfFlux_setCutoff()

HRESULT tfFlux_setCutoff ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t cutoff )

Set the cutoff of a flux.

Parameters
handlepopulated handle
indexflux index
cutoffflux cutoff
Returns
S_OK on success

◆ tfFlux_setDecayCoef()

HRESULT tfFlux_setDecayCoef ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t decay_coef )

Set the decay coefficient of a flux.

Parameters
handlepopulated handle
indexflux index
decay_coefflux decay coefficient
Returns
S_OK on success

◆ tfFlux_setTarget()

HRESULT tfFlux_setTarget ( struct tfFluxHandle * handle,
unsigned int index,
tfFloatP_t target )

Set the target of a flux.

Parameters
handlepopulated handle
indexflux index
targetflux target
Returns
S_OK on success

◆ tfFluxes_fluxFick()

HRESULT tfFluxes_fluxFick ( struct tfFluxesHandle * handle,
struct tfParticleTypeHandle * A,
struct tfParticleTypeHandle * B,
const char * name,
tfFloatP_t k,
tfFloatP_t decay,
tfFloatP_t cutoff )

Creates and binds a Fickian diffusion flux.

Fickian diffusion flux implements the analogous reaction:

\[
     a.S \leftrightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}} \right)\left(a.S - b.S\right) , 
\]

\[
     a.S \rightarrow 0   ; \frac{d}{2} a.S , 
\]

\[
     b.S \rightarrow 0   ; \frac{d}{2} b.S , 
\]

where $ a.S $ is a chemical species located at object $ a $, and likewise for $ b $, $ k $ is the flux constant, $ r $ is the distance between the two objects, $ r_{cutoff} $ is the global cutoff distance, and $ d $ is an optional decay term.

Parameters
handlehandle to populate
Afirst type
Bsecond type
namename of species
kflux transport coefficient
decayflux decay coefficient
cutoffflux cutoff distance
Returns
S_OK on success

◆ tfFluxes_getFlux()

HRESULT tfFluxes_getFlux ( struct tfFluxesHandle * handle,
unsigned int index,
struct tfFluxHandle * flux )

Get a flux.

Parameters
handlepopulated handle
indexflux index
fluxflux
Returns
S_OK on success

◆ tfFluxes_getSize()

HRESULT tfFluxes_getSize ( struct tfFluxesHandle * handle,
int * size )

Get the number of individual flux objects.

Parameters
handlepopulated handle
sizenumber of individual flux objects
Returns
S_OK on success

◆ tfFluxes_secrete()

HRESULT tfFluxes_secrete ( struct tfFluxesHandle * handle,
struct tfParticleTypeHandle * A,
struct tfParticleTypeHandle * B,
const char * name,
tfFloatP_t k,
tfFloatP_t target,
tfFloatP_t decay,
tfFloatP_t cutoff )

Creates a secretion flux by active pumping.

Secretion flux implements the analogous reaction:

\[
     a.S \rightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}} \right)\left(a.S - a.S_{target} \right) ,
\]

\[
     a.S \rightarrow 0   ; \frac{d}{2} a.S ,
\]

\[
     b.S \rightarrow 0   ; \frac{d}{2} b.S ,
\]

where $ a.S $ is a chemical species located at object $ a $, and likewise for $ b $, $ k $ is the flux constant, $ r $ is the distance between the two objects, $ r_{cutoff} $ is the global cutoff distance, and $ d $ is an optional decay term.

Parameters
handlehandle to populate
Afirst type
Bsecond type
namename of species
kflux transport coefficient
targetflux target
decayflux decay coefficient
cutoffflux cutoff distance
Returns
S_OK on success

◆ tfFluxes_uptake()

HRESULT tfFluxes_uptake ( struct tfFluxesHandle * handle,
struct tfParticleTypeHandle * A,
struct tfParticleTypeHandle * B,
const char * name,
tfFloatP_t k,
tfFloatP_t target,
tfFloatP_t decay,
tfFloatP_t cutoff )

Creates an uptake flux by active pumping.

Uptake flux implements the analogous reaction:

\[
     a.S \rightarrow b.S ; k \left(1 - \frac{r}{r_{cutoff}}\right)\left(b.S - b.S_{target} \right)\left(a.S\right) ,
\]

\[
     a.S \rightarrow 0   ; \frac{d}{2} a.S ,
\]

\[
     b.S \rightarrow 0   ; \frac{d}{2} b.S ,
\]

where $ a.S $ is a chemical species located at object $ a $, and likewise for $ b $, $ k $ is the flux constant, $ r $ is the distance between the two objects, $ r_{cutoff} $ is the global cutoff distance, and $ d $ is an optional decay term.

Parameters
handlehandle to populate
Afirst type
Bsecond type
namename of species
kflux transport coefficient
targetflux target
decayflux decay coefficient
cutoffflux cutoff distance
Returns
S_OK on success

◆ tfFluxKindHandle_init()

HRESULT tfFluxKindHandle_init ( struct tfFluxKindHandle * handle)

Initialize an instance.

Parameters
handlehandle to populate
Returns
S_OK on success