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

A flux is defined between a pair of types, and acts on the state vector between a pair of instances. More...

#include <tfFlux.h>

Collaboration diagram for TissueForge::Fluxes:

Public Member Functions

std::string toString ()
 Get a JSON string representation.
 

Static Public Member Functions

static FluxesnewFluxes (int32_t init_size)
 
static Fluxescreate (FluxKind kind, ParticleType *a, ParticleType *b, const std::string &name, FPTYPE k, FPTYPE decay, FPTYPE target, FPTYPE cutoff=-FPTYPE_ONE)
 
static FluxesaddFlux (FluxKind kind, Fluxes *fluxes, int16_t typeId_a, int16_t typeId_b, int32_t index_a, int32_t index_b, FPTYPE k, FPTYPE decay, FPTYPE target, FPTYPE cutoff)
 
static FluxesfluxFick (ParticleType *A, ParticleType *B, const std::string &name, const FPTYPE &k, const FPTYPE &decay=FPTYPE_ZERO, const FPTYPE &cutoff=-FPTYPE_ONE)
 Creates and binds a Fickian diffusion flux.
 
static Fluxesflux (ParticleType *A, ParticleType *B, const std::string &name, const FPTYPE &k, const FPTYPE &decay=FPTYPE_ZERO, const FPTYPE &cutoff=-FPTYPE_ONE)
 Alias of fluxFick.
 
static Fluxessecrete (ParticleType *A, ParticleType *B, const std::string &name, const FPTYPE &k, const FPTYPE &target, const FPTYPE &decay=FPTYPE_ZERO, const FPTYPE &cutoff=-FPTYPE_ONE)
 Creates a secretion flux by active pumping.
 
static Fluxesuptake (ParticleType *A, ParticleType *B, const std::string &name, const FPTYPE &k, const FPTYPE &target, const FPTYPE &decay=FPTYPE_ZERO, const FPTYPE &cutoff=-FPTYPE_ONE)
 Creates an uptake flux by active pumping.
 
static FluxesfromString (const std::string &str)
 Create from a JSON string representation.
 

Public Attributes

int32_t size
 
int32_t fluxes_size
 
Flux fluxes []
 

Detailed Description

A flux is defined between a pair of types, and acts on the state vector between a pair of instances.

The indices of the species in each state vector are most likely different, so Tissue Forge tracks the indices in each type, and the transport constatants.

A flux between a pair of types, and pair of respective species needs:

(1) type A, (2) type B, (3) species id in A, (4) species id in B, (5) transport constant.

Allocates Flux as a single block, member pointers point to offsets in these blocks.

Allocated size is: sizeof(Fluxes) + 2 * alloc_size * sizeof(int32) + alloc_size * sizeof(FPTYPE)

Member Function Documentation

◆ flux()

static Fluxes * TissueForge::Fluxes::flux ( ParticleType * A,
ParticleType * B,
const std::string & name,
const FPTYPE & k,
const FPTYPE & decay = FPTYPE_ZERO,
const FPTYPE & cutoff = -FPTYPE_ONE )
static

Alias of fluxFick.

Parameters
Afirst type
Bsecond type
namename of species
ktransport coefficient
decayoptional decay. Defaults to 0.0.
cutoffoptional cutoff distance. Defaults to global cutoff
Returns
Fluxes*

◆ fluxFick()

static Fluxes * TissueForge::Fluxes::fluxFick ( ParticleType * A,
ParticleType * B,
const std::string & name,
const FPTYPE & k,
const FPTYPE & decay = FPTYPE_ZERO,
const FPTYPE & cutoff = -FPTYPE_ONE )
static

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.

Automatically updates when running on a CUDA device.

Parameters
Afirst type
Bsecond type
namename of species
ktransport coefficient
decayoptional decay. Defaults to 0.0.
cutoffoptional cutoff distance. Defaults to global cutoff
Returns
Fluxes*

◆ fromString()

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

Create from a JSON string representation.

Parameters
str
Returns
Fluxes*

◆ secrete()

static Fluxes * TissueForge::Fluxes::secrete ( ParticleType * A,
ParticleType * B,
const std::string & name,
const FPTYPE & k,
const FPTYPE & target,
const FPTYPE & decay = FPTYPE_ZERO,
const FPTYPE & cutoff = -FPTYPE_ONE )
static

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.

Automatically updates when running on a CUDA device.

Parameters
Afirst type
Bsecond type
namename of species
ktransport coefficient
targettarget concentration
decayoptional decay. Defaults to 0.0
cutoffoptional cutoff distance. Defaults to global cutoff
Returns
Fluxes*

◆ toString()

std::string TissueForge::Fluxes::toString ( )

Get a JSON string representation.

Returns
std::string

◆ uptake()

static Fluxes * TissueForge::Fluxes::uptake ( ParticleType * A,
ParticleType * B,
const std::string & name,
const FPTYPE & k,
const FPTYPE & target,
const FPTYPE & decay = FPTYPE_ZERO,
const FPTYPE & cutoff = -FPTYPE_ONE )
static

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.

Automatically updates when running on a CUDA device.

Parameters
Afirst type
Bsecond type
namename of species
ktransport coefficient
targettarget concentration
decayoptional decay. Defaults to 0.0
cutoffoptional cutoff distance. Defaults to global cutoff
Returns
Fluxes*

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