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

Force is a metatype, in that Tissue Forge has lots of different instances of force functions, that have different attributes, but only have one base type. More...

#include <tfForce.h>

Inheritance diagram for TissueForge::Force:
Collaboration diagram for TissueForge::Force:

Public Member Functions

virtual bool isCustom ()
 Tests whether this object is a custom force type.
 
HRESULT bind_species (struct ParticleType *a_type, const std::string &coupling_symbol)
 Bind a force to a species.
 
Forceoperator+ (const Force &rhs)
 
virtual std::string toString ()
 Get a JSON string representation.
 

Static Public Member Functions

static Berendsenberendsen_tstat (const FPTYPE &tau)
 Creates a Berendsen thermostat.
 
static Gaussianrandom (const FPTYPE &std, const FPTYPE &mean, const FPTYPE &duration=0.01)
 Creates a random force.
 
static Frictionfriction (const FPTYPE &coef)
 Creates a friction force.
 
static ForcefromString (const std::string &str)
 Create from a JSON string representation.
 

Public Attributes

FORCE_TYPE type = FORCE_FORCE
 
Force_EvalFcn func
 
int stateVectorIndex = -1
 

Detailed Description

Force is a metatype, in that Tissue Forge has lots of different instances of force functions, that have different attributes, but only have one base type.

Forces are one of the fundamental processes in Tissue Forge that cause objects to move.

Member Function Documentation

◆ berendsen_tstat()

static Berendsen * TissueForge::Force::berendsen_tstat ( const FPTYPE & tau)
static

Creates a Berendsen thermostat.

The thermostat uses the target temperature $ T_0 $ from the object to which it is bound. The Berendsen thermostat effectively re-scales the velocities of an object in order to make the temperature of that family of objects match a specified temperature.

The Berendsen thermostat force has the function form:

\[

     \frac{\mathbf{p}}{\tau_T} \left(\frac{T_0}{T} - 1 \right),

\]

where $ \mathbf{p} $ is the momentum, $ T $ is the measured temperature of a family of particles, $ T_0 $ is the control temperature, and $ \tau_T $ is the coupling constant. The coupling constant is a measure of the time scale on which the thermostat operates, and has units of time. Smaller values of $ \tau_T $ result in a faster acting thermostat, and larger values result in a slower acting thermostat.

Parameters
tautime constant that determines how rapidly the thermostat effects the system.
Returns
Berendsen*

◆ bind_species()

HRESULT TissueForge::Force::bind_species ( struct ParticleType * a_type,
const std::string & 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.

Parameters
a_typeparticle type containing the species
coupling_symbolsymbol of the species
Returns
HRESULT

◆ friction()

static Friction * TissueForge::Force::friction ( const FPTYPE & coef)
static

Creates a friction force.

A friction force has the form:

\[

     - \frac{|| \mathbf{v} ||}{\tau} \mathbf{v} ,

\]

where $ \mathbf{v} $ is the velocity of a particle and $ \tau $ is a time constant.

Parameters
coeftime constant
Returns
Friction*

◆ fromString()

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

Create from a JSON string representation.

Parameters
str
Returns
Force*

◆ isCustom()

virtual bool TissueForge::Force::isCustom ( )
inlinevirtual

Tests whether this object is a custom force type.

Returns
true if custom

Reimplemented in TissueForge::CustomForce.

◆ random()

static Gaussian * TissueForge::Force::random ( const FPTYPE & std,
const FPTYPE & mean,
const FPTYPE & duration = 0.01 )
static

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.

Parameters
stdstandard deviation of magnitude
meanmean of magnitude
durationduration of force. Defaults to 0.01.
Returns
Gaussian*

◆ toString()

virtual std::string TissueForge::Force::toString ( )
virtual

Get a JSON string representation.

Returns
std::string

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