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

Handle to a bond. More...

#include <tfBond.h>

Public Member Functions

TissueForge::Bondget ()
 Gets the underlying bond.
 
 BondHandle ()
 Construct a new bond handle and do nothing Subsequent usage will require a call to 'init'.
 
 BondHandle (int id)
 Construct a new bond handle from an existing bond id.
 
 BondHandle (struct TissueForge::Potential *potential, int32_t i, int32_t j, FPTYPE half_life, FPTYPE bond_energy, uint32_t flags)
 Construct a new bond handle and underlying bond.
 
HRESULT init (TissueForge::Potential *pot, TissueForge::ParticleHandle *p1, TissueForge::ParticleHandle *p2, const FPTYPE &half_life=-FPTYPE_ONE, const FPTYPE &bond_energy=-FPTYPE_ONE, uint32_t flags=0)
 For initializing a bond after constructing with default constructor.
 
std::string str () const
 Get a summary string of the bond.
 
bool check ()
 Check the validity of the handle.
 
HRESULT destroy ()
 Destroy the bond.
 
bool decays ()
 Tests whether this bond decays.
 
TissueForge::ParticleHandleoperator[] (unsigned int index)
 
bool has (const int32_t &pid)
 
bool has (ParticleHandle *part)
 
FloatP_t getLength ()
 
FPTYPE getEnergy ()
 
std::vector< int32_t > getParts ()
 
ParticleList getPartList ()
 
TissueForge::PotentialgetPotential ()
 
uint32_t getId ()
 
FPTYPE getDissociationEnergy ()
 
void setDissociationEnergy (const FPTYPE &dissociation_energy)
 
FPTYPE getHalfLife ()
 
void setHalfLife (const FPTYPE &half_life)
 
rendering::StylegetStyle ()
 
void setStyle (rendering::Style *style)
 
FPTYPE getAge ()
 

Static Public Member Functions

static std::vector< BondHandlepairwise (TissueForge::Potential *pot, TissueForge::ParticleList &parts, const FPTYPE &cutoff, std::vector< std::pair< TissueForge::ParticleType *, TissueForge::ParticleType * > * > *ppairs, const FPTYPE &half_life, const FPTYPE &bond_energy, uint32_t flags)
 Apply bonds to a list of particles.
 
static std::vector< BondHandleitems ()
 Gets all bonds in the universe.
 

Public Attributes

int32_t id
 

Detailed Description

Handle to a bond.

This is a safe way to work with a bond.

Constructor & Destructor Documentation

◆ BondHandle() [1/2]

TissueForge::BondHandle::BondHandle ( int id)

Construct a new bond handle from an existing bond id.

Parameters
idid of existing bond

◆ BondHandle() [2/2]

TissueForge::BondHandle::BondHandle ( struct TissueForge::Potential * potential,
int32_t i,
int32_t j,
FPTYPE half_life,
FPTYPE bond_energy,
uint32_t flags )

Construct a new bond handle and underlying bond.

Automatically updates when running on a CUDA device.

Parameters
potentialbond potential
iid of ith particle
jid of jth particle
half_lifebond half life
bond_energybond energy
flagsbond flags

Member Function Documentation

◆ check()

bool TissueForge::BondHandle::check ( )

Check the validity of the handle.

Returns
true if ok
false

◆ decays()

bool TissueForge::BondHandle::decays ( )

Tests whether this bond decays.

Returns
true when the bond should decay

◆ destroy()

HRESULT TissueForge::BondHandle::destroy ( )

Destroy the bond.

Automatically updates when running on a CUDA device.

◆ get()

TissueForge::Bond * TissueForge::BondHandle::get ( )

Gets the underlying bond.

Returns
bond, if available

◆ getAge()

FPTYPE TissueForge::BondHandle::getAge ( )

Get the age

◆ getDissociationEnergy()

FPTYPE TissueForge::BondHandle::getDissociationEnergy ( )

Get the dissociation energy

◆ getEnergy()

FPTYPE TissueForge::BondHandle::getEnergy ( )

Get the energy

◆ getHalfLife()

FPTYPE TissueForge::BondHandle::getHalfLife ( )

Get the half life

◆ getId()

uint32_t TissueForge::BondHandle::getId ( )

Get the id

◆ getLength()

FloatP_t TissueForge::BondHandle::getLength ( )

Get the current length

◆ getPartList()

ParticleList TissueForge::BondHandle::getPartList ( )

Get the particle list

◆ getParts()

std::vector< int32_t > TissueForge::BondHandle::getParts ( )

Get the particle ids

◆ getPotential()

TissueForge::Potential * TissueForge::BondHandle::getPotential ( )

Get the potential

◆ getStyle()

rendering::Style * TissueForge::BondHandle::getStyle ( )

Get the style

◆ has() [1/2]

bool TissueForge::BondHandle::has ( const int32_t & pid)

Test whether the bond has an id

◆ has() [2/2]

bool TissueForge::BondHandle::has ( ParticleHandle * part)

Test whether the bond has a particle

◆ init()

HRESULT TissueForge::BondHandle::init ( TissueForge::Potential * pot,
TissueForge::ParticleHandle * p1,
TissueForge::ParticleHandle * p2,
const FPTYPE & half_life = -FPTYPE_ONE,
const FPTYPE & bond_energy = -FPTYPE_ONE,
uint32_t flags = 0 )

For initializing a bond after constructing with default constructor.

Automatically updates when running on a CUDA device.

Parameters
potbond potential
p1ith particle
p2jth particle
half_lifebond half life
bond_energybond energy
flagsbond flags

◆ pairwise()

static std::vector< BondHandle > TissueForge::BondHandle::pairwise ( TissueForge::Potential * pot,
TissueForge::ParticleList & parts,
const FPTYPE & cutoff,
std::vector< std::pair< TissueForge::ParticleType *, TissueForge::ParticleType * > * > * ppairs,
const FPTYPE & half_life,
const FPTYPE & bond_energy,
uint32_t flags )
static

Apply bonds to a list of particles.

Automatically updates when running on a CUDA device.

Parameters
potthe potential of the created bonds
partslist of particles
cutoffcutoff distance of particles that are bonded
ppairstype pairs of bonds
half_lifebond half life
bond_energybond energy
flagsbond flags
Returns
created bonds

◆ setDissociationEnergy()

void TissueForge::BondHandle::setDissociationEnergy ( const FPTYPE & dissociation_energy)

Set the dissociation energy

◆ setHalfLife()

void TissueForge::BondHandle::setHalfLife ( const FPTYPE & half_life)

Set the half life

◆ setStyle()

void TissueForge::BondHandle::setStyle ( rendering::Style * style)

Set the style


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