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

A custom force function. More...

#include <tfForce.h>

Inheritance diagram for TissueForge::CustomForce:
Collaboration diagram for TissueForge::CustomForce:

Public Member Functions

virtual void onTime (FPTYPE time)
 
virtual FVector3 getValue ()
 
void setValue (const FVector3 &f)
 
void setValue (UserForceFuncType *_userFunc=NULL)
 
FPTYPE getPeriod ()
 
void setPeriod (const FPTYPE &period)
 
bool isCustom ()
 Tests whether this object is a custom force type.
 
 CustomForce (const FVector3 &f, const FPTYPE &period=std::numeric_limits< FPTYPE >::max())
 
 CustomForce (UserForceFuncType *f, const FPTYPE &period=std::numeric_limits< FPTYPE >::max())
 
- Public Member Functions inherited from TissueForge::Force
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 CustomForcefromForce (Force *f)
 Convert basic force to CustomForce.
 
- Static Public Member Functions inherited from TissueForge::Force
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

UserForceFuncType * userFunc
 
FPTYPE updateInterval
 
FPTYPE lastUpdate
 
FVector3 force
 
- Public Attributes inherited from TissueForge::Force
FORCE_TYPE type = FORCE_FORCE
 
Force_EvalFcn func
 
int stateVectorIndex = -1
 

Detailed Description

A custom force function.

The force is updated according to an update frequency.

Member Function Documentation

◆ fromForce()

static CustomForce * TissueForge::CustomForce::fromForce ( Force * f)
static

Convert basic force to CustomForce.

If the basic force is not a CustomForce, then NULL is returned.

Parameters
f
Returns
CustomForce*

◆ isCustom()

bool TissueForge::CustomForce::isCustom ( )
inlinevirtual

Tests whether this object is a custom force type.

Returns
true if custom

Reimplemented from TissueForge::Force.

◆ onTime()

virtual void TissueForge::CustomForce::onTime ( FPTYPE time)
virtual

notify this user force object of a simulation time step,

this will check if interval has elapsed, and update the function.

throws std::exception if userfunc is not a valid kind.

◆ setValue() [1/2]

void TissueForge::CustomForce::setValue ( const FVector3 & f)

sets the value of the force to a vector

throws std::exception if invalid value.

◆ setValue() [2/2]

void TissueForge::CustomForce::setValue ( UserForceFuncType * _userFunc = NULL)

sets the value of the force from a user function. if a user function is passed, then it is stored as the user function of the force

throws std::exception if invalid value.


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